.performance-strip {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--border);
  box-shadow: var(--shadow-sm);
}

.performance-strip > div {
  min-height: 82px;
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
}

.performance-strip span,
.performance-strip small {
  color: var(--ink-muted);
  font-size: 9px;
}

.performance-strip strong {
  margin: 6px 0 3px;
  font-size: 17px;
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}

.metric-icon {
  font-size: 12px;
  font-weight: 900;
}

.chart-header { align-items: center; }
.chart-actions { display: flex; align-items: center; gap: 18px; }
.segmented-control {
  padding: 3px;
  display: inline-flex;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
}

.segmented-control button {
  height: 27px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  color: var(--ink-muted);
  background: transparent;
  font-size: 8px;
  font-weight: 750;
  cursor: pointer;
}

.segmented-control button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(17, 18, 26, .08);
}

.text-button {
  padding: 6px 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.clickable-order { cursor: pointer; }
.clickable-order:hover td { background: #f8f8fc; }

.orders-view { margin-top: 28px; }
.orders-view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.orders-view-head h2 {
  margin: 0 0 5px;
  font-size: 24px;
  letter-spacing: -.04em;
}

.orders-view-head > div > p:last-child {
  margin: 0;
  color: var(--ink-muted);
  font-size: 10px;
}

.export-button { white-space: nowrap; }
.orders-toolbar {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 190px 190px 125px;
  gap: 9px;
  margin-bottom: 13px;
}

.search-field { position: relative; }
.search-field > span {
  position: absolute;
  left: 13px;
  top: 50%;
  z-index: 1;
  color: var(--ink-muted);
  transform: translateY(-50%);
}
.search-field input { padding-left: 35px; }
.orders-toolbar input,
.orders-toolbar select {
  width: 100%;
  height: 39px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--ink-soft);
  background: var(--surface);
  outline: none;
  font-size: 10px;
}
.orders-toolbar select { padding: 0 10px; cursor: pointer; }
.orders-toolbar input:focus,
.orders-toolbar select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(101,87,232,.08); }
.orders-register { overflow: hidden; }
.orders-register .table-wrap { margin-top: 0; }
.orders-register table { min-width: 950px; }
.row-action {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--surface);
  cursor: pointer;
}
.row-action:hover { color: var(--primary); border-color: #cfcaf8; background: var(--primary-soft); }
.pagination {
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border);
}
.pagination span { min-width: 100px; color: var(--ink-muted); font-size: 9px; text-align: center; }
.pagination button {
  height: 31px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.pagination button:disabled { opacity: .4; cursor: default; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(11, 12, 18, .42);
  backdrop-filter: blur(3px);
}

.order-drawer {
  position: fixed;
  z-index: 51;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100vh;
  padding: 25px;
  overflow-y: auto;
  background: var(--surface);
  box-shadow: -24px 0 70px rgba(10, 11, 18, .18);
  transform: translateX(105%);
  transition: transform .25s ease;
}
.order-drawer.open { transform: translateX(0); }
body.drawer-open { overflow: hidden; }
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.drawer-header h2 { margin: 0; font-size: 21px; letter-spacing: -.04em; }
.drawer-header button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 20px;
  cursor: pointer;
}
.drawer-meta {
  padding: 17px 0 23px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.drawer-meta > div {
  min-height: 67px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
}
.drawer-meta > div > span { color: var(--ink-muted); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.drawer-meta > div > div { color: var(--ink); font-size: 10px; }
.drawer-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.drawer-section-head h3 { margin: 0 0 4px; font-size: 14px; }
.drawer-section-head p { margin: 0; color: var(--ink-muted); font-size: 8px; }
.drawer-section-head > span { color: var(--ink); font-size: 13px; font-weight: 800; }
.order-entries { display: grid; gap: 9px; }
.entry-card {
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.entry-main { min-width: 0; display: flex; align-items: center; gap: 10px; }
.entry-quantity { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 850; }
.entry-main div { min-width: 0; }
.entry-main h4 { margin: 0 0 4px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.entry-main p { margin: 0; color: var(--ink-muted); font-size: 8px; }
.entry-money { flex: 0 0 auto; display: grid; gap: 3px; text-align: right; }
.entry-money strong { font-size: 11px; }
.entry-money span { color: var(--ink-muted); font-size: 8px; }
.entries-placeholder,
.entries-error,
.entries-loading {
  min-height: 125px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  color: var(--ink-muted);
  background: var(--surface-soft);
  font-size: 9px;
  text-align: center;
}
.entries-error strong { margin-bottom: 5px; color: var(--red); font-size: 10px; }
.entries-error p { margin: 0; line-height: 1.5; }
.entries-loading span {
  width: 27px;
  height: 27px;
  margin-bottom: 9px;
  border: 3px solid #dedafc;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.entries-loading p { margin: 0; }

@media (max-width: 1100px) {
  .performance-strip { grid-template-columns: repeat(2, 1fr); }
  .orders-toolbar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .performance-strip { grid-template-columns: 1fr 1fr; }
  .performance-strip > div { min-height: 73px; padding: 12px; }
  .performance-strip strong { font-size: 15px; }
  .chart-actions { align-items: flex-end; }
  .segmented-control { max-width: 100%; overflow-x: auto; }
  .segmented-control button { white-space: nowrap; }
  .orders-toolbar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .orders-view-head { align-items: flex-start; }
  .export-button { width: 39px; overflow: hidden; font-size: 0; }
  .export-button::before { content: "↓"; font-size: 15px; }
  .pagination { justify-content: center; }
  .order-drawer { padding: 20px 16px; }
  .drawer-meta { grid-template-columns: 1fr 1fr; }
  .entry-card { align-items: flex-start; }
}
