/* ==========================================================================
   admin-sidebar.css
   Additive stylesheet for the sidebar shell + Clearing Calculator pages.
   Load AFTER css/style.css. Reuses the existing design tokens defined in
   style.css (--navy-950, --amber-500, --slate-*, --radius, --shadow, etc.)
   so everything stays visually consistent with the rest of the admin.
   Nothing in style.css is modified or overridden except where noted.
   ========================================================================== */

/* ---------- Shell: sidebar + content sit side by side under the header ---------- */
.admin-shell {
  display: flex;
  align-items: flex-start;
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--header-h, 78px) + 24px) 0 100px;
  gap: 0;
}

.admin-sidebar {
  position: sticky;
  top: calc(var(--header-h, 78px) + 16px);
  flex: 0 0 232px;
  width: 232px;
  margin-right: 28px;
  margin-left: 24px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  overflow: hidden;
  align-self: flex-start;
}

.admin-sidebar-section {
  padding: 14px 12px 6px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--slate-500);
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 14px;
  margin: 2px 8px;
  border: none;
  background: none;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.admin-nav-item:hover { background: var(--slate-50); color: var(--navy-950); }
.admin-nav-item.is-active {
  background: var(--navy-950);
  color: var(--white);
}
.admin-nav-icon { flex-shrink: 0; width: 18px; text-align: center; font-size: 14px; }
.admin-nav-badge {
  margin-left: auto;
  background: var(--amber-500);
  color: var(--white);
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  line-height: 1.5;
}
.admin-nav-item.is-active .admin-nav-badge { background: rgba(255,255,255,0.25); }

.admin-sidebar-divider { height: 1px; background: var(--slate-200); margin: 8px 0; }

.admin-sidebar-foot {
  padding: 12px 16px 16px;
  font-size: 11px;
  color: var(--slate-500);
  border-top: 1px solid var(--slate-100);
  margin-top: 6px;
}

/* ---------- Content column ---------- */
.admin-content { flex: 1 1 auto; min-width: 0; padding: 0 24px; }
.admin-content h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; color: var(--navy-950); }
.admin-content .admin-sub { color: var(--slate-500); font-size: 14.5px; margin: 0 0 30px; }

/* Pages toggle visibility — content is all rendered, JS just shows one at a time */
.admin-page { display: none; }
.admin-page.is-active { display: block; }

/* ---------- Mobile: sidebar becomes a horizontal scroll strip ---------- */
@media (max-width: 900px) {
  .admin-shell { flex-direction: column; padding-top: calc(var(--header-h, 78px) + 16px); }
  .admin-sidebar {
    position: static;
    width: auto;
    margin: 0 16px 20px;
    display: flex;
    overflow-x: auto;
    padding: 6px;
  }
  .admin-sidebar-section, .admin-sidebar-divider, .admin-sidebar-foot { display: none; }
  .admin-nav-item { flex: 0 0 auto; margin: 4px; white-space: nowrap; }
  .admin-content { padding: 0 16px; }
}

/* ---------- Calculator fee stat cards (reuse .stat-card, add accent variants) ---------- */
.stat-card.stat-accent-blue::before { background: linear-gradient(90deg, var(--navy-900), var(--navy-700)); opacity: 1; }
.stat-card.stat-accent-green::before { background: linear-gradient(90deg, #16a34a, #22c55e); opacity: 1; }
.stat-card.stat-accent-amber::before { background: linear-gradient(90deg, var(--amber-500), var(--amber-600)); opacity: 1; }

/* ---------- Status badges specific to calculator payment status ---------- */
.pay-badge.completed { background: #dcfce7; color: #15803d; }
.pay-badge.cancelled { background: var(--slate-100); color: var(--slate-600); }

/* ---------- Small "view" / receipt link buttons reused from .row-actions but scoped ---------- */
.calc-view-btn {
  font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 7px;
  border: 1px solid var(--slate-200); background: var(--white); color: var(--navy-900);
  cursor: pointer; font-family: inherit; transition: all 0.15s ease;
}
.calc-view-btn:hover { border-color: var(--navy-900); background: var(--navy-950); color: var(--white); }

/* ---------- Modal for calculation breakdown detail ---------- */
.calc-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(16, 20, 30, 0.55);
  z-index: 500;
  align-items: center; justify-content: center;
  padding: 20px;
}
.calc-modal-overlay.is-open { display: flex; }
.calc-modal {
  background: var(--white);
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 30px;
}
.calc-modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.calc-modal-head h3 { font-size: 19px; font-weight: 800; color: var(--navy-950); margin: 0; }
.calc-modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--slate-500); line-height: 1; padding: 4px; }
.calc-modal-close:hover { color: var(--slate-900); }

.calc-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.calc-detail-item { background: var(--slate-50); border-radius: 9px; padding: 10px 13px; }
.calc-detail-item.full { grid-column: 1 / -1; }
.calc-detail-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--slate-500); margin-bottom: 3px; }
.calc-detail-val { font-size: 13.5px; font-weight: 600; color: var(--slate-900); word-break: break-word; }

.calc-mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.calc-mini-table th {
  background: var(--navy-950); color: var(--white);
  padding: 8px 11px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
}
.calc-mini-table th:last-child, .calc-mini-table td:last-child { text-align: right; }
.calc-mini-table td { padding: 8px 11px; border-bottom: 1px solid var(--slate-100); color: var(--slate-700); }
.calc-mini-table tr.calc-total-row td {
  background: var(--navy-950); color: var(--white); font-weight: 800; font-size: 13.5px;
}

/* ---------- Export bar ---------- */
.export-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
  background: var(--white); border: 1px solid var(--slate-200); border-radius: 14px;
  padding: 20px 22px; margin-bottom: 28px;
}
.export-field { display: flex; flex-direction: column; gap: 5px; }
.export-field label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--slate-500); }
.export-field input, .export-field select {
  padding: 9px 12px; border: 1px solid var(--slate-200); border-radius: 8px; font-size: 13.5px; font-family: inherit;
}
.export-field input:focus, .export-field select:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(16, 52, 166, 0.12); }
