        /* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #f4f6f8;
  color: #222;
  line-height: 1.4;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1100px;
  margin: 30px auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
}

.header {
  padding: 15px 20px;
  background: #111827;
  color: #fff;
  font-size: 18px;
}

.nav a {
  margin-right: 15px;
  text-decoration: none;
  color: #2563eb;
  font-weight: 500;
}

/* ===== CARDS ===== */
.card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

/* ===== FORMS ===== */
input, select, textarea {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

button {
  padding: 10px 16px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

button:hover {
  background: #1e40af;
}

.btn-danger {
  background: #dc2626;
}
.btn-danger:hover {
  background:#b91c1c;
}
.btn-primary {
  background:#2563eb;
  color:#fff;
}
.btn-primary:hover {
  background:#1d4ed8;
}
.btn-sm {
  padding:6px 10px;
  font-size:12px;
}

.btn-secondary {
  background: #6b7280;
}

/* ===== TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

th {
  background: #f9fafb;
  font-weight: 600;
}

/* ===== UTIL ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
}
/* ===== ADMIN LAYOUT ===== */
.app-body { background:#f1f5f9; }
.app-layout { display:flex; height:100vh; }

.sidebar {
  width:260px;
  background:#0f172a;
  color:#e5e7eb;
  display:flex;
  flex-direction:column;
}

.sidebar-brand {
  padding:18px;
  font-weight:800;
  border-bottom:1px solid #1e293b;
}
.sidebar-brand span { color:#60a5fa; }

.sidebar-nav { flex:1; padding:10px; }

.menu-link,.menu-btn{
  width:100%;
  padding:10px 14px;
  border-radius:8px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  color:#e5e7eb;
  background:none;
  border:0;
  cursor:pointer;
  text-decoration:none;
  font-size:14px;
}
.menu-group { margin-bottom:4px; }
.menu-link:hover,.menu-btn:hover{background:#1e293b}

.submenu{
  max-height:0;
  overflow:hidden;
  margin-left:12px;
  border-left:2px solid #334155;
  transition:max-height .3s ease;
}
.submenu.open{max-height:500px}
.submenu a{
  display:block;
  padding:8px 12px;
  border-radius:6px;
  font-size:13px;
  color:#e5e7eb;
  text-decoration:none;
}
.submenu a:hover{background:#1e293b}

.active{
  background:linear-gradient(135deg,#2563eb,#1d4ed8);
  color:#fff;
}

.logout-btn{
  margin:12px;
  padding:10px;
  background:#dc2626;
  color:#fff;
  text-align:center;
  border-radius:8px;
}

/* ===== MAIN ===== */
.main{flex:1;display:flex;flex-direction:column}
.topbar{
  background:#fff;
  padding:14px 20px;
  display:flex;
  justify-content:space-between;
  border-bottom:1px solid #e5e7eb;
}
.content{flex:1;padding:20px;overflow:auto}
.content-card{
  background:#fff;
  border-radius:12px;
  padding:20px;
  box-shadow:0 1px 4px rgba(0,0,0,.05);
}
/* ===== DASHBOARD ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.dash-card {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  padding: 24px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(37,99,235,.35);
}

.dash-title {
  font-size: 14px;
  opacity: .9;
  font-weight: 600;
}

.dash-value {
  font-size: 32px;
  font-weight: 800;
  margin-top: 6px;
}
/* ===== COMMON ===== */
.card {
  background:#fff;
  padding:16px;
  border-radius:10px;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
  margin-bottom:20px;
}

.form-inline {
  display:flex;
  gap:12px;
}

input {
  padding:10px;
  border:1px solid #d1d5db;
  border-radius:6px;
  flex:1;
}

.btn {
  padding:10px 18px;
  border-radius:6px;
  border:0;
  cursor:pointer;
}

.btn-success {
  background:#16a34a;
  color:#fff;
}

.btn-success:hover {
  background:#15803d;
}

/* ===== TABLE ===== */
.table {
  width:100%;
  border-collapse:collapse;
  background:#fff;
  border-radius:10px;
  overflow:hidden;
}

.table th,
.table td {
  padding:12px;
  border-bottom:1px solid #e5e7eb;
  text-align:left;
}

.table thead {
  background:#f1f5f9;
}

.text-center { text-align:center; }
.muted { color:#6b7280; }
/* ===== PRODUCTS TABLE FIX ===== */

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.table th {
  background: #f1f5f9;
  padding: 10px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid #e5e7eb;
}

.table td {
  padding: 10px;
  vertical-align: top;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
}

/* Product image */
.thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
}

/* MRP / Stock badges */
.wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  background: #dcfce7;
  color: #166534;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

/* Buttons */
.btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 12px;
}

.btn-success {
  background: #16a34a;
  color: #fff;
}
.btn-success:hover {
  background: #15803d;
}

.btn-purple {
  background: #7c3aed;
  color: #fff;
}
.btn-purple:hover {
  background: #6d28d9;
}

.btn-sm {
  padding: 5px 8px;
  font-size: 11px;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  cursor: pointer;
  font-size: 12px;
}

.pagination button.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
/* ===== MODAL BACKDROP ===== */
.modal-bg {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* HIDE */
.modal-bg.hidden {
    display: none;
}

/* MODAL BOX */
.modal {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* OPTIONAL */
.modal h3 {
    margin-bottom: 15px;
}
/* ===== MODAL BACKDROP ===== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* hidden state */
.modal-backdrop.hidden {
    display: none;
}

/* ===== MODAL BOX ===== */
.modal {
    background: #fff;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;

    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,.3);

    position: relative;
    overflow: hidden;
}

/* ===== IFRAME ===== */
.modal iframe {
    width: 100%;
    height: 75vh;
    border: none;
}

/* ===== CLOSE BUTTON ===== */
.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;

    background: #ef4444;
    color: #fff;
    border: none;

    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;

    font-size: 16px;
    line-height: 32px;
    text-align: center;
}

/* ===== ALERTS ===== */
.alert-success {
  background: #d4edda;
  color: #155724;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.alert-danger {
  background: #f8d7da;
  color: #721c24;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 14px;
}

/* ===== ADMIN SHELL v2 (scoped) ===== */
.admin-shell {
  --adm-sidebar: #0c1222;
  --adm-sidebar-hover: #151d32;
  --adm-sidebar-border: #1e293b;
  --adm-accent: #3b82f6;
  --adm-accent-dark: #2563eb;
  --adm-surface: #ffffff;
  --adm-bg: #f0f4f8;
  --adm-text: #0f172a;
  --adm-muted: #64748b;
  --adm-radius: 12px;
  --adm-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

.admin-shell.app-body {
  background: var(--adm-bg);
}

.admin-shell .app-layout {
  min-height: 100vh;
  height: auto;
}

.admin-shell .sidebar {
  width: 272px;
  background: linear-gradient(180deg, var(--adm-sidebar) 0%, #0a0f1a 100%);
  border-right: 1px solid var(--adm-sidebar-border);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 200;
  flex-shrink: 0;
  transition: width 0.25s ease, transform 0.28s ease, opacity 0.2s ease, border-color 0.25s ease;
}

.admin-shell .sidebar-brand {
  padding: 20px 18px 16px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--adm-sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-shell .sidebar-brand .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.admin-shell .sidebar-brand span {
  color: #60a5fa;
}

.admin-shell .sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.admin-shell .menu-link,
.admin-shell .menu-btn {
  gap: 10px;
  margin-bottom: 2px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-shell .menu-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.9;
  flex-shrink: 0;
  line-height: 1;
}

.admin-shell .menu-text {
  flex: 1;
  text-align: left;
}

.admin-shell .menu-btn .arrow {
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.admin-shell .menu-btn.active .arrow {
  transform: rotate(90deg);
}

.admin-shell .submenu {
  margin-left: 14px;
  padding-left: 8px;
  border-left: 2px solid #334155;
}

.admin-shell .submenu a {
  color: #94a3b8;
  font-size: 13px;
  padding: 7px 10px;
  transition: all 0.15s ease;
}

.admin-shell .submenu a:hover {
  color: #e2e8f0;
  background: var(--adm-sidebar-hover);
}

.admin-shell .submenu a.active {
  color: #fff;
  background: rgba(59, 130, 246, 0.2);
  font-weight: 600;
}

.admin-shell .menu-link.active,
.admin-shell .menu-btn.active {
  background: linear-gradient(135deg, var(--adm-accent), var(--adm-accent-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.admin-shell .logout-btn {
  margin: 10px 12px 14px;
  padding: 11px;
  background: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, 0.35);
  font-weight: 600;
  text-decoration: none;
  display: block;
  transition: all 0.15s ease;
}

.admin-shell .logout-btn:hover {
  background: #dc2626;
  color: #fff;
  text-decoration: none;
}

.admin-shell .sidebar-collapse-btn {
  display: none;
  align-items: center;
  gap: 10px;
  width: calc(100% - 24px);
  margin: 4px 12px 8px;
  padding: 10px 12px;
  border: 1px solid var(--adm-sidebar-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-shell .sidebar-collapse-btn:hover {
  background: var(--adm-sidebar-hover);
  color: #e2e8f0;
}

.admin-shell .sidebar-collapse-btn .menu-icon {
  font-size: 16px;
  line-height: 1;
}

.admin-shell .main {
  min-width: 0;
  background: var(--adm-bg);
}

.admin-shell .topbar {
  background: var(--adm-surface);
  padding: 14px 24px;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-shell .topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.admin-shell .sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--adm-text);
}

.admin-shell .topbar h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--adm-text);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-shell .topbar-sub {
  font-size: 12px;
  color: var(--adm-muted);
  margin-top: 2px;
}

.admin-shell .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.admin-shell .tenant-pill {
  display: none;
  padding: 6px 12px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #bfdbfe;
}

.admin-shell .user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
}

.admin-shell .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.admin-shell .user-meta {
  line-height: 1.2;
}

.admin-shell .user-meta small {
  display: block;
  font-size: 11px;
  color: var(--adm-muted);
  font-weight: 500;
}

.admin-shell .user-meta b {
  font-size: 13px;
  color: var(--adm-text);
}

.admin-shell .content {
  padding: 24px;
}

.admin-shell .content-card {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.admin-shell .content-card > h2:first-child {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--adm-text);
  margin-bottom: 16px;
}

.admin-shell .content-card .card {
  border: 1px solid #e2e8f0;
  box-shadow: var(--adm-shadow);
  border-radius: var(--adm-radius);
}

.admin-shell table,
.admin-shell .table {
  border-radius: var(--adm-radius);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.admin-shell th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-shell input,
.admin-shell select,
.admin-shell textarea {
  border-color: #cbd5e1;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-shell input:focus,
.admin-shell select:focus,
.admin-shell textarea:focus {
  outline: none;
  border-color: var(--adm-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.admin-shell button,
.admin-shell .btn {
  font-weight: 600;
  transition: transform 0.1s ease, background 0.15s ease;
}

.admin-shell button:active,
.admin-shell .btn:active {
  transform: translateY(1px);
}

/* Dashboard */
.admin-shell .dash-welcome {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: #fff;
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.25);
}

.admin-shell .dash-welcome h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 6px;
  color: #fff;
}

.admin-shell .dash-welcome p {
  margin: 0;
  opacity: 0.9;
  font-size: 14px;
}

.admin-shell .dashboard-grid {
  gap: 16px;
  margin-top: 0;
}

.admin-shell .dash-card {
  border-radius: 14px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  border: none;
}

.admin-shell .dash-card::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.admin-shell .dash-card.dash-blue {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.admin-shell .dash-card.dash-green {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.3);
}

.admin-shell .dash-card.dash-orange {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.3);
}

.admin-shell .dash-card.dash-purple {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

.admin-shell .dash-card.dash-teal {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.3);
}

.admin-shell .dash-card.dash-indigo {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.admin-shell .dash-icon {
  font-size: 22px;
  margin-bottom: 8px;
  opacity: 0.95;
}

.admin-shell .dash-title {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.92;
}

.admin-shell .dash-value {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.admin-shell .dash-meta {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 6px;
}

.admin-shell .quick-actions {
  margin-top: 28px;
}

.admin-shell .quick-actions h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--adm-text);
  margin-bottom: 14px;
}

.admin-shell .quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.admin-shell .quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--adm-surface);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: var(--adm-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--adm-shadow);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.admin-shell .quick-link:hover {
  border-color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  color: var(--adm-accent-dark);
}

.admin-shell .quick-link .ql-icon {
  font-size: 18px;
}

.admin-shell .sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 150;
  backdrop-filter: blur(2px);
}

.admin-shell .sidebar-overlay.show {
  display: block;
}

/* Login page */
.admin-login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%);
}

.admin-login-wrap {
  width: 100%;
  max-width: 420px;
}

.admin-login-brand {
  text-align: center;
  color: #fff;
  margin-bottom: 24px;
}

.admin-login-brand h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 12px 0 6px;
}

.admin-login-brand p {
  opacity: 0.85;
  font-size: 14px;
  margin: 0;
}

.admin-login-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.admin-login-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: #0f172a;
}

.admin-login-card button[type="submit"] {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  margin-top: 8px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

@media (min-width: 900px) {
  .admin-shell .tenant-pill {
    display: inline-block;
  }

  .admin-shell .sidebar-toggle {
    display: grid;
    place-items: center;
  }

  .admin-shell .sidebar-collapse-btn {
    display: flex;
  }

  .admin-shell.sidebar-collapsed .sidebar {
    width: 0;
    min-width: 0;
    border-right-width: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 899px) {
  .admin-shell .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
  }

  .admin-shell .sidebar.open {
    transform: translateX(0);
  }

  .admin-shell .sidebar-toggle {
    display: grid;
    place-items: center;
  }

  .admin-shell .content {
    padding: 16px;
  }

  .admin-shell .user-meta {
    display: none;
  }
}

/* Coverage admin (list + report) */
.admin-shell .cov-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  padding: 16px 18px;
  background: var(--adm-surface);
  border: 1px solid #e2e8f0;
  border-radius: var(--adm-radius);
  box-shadow: var(--adm-shadow);
  margin-bottom: 20px;
}

.admin-shell .cov-toolbar .cov-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.admin-shell .cov-toolbar .cov-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--adm-muted);
}

.admin-shell .cov-toolbar .cov-field input,
.admin-shell .cov-toolbar .cov-field select {
  min-width: 120px;
  padding: 8px 10px;
  font-size: 13px;
}

.admin-shell .cov-toolbar .cov-field.grow {
  flex: 1 1 180px;
}

.admin-shell .cov-toolbar .cov-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-shell .cov-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.admin-shell .cov-stat {
  background: var(--adm-surface);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--adm-shadow);
}

.admin-shell .cov-stat b {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--adm-text);
  line-height: 1.1;
}

.admin-shell .cov-stat span {
  font-size: 12px;
  color: var(--adm-muted);
  font-weight: 600;
}

.admin-shell .cov-stat.accent b { color: #2563eb; }
.admin-shell .cov-stat.success b { color: #059669; }
.admin-shell .cov-stat.warn b { color: #d97706; }

.admin-shell .cov-section {
  background: var(--adm-surface);
  border: 1px solid #e2e8f0;
  border-radius: var(--adm-radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--adm-shadow);
}

.admin-shell .cov-section h4 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--adm-text);
}

.admin-shell .cov-progress-lg {
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.admin-shell .cov-progress-lg > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.admin-shell .cov-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.admin-shell .cov-status-chip {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.admin-shell .cov-status-chip strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--adm-text);
}

.admin-shell .cov-status-chip small {
  font-size: 11px;
  color: var(--adm-muted);
  font-weight: 600;
}

.admin-shell .cov-status-chip.st-visited { border-color: #bbf7d0; background: #f0fdf4; }
.admin-shell .cov-status-chip.st-closed { border-color: #e2e8f0; background: #f1f5f9; }
.admin-shell .cov-status-chip.st-no-order { border-color: #fed7aa; background: #fff7ed; }
.admin-shell .cov-status-chip.st-payment { border-color: #fde68a; background: #fffbeb; }
.admin-shell .cov-status-chip.st-owner { border-color: #ddd6fe; background: #f5f3ff; }

.admin-shell .cov-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.admin-shell .cov-badge.visited { background: #dcfce7; color: #166534; }
.admin-shell .cov-badge.shop_closed { background: #e2e8f0; color: #475569; }
.admin-shell .cov-badge.no_order { background: #ffedd5; color: #9a3412; }
.admin-shell .cov-badge.payment_pending { background: #fef3c7; color: #92400e; }
.admin-shell .cov-badge.owner_not_available { background: #ede9fe; color: #5b21b6; }

.admin-shell .cov-table-wrap {
  overflow-x: auto;
  border-radius: var(--adm-radius);
  border: 1px solid #e2e8f0;
}

.admin-shell .cov-table-wrap table {
  margin: 0;
  border: none;
  min-width: 640px;
}

.admin-shell .cov-table-wrap th,
.admin-shell .cov-table-wrap td {
  font-size: 13px;
  padding: 10px 12px;
}

.admin-shell .cov-plan-name {
  font-weight: 700;
  color: var(--adm-text);
}

.admin-shell .cov-plan-meta {
  font-size: 11px;
  color: var(--adm-muted);
  margin-top: 2px;
}

.admin-shell .cov-salesmen-list {
  font-size: 12px;
  color: #475569;
  max-width: 200px;
  line-height: 1.4;
}

.admin-shell .cov-mini-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  min-width: 72px;
  margin: 6px 0 2px;
}

.admin-shell .cov-mini-bar > span {
  display: block;
  height: 100%;
  background: #22c55e;
  border-radius: 6px;
}

.admin-shell .cov-target-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.admin-shell .cov-target-card {
  background: var(--adm-surface);
  border: 1px solid #e2e8f0;
  border-radius: var(--adm-radius);
  padding: 16px 18px;
  box-shadow: var(--adm-shadow);
}

.admin-shell .cov-target-card.is-met {
  border-color: #86efac;
  background: #f0fdf4;
}

.admin-shell .cov-target-card.is-below {
  border-color: #fde68a;
  background: #fffbeb;
}

.admin-shell .cov-target-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.admin-shell .cov-target-formula {
  margin: 0 0 12px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}

.admin-shell .cov-target-numbers {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  color: #475569;
  margin-bottom: 8px;
}

.admin-shell .cov-target-numbers strong {
  font-size: 22px;
  color: var(--adm-text);
}

.admin-shell .cov-target-pct {
  margin-left: auto;
  font-weight: 700;
  color: #2563eb;
}

.admin-shell .cov-compliance-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-shell .cov-compliance-success { background: #dcfce7; color: #166534; }
.admin-shell .cov-compliance-warn { background: #fef3c7; color: #92400e; }
.admin-shell .cov-compliance-muted { background: #f1f5f9; color: #64748b; }

.admin-shell .cov-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-shell .cov-action-btns a {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--adm-text);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.admin-shell .cov-action-btns a:hover {
  border-color: #93c5fd;
  color: var(--adm-accent-dark);
  text-decoration: none;
}

.admin-shell .cov-action-btns a.primary {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.admin-shell .cov-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--adm-muted);
  font-size: 14px;
}

.admin-shell .cov-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-shell .cov-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.admin-shell .cov-header .cov-sub {
  font-size: 13px;
  color: var(--adm-muted);
  margin-top: 4px;
}

.admin-shell .cov-back {
  font-size: 13px;
  font-weight: 600;
  color: var(--adm-accent-dark);
  text-decoration: none;
}

.admin-shell .cov-back:hover { text-decoration: underline; }

.admin-shell .cov-week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-shell .cov-week-nav a {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--adm-text);
  text-decoration: none;
  background: #fff;
}

.admin-shell .cov-week-nav a:hover {
  border-color: #93c5fd;
  color: var(--adm-accent-dark);
}

.admin-shell .cov-day-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 80px;
  padding-top: 8px;
}

.admin-shell .cov-day-bar {
  flex: 1;
  min-width: 28px;
  text-align: center;
}

.admin-shell .cov-day-bar .bar {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  margin: 0 auto 4px;
  max-width: 36px;
}

.admin-shell .cov-day-bar small {
  font-size: 10px;
  color: var(--adm-muted);
  display: block;
}

/* ===== SUPER ADMIN SHELL ===== */
.super-shell.admin-shell {
  --adm-accent: #8b5cf6;
  --adm-accent-dark: #7c3aed;
}

.super-shell .sidebar-brand .brand-mark {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.super-shell .sidebar-brand span {
  color: #c4b5fd;
}

.super-shell .sidebar {
  display: flex;
  flex-direction: column;
  width: 248px;
  background: #0b1020;
}

.super-shell .sidebar-brand {
  padding: 18px 16px 14px;
  align-items: flex-start;
}

.super-shell .super-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  line-height: 1.2;
}

.super-shell .super-brand-text strong {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
}

.super-shell .super-brand-text small {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #a78bfa;
}

.super-shell .sidebar-nav {
  padding: 10px 10px 8px;
}

.super-shell .super-nav-group {
  margin-bottom: 14px;
}

.super-shell .super-nav-label {
  padding: 4px 12px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
}

.super-shell .menu-link {
  padding: 9px 12px;
  border-radius: 10px;
  color: #cbd5e1;
  justify-content: flex-start;
}

.super-shell .menu-link.super-nav-subtle {
  color: #94a3b8;
  padding: 7px 12px 7px 14px;
  font-size: 13px;
}

.super-shell .menu-link:hover {
  background: rgba(139, 92, 246, 0.12);
  color: #f5f3ff;
}

.super-shell .menu-link.active {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  box-shadow: 0 8px 18px rgba(91, 33, 182, 0.35);
}

.super-shell .super-nav-svg {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}

.super-shell .super-nav-svg svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.super-shell .sidebar-footer {
  padding: 10px 10px 14px;
  border-top: 1px solid var(--adm-sidebar-border);
  margin-top: auto;
}

.super-shell .logout-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  border-radius: 10px;
}

.super-shell .super-nav-badge {
  background: #f59e0b;
  color: #1c1917;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: auto;
}

.super-shell .super-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.super-shell .super-kpi {
  background: var(--adm-surface);
  border-radius: var(--adm-radius);
  padding: 18px 20px;
  box-shadow: var(--adm-shadow);
  border: 1px solid #e2e8f0;
}

.super-shell .super-kpi-warn {
  border-color: #fcd34d;
  background: #fffbeb;
}

.super-shell .super-kpi-label {
  font-size: 13px;
  color: var(--adm-muted);
  font-weight: 600;
}

.super-shell .super-kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--adm-text);
  line-height: 1.2;
  margin-top: 4px;
}

.super-shell .super-kpi-value.super-kpi-sm {
  font-size: 1.15rem;
  font-weight: 700;
}

.super-shell .super-kpi-meta {
  font-size: 12px;
  color: var(--adm-muted);
  margin-top: 8px;
}

.super-shell .super-kpi-meta a {
  color: var(--adm-accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.super-shell .super-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.super-shell .super-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--adm-accent), var(--adm-accent-dark));
  color: #fff !important;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.super-shell .super-action-btn:hover {
  filter: brightness(1.05);
}

.super-shell .super-alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

.super-shell .super-alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.super-shell .super-alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.super-shell .super-alert-warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.super-shell .super-muted {
  color: var(--adm-muted);
  font-size: 14px;
}

.super-shell .super-muted.small {
  font-size: 12px;
}

.super-shell .super-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.super-shell .super-badge-ok {
  background: #dcfce7;
  color: #166534;
}

.super-shell .super-badge-off {
  background: #fee2e2;
  color: #991b1b;
}

.super-shell .super-badge-warn {
  background: #fef3c7;
  color: #92400e;
  margin-top: 4px;
}

.super-shell .super-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.super-shell .super-filter-bar input[type="text"] {
  flex: 1;
  min-width: 180px;
}

.super-shell .super-link-muted {
  color: var(--adm-muted);
  font-size: 14px;
  text-decoration: none;
}

.super-shell .super-link-muted:hover {
  color: var(--adm-accent-dark);
}

.super-shell .super-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.super-shell .super-inline-form {
  display: inline;
  margin: 0;
}

.super-shell .super-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--adm-accent-dark);
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.super-shell .super-link-btn.super-link-muted {
  color: var(--adm-muted);
}

.super-shell .super-form-wide {
  max-width: 960px;
}

.super-shell .super-form-grid {
  max-width: 520px;
  display: grid;
  gap: 4px;
}

.super-shell .super-form-grid label {
  margin-top: 12px;
}

.super-shell .super-section-title {
  margin: 28px 0 6px;
  font-size: 16px;
}

.super-shell .super-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.super-shell .super-product-card {
  border: 1px solid var(--adm-border, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px 16px;
  background: #fff;
}

.super-shell .super-product-card.is-on {
  border-color: #86efac;
  background: #f0fdf4;
}

.super-shell .super-product-card legend {
  font-weight: 800;
  padding: 0 6px;
}

.super-shell .super-product-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 8px;
}

.super-shell .super-product-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.super-shell .super-product-card label {
  margin-top: 10px;
  display: block;
  font-size: 13px;
}

.super-shell .super-product-card input[type="date"],
.super-shell .super-product-card select {
  width: 100%;
}

.super-shell .super-form-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 20px;
}

.super-shell .super-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.super-shell .super-page-head h2 {
  margin: 0;
}

.super-shell .super-info-table th {
  text-align: left;
  width: 200px;
  color: var(--adm-muted);
  font-weight: 600;
}

.super-shell .super-migration-run-all {
  margin-bottom: 8px;
}

.super-shell .table-wrap {
  overflow-x: auto;
}

/* ===== BILLING SALES (admin panel) ===== */
.admin-shell .billing-page h2 {
  margin: 0 0 8px;
}

.admin-shell .billing-muted {
  color: var(--adm-muted);
  font-size: 14px;
}

.admin-shell .billing-muted.small {
  font-size: 12px;
}

.admin-shell .billing-card {
  margin-top: 16px;
}

.admin-shell .billing-alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin: 12px 0;
  font-size: 14px;
}

.admin-shell .billing-alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.admin-shell .billing-alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.admin-shell .billing-alert-warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.admin-shell .billing-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.admin-shell .billing-kpi {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--adm-shadow);
}

.admin-shell .billing-kpi-warn {
  border-color: #fcd34d;
  background: #fffbeb;
}

.admin-shell .billing-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--adm-muted);
}

.admin-shell .billing-kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 4px;
}

.admin-shell .billing-kpi-value.billing-kpi-sm {
  font-size: 1.1rem;
}

.admin-shell .billing-kpi-meta {
  font-size: 12px;
  color: var(--adm-muted);
  margin-top: 6px;
}

.admin-shell .billing-upload-form label {
  margin-top: 8px;
}

.admin-shell .billing-upload-form input[type="file"] {
  margin: 8px 0 16px;
}

.admin-shell .billing-confirm-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.admin-shell .billing-btn-primary {
  background: linear-gradient(135deg, var(--adm-accent), var(--adm-accent-dark));
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.admin-shell .billing-btn-muted {
  background: #f1f5f9;
  color: var(--adm-text);
  border: 1px solid #e2e8f0;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
}

.admin-shell .billing-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.admin-shell .billing-badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.admin-shell .billing-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.admin-shell .billing-filter-bar label {
  font-size: 13px;
  margin: 0;
}

.admin-shell .billing-link-action {
  margin-left: auto;
  font-weight: 600;
  color: var(--adm-accent-dark);
  text-decoration: none;
}

.admin-shell .billing-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-shell .billing-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--adm-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.admin-shell .billing-tab.active {
  background: var(--adm-accent);
  border-color: var(--adm-accent);
  color: #fff;
}

.admin-shell .billing-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

