/*
 * Fashion Bazar Premium Frontend Admin Panel Stylesheet
 * Dark Left Sidebar (#0F172A) + Clean SaaS Canvas (#F8FAFC) + Emerald (#064E3B) + Gold (#D6AE59)
 */
:root {
  --fba-sidebar-bg: #0F172A;
  --fba-sidebar-text: #CBD5E1;
  --fba-canvas: #F8FAFC;
  --fba-card: #FFFFFF;
  --fba-border: #E2E8F0;
  --fba-emerald: #064E3B;
  --fba-deep: #063B2E;
  --fba-gold: #D6AE59;
  --fba-cream: #FFF9EF;
  --fba-ink: #0F172A;
  --fba-muted: #64748B;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: 'Hind Siliguri', system-ui, -apple-system, sans-serif; background: var(--fba-canvas); color: var(--fba-ink); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
.tabular-nums { font-variant-numeric: tabular-nums; }

/* Isolated Admin Sign-In Gate */
.fba-login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #0F172A 0%, #063B2E 100%); }
.fba-login-card { width: 100%; max-width: 440px; background: #FFFFFF; border-radius: 14px; padding: 34px 30px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28); }
.fba-login-brand { font-size: 22px; font-weight: 700; color: var(--fba-emerald); margin: 0 0 4px; }
.fba-login-sub { font-size: 13px; color: var(--fba-muted); margin: 0 0 20px; }

/* App Shell */
.fba-shell { display: grid; grid-template-columns: 272px 1fr; min-height: 100vh; }
.fba-sidebar { background: var(--fba-sidebar-bg); color: var(--fba-sidebar-text); display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40; }
.fba-brand-box { padding: 4px 8px 14px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fba-brand-title { font-size: 17px; font-weight: 700; color: #FFFFFF; }
.fba-brand-sub { font-size: 11px; color: var(--fba-gold); font-weight: 600; }
.fba-sidebar-close { display: none; background: transparent; border: 1px solid rgba(255,255,255,0.2); color: #FFFFFF; border-radius: 6px; width: 32px; height: 32px; cursor: pointer; }

.fba-nav-filter { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: #FFFFFF; font-size: 13px; margin-bottom: 12px; outline: none; }
.fba-nav-filter::placeholder { color: #94A3B8; }
.fba-nav-group { margin-bottom: 14px; }
.fba-nav-group-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #64748B; padding: 4px 10px 6px; }
.fba-nav-link { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--fba-sidebar-text); transition: background-color 0.15s ease, color 0.15s ease; margin-bottom: 2px; }
.fba-nav-link:hover { background: rgba(255,255,255,0.08); color: #FFFFFF; }
.fba-nav-link.is-active { background: var(--fba-emerald); color: #FFFFFF; font-weight: 600; box-shadow: inset 3px 0 0 var(--fba-gold); }
.fba-nav-num { font-size: 11px; font-weight: 700; color: var(--fba-gold); min-width: 20px; }

.fba-sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.1); display: grid; gap: 8px; }
.fba-side-btn { display: block; text-align: center; padding: 8px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; border: 1px solid rgba(255,255,255,0.15); color: #FFFFFF; }
.fba-side-btn:hover { background: rgba(255,255,255,0.08); }
.fba-side-btn-danger { border-color: rgba(248,113,113,0.4); color: #FCA5A5; }

/* Main Workspace */
.fba-main { display: flex; flex-direction: column; min-width: 0; }
.fba-topbar { background: #FFFFFF; border-bottom: 1px solid var(--fba-border); padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 14px; position: sticky; top: 0; z-index: 30; }
.fba-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fba-mobile-toggle { display: none; background: #FFFFFF; border: 1px solid var(--fba-border); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 16px; }
.fba-topbar-title { font-size: 16px; font-weight: 700; color: var(--fba-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fba-topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fba-user-chip { font-size: 12px; color: var(--fba-muted); font-weight: 600; }

.fba-content { padding: 24px; max-width: 1320px; width: 100%; margin: 0 auto; }

/* Alerts & Cards */
.fba-alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; font-weight: 500; }
.fba-alert-ok { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.fba-alert-err { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

.fba-card { background: var(--fba-card); border: 1px solid var(--fba-border); border-radius: 12px; padding: 22px; margin-bottom: 20px; }
.fba-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid #F1F5F9; }
.fba-card-head h2 { margin: 0; font-size: 17px; color: var(--fba-deep); }
.fba-card-desc { margin: 2px 0 0; font-size: 13px; color: var(--fba-muted); }

/* KPI Grid */
.fba-kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px; }
.fba-kpi { padding: 16px; border-radius: 10px; border: 1px solid rgba(15,23,42,0.06); }
.fba-kpi-emerald { background: #ECFDF5; }
.fba-kpi-cream { background: #FFF9EF; }
.fba-kpi-blue { background: #EFF6FF; }
.fba-kpi-amber { background: #FFFBEB; }
.fba-kpi-red { background: #FEF2F2; }
.fba-kpi-val { font-size: 22px; font-weight: 700; color: var(--fba-ink); }
.fba-kpi-lbl { font-size: 12px; color: #475569; margin-top: 4px; }

/* Real 30-day Bar Chart */
.fba-chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding: 16px 8px 6px; border-bottom: 1px solid var(--fba-border); }
.fba-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.fba-chart-bar { width: 100%; max-width: 18px; background: var(--fba-emerald); border-radius: 4px 4px 0 0; min-height: 2px; transition: opacity 0.15s; }
.fba-chart-bar:hover { opacity: 0.8; background: var(--fba-gold); }
.fba-chart-day { font-size: 10px; color: var(--fba-muted); }

/* Forms & Grids */
.fba-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.fba-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fba-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.fba-field { margin-bottom: 14px; }
.fba-field label { display: block; font-size: 13px; font-weight: 600; color: #1E293B; margin-bottom: 5px; }
.fba-field small { display: block; font-size: 11px; color: var(--fba-muted); margin-top: 3px; }
.fba-field input[type="text"],
.fba-field input[type="email"],
.fba-field input[type="password"],
.fba-field input[type="number"],
.fba-field input[type="url"],
.fba-field input[type="tel"],
.fba-field input[type="datetime-local"],
.fba-field input[type="date"],
.fba-field select,
.fba-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 14px;
  background: #FFFFFF;
  color: var(--fba-ink);
  font-family: inherit;
}
.fba-field input:focus, .fba-field select:focus, .fba-field textarea:focus {
  outline: none;
  border-color: var(--fba-emerald);
  box-shadow: 0 0 0 3px rgba(6, 78, 59, 0.12);
}

.fba-color-row { display: flex; align-items: center; gap: 8px; }
.fba-color-row input[type="color"] { width: 44px; height: 38px; padding: 2px; border: 1px solid #CBD5E1; border-radius: 8px; background: #FFFFFF; cursor: pointer; shrink: 0; }
.fba-color-row input[type="text"] { font-family: monospace; }

.fba-toggle { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--fba-border); border-radius: 8px; background: #FAFBFD; font-size: 13px; font-weight: 600; cursor: pointer; margin-bottom: 10px; }
.fba-toggle input { width: 17px; height: 17px; accent-color: var(--fba-emerald); }

.fba-img-preview { margin-top: 6px; display: flex; align-items: center; gap: 10px; }
.fba-img-preview img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--fba-border); }

/* Buttons */
.fba-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 1px solid transparent; cursor: pointer; font-family: inherit; transition: background-color 0.15s; white-space: nowrap; }
.fba-btn-primary { background: var(--fba-emerald); color: #FFFFFF; }
.fba-btn-primary:hover { background: var(--fba-deep); }
.fba-btn-gold { background: var(--fba-gold); color: var(--fba-deep); }
.fba-btn-outline { background: #FFFFFF; border-color: #CBD5E1; color: var(--fba-ink); }
.fba-btn-outline:hover { background: #F1F5F9; }
.fba-btn-danger { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
.fba-btn-danger:hover { background: #FEE2E2; }
.fba-btn-sm { padding: 6px 11px; font-size: 12px; }

/* Tables */
.fba-table-wrap { overflow-x: auto; }
.fba-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fba-table th { text-align: left; padding: 10px 12px; background: #F8FAFC; border-bottom: 1px solid var(--fba-border); color: #475569; font-weight: 600; white-space: nowrap; }
.fba-table td { padding: 10px 12px; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
.fba-table tr:hover td { background: #FAFBFD; }
.fba-thumb { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; border: 1px solid var(--fba-border); }
.fba-pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.fba-pill-ok { background: #ECFDF5; color: #065F46; }
.fba-pill-warn { background: #FFFBEB; color: #92400E; }
.fba-pill-bad { background: #FEF2F2; color: #991B1B; }
.fba-pill-muted { background: #F1F5F9; color: #475569; }

.fba-sticky-save { position: sticky; bottom: 14px; background: rgba(255,255,255,0.96); backdrop-filter: blur(8px); border: 1px solid var(--fba-border); padding: 12px 18px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 8px 24px rgba(15,23,42,0.08); margin-top: 12px; z-index: 20; }

/* Responsive */
html, body { overflow-x: clip; }
.fba-card, .fba-kpi, .fba-table-wrap { min-width: 0; }
.fba-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 1080px) {
  .fba-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .fba-grid-3, .fba-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .fba-shell { grid-template-columns: 1fr; }
  .fba-sidebar { position: fixed; left: -290px; top: 0; bottom: 0; width: 272px; transition: left 0.2s ease; }
  .fba-sidebar.is-open { left: 0; box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35); }
  .fba-sidebar-close, .fba-mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .fba-grid-2, .fba-grid-3, .fba-grid-4 { grid-template-columns: 1fr; }
  .fba-topbar { padding: 10px 14px; flex-wrap: wrap; }
  .fba-content { padding: 14px; }
}
@media (max-width: 600px) {
  .fba-card { padding: 14px; margin-bottom: 14px; }
  .fba-kpi-val { font-size: 18px; }
  .fba-sticky-save { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 14px; }
  .fba-sticky-save .fba-btn { width: 100%; }
  .fba-chart-bars { overflow-x: auto; gap: 3px; }
  .fba-user-chip { display: none; }
}
