/* ─── CABINET LAYOUT (wide, stable) ───────────────────────────────────────── */
.cabinet-layout {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

@media (max-width: 991px) {
  .cabinet-layout {
    grid-template-columns: 1fr;
    padding: 32px 16px 48px;
  }
}

.cabinet-sidebar {
  position: sticky;
  top: 88px;
  background: #f9f9f9;
  border-radius: 12px;
  padding: 16px;
  height: fit-content;
}

@media (max-width: 991px) {
  .cabinet-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .cabinet-sidebar a {
    flex: 1 1 auto;
    text-align: center;
  }
}

.cabinet-sidebar a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #444;
  transition: background 0.15s;
}

.cabinet-sidebar a:hover,
.cabinet-sidebar a.active {
  background: #e8f5e9;
  color: #1a5c3a;
}

.cabinet-sidebar-divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 12px 0;
}

.cabinet-sidebar-logout {
  margin-top: 12px;
  color: #c0392b !important;
}

.cabinet-sidebar-logout:hover {
  background: #fdecea !important;
  color: #962d22 !important;
}

.cabinet-order-status {
  margin-bottom: 12px;
  font-size: 15px;
}

.auth-page-lead {
  margin: -8px 0 20px;
  color: #666;
  font-size: 15px;
  line-height: 1.5;
}

.cabinet-main {
  min-width: 0;
}

.cabinet-main h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.cabinet-intro {
  margin-bottom: 28px;
  color: #666;
  font-size: 15px;
}

.cabinet-section {
  margin-bottom: 36px;
}

.cabinet-section-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 14px;
  color: #222;
}

.cabinet-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cabinet-section-head .cabinet-section-title {
  margin-bottom: 0;
}

/* ─── DASHBOARD STATS ─────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.stats-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1199px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479px) {
  .stats-grid,
  .stats-grid--3 {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 18px 16px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card--accent {
  background: linear-gradient(135deg, #f0faf4 0%, #e8f5e9 100%);
  border-color: #d4eadc;
}

.stat-card .num {
  font-size: 26px;
  font-weight: 700;
  color: #1a5c3a;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-card .num--money {
  font-size: 22px;
}

.stat-card .label {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  line-height: 1.35;
}

.stat-card .sub {
  font-size: 11px;
  color: #999;
  margin-top: 6px;
}

/* ─── STATUS BREAKDOWN ────────────────────────────────────────────────────── */
.status-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 18px 20px;
}

.status-row {
  display: grid;
  grid-template-columns: 120px 1fr 48px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

@media (max-width: 599px) {
  .status-row {
    grid-template-columns: 90px 1fr 36px;
    gap: 8px;
  }
}

.status-row-label {
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-row-bar-wrap {
  height: 8px;
  background: #e8e8e8;
  border-radius: 99px;
  overflow: hidden;
}

.status-row-bar {
  height: 100%;
  background: #3d8f63;
  border-radius: 99px;
  min-width: 2px;
  transition: width 0.3s ease;
}

.status-row-bar--new { background: #3d8f63; }
.status-row-bar--confirmed { background: #2f7350; }
.status-row-bar--shipped { background: #5ba87a; }
.status-row-bar--done { background: #1a5c3a; }
.status-row-bar--cancelled { background: #bbb; }

.status-row-count {
  text-align: right;
  font-weight: 600;
  color: #333;
  font-variant-numeric: tabular-nums;
}

/* ─── TABLES ──────────────────────────────────────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: auto;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.data-table td:not(.col-action):not(.col-check),
.data-table th:not(.col-action):not(.col-check) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table th {
  font-weight: 600;
  background: #f9f9f9;
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background: #fafafa;
}

.data-table .col-id { width: 56px; }
.data-table .col-date { width: 130px; }
.data-table .col-status { width: 120px; }
.data-table .col-money { width: 110px; text-align: right; }
.data-table .col-qty { width: 72px; text-align: center; }
.data-table .col-action {
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  white-space: nowrap;
  text-align: right;
  overflow: visible;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.table-actions a,
.table-actions .table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.table-actions a:hover {
  border-color: #1a5c3a;
  color: #1a5c3a;
  background: #f3faf5;
}

.table-actions .table-action-btn--danger {
  border-color: #e8b4b0;
  color: #c0392b;
  background: #fff;
}

.table-actions .table-action-btn--danger:hover {
  border-color: #c0392b;
  color: #fff;
  background: #c0392b;
}

.data-table .col-money,
.data-table th.col-money {
  text-align: right;
}

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 991px) {
  .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ─── FORMS (cabinet pages) ───────────────────────────────────────────────── */
.form-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 28px;
  max-width: 720px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: #1a5c3a;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.cabinet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.cabinet-toolbar h1 {
  margin-bottom: 0;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  background: #f0f0f0;
  color: #555;
}

.status-badge--new { background: #e8f5e9; color: #1a5c3a; }
.status-badge--confirmed { background: #d4eadc; color: #1a5c3a; }
.status-badge--shipped { background: #c8e6c9; color: #2f7350; }
.status-badge--done { background: #1a5c3a; color: #fff; }
.status-badge--cancelled { background: #f5f5f5; color: #999; }

/* ─── ORDERS ─────────────────────────────────────────────────────────────── */
.sidebar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 99px;
  background: #c0392b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.orders-unread-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  background: #fff3cd;
  color: #856404;
  font-size: 12px;
  font-weight: 600;
}

.orders-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.orders-filter {
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid #ddd;
  font-size: 13px;
  color: #555;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.orders-filter:hover {
  border-color: #1a5c3a;
  color: #1a5c3a;
}

.orders-filter.is-active {
  background: #1a5c3a;
  border-color: #1a5c3a;
  color: #fff;
}

.orders-bulk-bar,
.cabinet-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #f8f8f8;
  border-radius: 8px;
}

.orders-check-all,
.cabinet-check-all {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.orders-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.btn-danger {
  color: #c0392b !important;
  border-color: #e8b4b0 !important;
}

.btn-danger:hover,
button.btn-primary.btn-danger {
  background: #c0392b !important;
  border-color: #c0392b !important;
  color: #fff !important;
}

.data-table .col-check {
  width: 36px;
  text-align: center;
}

.data-table-row--unread td {
  background: #f3faf5;
}

.data-table-row--unread:hover td {
  background: #e8f5ec;
}

.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 4px;
  border-radius: 50%;
  background: #1a5c3a;
  vertical-align: middle;
}

.th-sort {
  color: inherit;
  font-weight: inherit;
  white-space: nowrap;
}

.th-sort:hover {
  color: #1a5c3a;
}

.order-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.order-status-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.btn-danger-link {
  color: #c0392b;
}

.btn-danger-link:hover {
  color: #962d22;
}

.cabinet-delete-warning {
  margin: 16px 0 0;
  padding: 16px;
  border-radius: 10px;
  background: #fff8e6;
  border: 1px solid #f0dfa8;
}

.cabinet-delete-warning p {
  margin: 0;
  color: #664d03;
  line-height: 1.5;
}
