/* ── Reset & Base ─────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { font-size:14px; }
body { font-family:'Segoe UI',system-ui,-apple-system,sans-serif; background:#f0f2f5; color:#1a1a2e; min-height:100vh; }
a { text-decoration:none; color:inherit; }
button { cursor:pointer; border:none; background:none; font-family:inherit; }
input, select, textarea { font-family:inherit; font-size:1rem; }

/* ── Buttons ─────────────────────────────────── */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:10px 20px; border-radius:8px; font-weight:600; font-size:.875rem; transition:all .2s; }
.btn-primary { background:#1A3C8F; color:#fff; }
.btn-primary:hover { background:#15327a; }
.btn-success { background:#059669; color:#fff; }
.btn-success:hover { background:#047857; }
.btn-danger { background:#dc2626; color:#fff; }
.btn-danger:hover { background:#b91c1c; }
.btn-warning { background:#d97706; color:#fff; }
.btn-warning:hover { background:#b45309; }
.btn-outline { border:1.5px solid #ddd; color:#555; background:#fff; }
.btn-outline:hover { border-color:#1A3C8F; color:#1A3C8F; }
.btn-sm { padding:6px 12px; font-size:.8rem; }
.btn-block { width:100%; }
.btn-icon { width:36px; height:36px; padding:0; border-radius:8px; }

/* ── Login Screen ────────────────────────────── */
#login-screen { display:flex; align-items:center; justify-content:center; min-height:100vh; background:linear-gradient(135deg,#1A3C8F 0%,#0f2460 100%); padding:20px; }
.login-box { background:#fff; padding:40px; border-radius:16px; width:100%; max-width:400px; box-shadow:0 20px 60px rgba(0,0,0,.3); }
.login-logo { text-align:center; margin-bottom:32px; }
.logo-icon { width:64px; height:64px; background:#1A3C8F; color:#fff; border-radius:16px; font-size:32px; font-weight:800; display:inline-flex; align-items:center; justify-content:center; margin-bottom:12px; }
.login-logo h1 { font-size:1.5rem; color:#1a1a2e; }
.login-logo p { color:#888; font-size:.875rem; margin-top:4px; }
.form-group { margin-bottom:16px; }
.form-group label { display:block; margin-bottom:6px; font-weight:600; font-size:.875rem; color:#444; }
.form-group input, .form-group select, .form-group textarea { width:100%; padding:10px 14px; border:1.5px solid #ddd; border-radius:8px; font-size:.95rem; transition:border .2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline:none; border-color:#1A3C8F; box-shadow:0 0 0 3px rgba(26,60,143,.1); }
.form-group textarea { min-height:80px; resize:vertical; }

/* ── App Shell ───────────────────────────────── */
#app-shell { display:flex; min-height:100vh; }

/* ── Sidebar ─────────────────────────────────── */
#sidebar { width:260px; background:#0f1b3d; color:#fff; display:flex; flex-direction:column; position:fixed; top:0; left:0; bottom:0; z-index:100; transition:transform .3s; }
.sidebar-header { display:flex; align-items:center; gap:10px; padding:20px; border-bottom:1px solid rgba(255,255,255,.08); }
.logo-icon-sm { width:36px; height:36px; background:#1A3C8F; color:#fff; border-radius:10px; font-size:18px; font-weight:800; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.sidebar-title { font-size:1.1rem; font-weight:700; }
.sidebar-close { display:none; color:#fff; font-size:24px; margin-left:auto; }
.sidebar-nav { flex:1; padding:12px 0; overflow-y:auto; }
.nav-item { display:flex; align-items:center; gap:12px; padding:11px 20px; color:rgba(255,255,255,.65); font-size:.9rem; font-weight:500; transition:all .2s; border-left:3px solid transparent; }
.nav-item:hover { background:rgba(255,255,255,.06); color:#fff; }
.nav-item.active { background:rgba(26,60,143,.5); color:#fff; border-left-color:#5b8cff; }
.nav-item svg { width:20px; height:20px; flex-shrink:0; }
.sidebar-footer { padding:16px 20px; border-top:1px solid rgba(255,255,255,.08); }

/* ── Main Content ────────────────────────────── */
#main-content { flex:1; margin-left:260px; display:flex; flex-direction:column; min-height:100vh; }
.topbar { display:flex; align-items:center; gap:16px; padding:16px 28px; background:#fff; border-bottom:1px solid #e5e7eb; position:sticky; top:0; z-index:50; }
.hamburger { display:none; width:40px; height:40px; border-radius:8px; align-items:center; justify-content:center; }
.hamburger svg { width:24px; height:24px; }
.topbar h2 { font-size:1.25rem; font-weight:700; color:#1a1a2e; }
.topbar-right { margin-left:auto; }
.admin-badge { background:#eef2ff; color:#1A3C8F; padding:6px 14px; border-radius:20px; font-size:.8rem; font-weight:600; }
#page-content { flex:1; padding:28px; }

/* ── Stats Grid ──────────────────────────────── */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; margin-bottom:28px; }
.stat-card { background:#fff; border-radius:12px; padding:20px; box-shadow:0 1px 3px rgba(0,0,0,.06); display:flex; align-items:center; gap:16px; }
.stat-icon { width:48px; height:48px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:22px; flex-shrink:0; }
.stat-icon.blue { background:#eef2ff; color:#1A3C8F; }
.stat-icon.green { background:#ecfdf5; color:#059669; }
.stat-icon.orange { background:#fff7ed; color:#d97706; }
.stat-icon.red { background:#fef2f2; color:#dc2626; }
.stat-icon.purple { background:#f5f3ff; color:#7c3aed; }
.stat-icon.indigo { background:#eef2ff; color:#4f46e5; }
.stat-value { font-size:1.5rem; font-weight:700; color:#1a1a2e; }
.stat-label { font-size:.8rem; color:#888; margin-top:2px; }

/* ── Card / Section ──────────────────────────── */
.card { background:#fff; border-radius:12px; box-shadow:0 1px 3px rgba(0,0,0,.06); margin-bottom:20px; }
.card-header { display:flex; align-items:center; justify-content:space-between; padding:18px 24px; border-bottom:1px solid #f0f0f0; }
.card-header h3 { font-size:1.05rem; font-weight:700; }
.card-body { padding:20px 24px; }
.card-body-np { padding:0; }

/* ── Tables ──────────────────────────────────── */
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
th { text-align:left; padding:12px 16px; font-size:.8rem; font-weight:600; color:#666; text-transform:uppercase; letter-spacing:.5px; background:#fafafa; border-bottom:1px solid #eee; white-space:nowrap; }
td { padding:12px 16px; border-bottom:1px solid #f5f5f5; font-size:.9rem; vertical-align:middle; }
tr:hover td { background:#fafbff; }

/* ── Badges ──────────────────────────────────── */
.badge { display:inline-block; padding:4px 10px; border-radius:20px; font-size:.75rem; font-weight:600; }
.badge-green { background:#ecfdf5; color:#059669; }
.badge-red { background:#fef2f2; color:#dc2626; }
.badge-blue { background:#eef2ff; color:#1A3C8F; }
.badge-orange { background:#fff7ed; color:#d97706; }
.badge-purple { background:#f5f3ff; color:#7c3aed; }
.badge-gray { background:#f3f4f6; color:#6b7280; }
.badge-gold { background:#fef9e7; color:#b8860b; }

/* ── Store Detail ────────────────────────────── */
.store-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.detail-section { background:#f9fafb; padding:14px; border-radius:10px; }
.detail-section h4 { font-size:.85rem; color:#1A3C8F; margin-bottom:10px; text-transform:uppercase; letter-spacing:.5px; }
.detail-row { display:flex; justify-content:space-between; align-items:center; padding:5px 0; font-size:.85rem; border-bottom:1px solid #f0f0f0; }
.detail-row span:first-child { color:#888; }
.stat-card-gold { border-left:3px solid #b8860b; }

/* ── Filter Bar ──────────────────────────────── */
.filter-bar { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:16px; align-items:center; }
.filter-bar input, .filter-bar select { padding:8px 14px; border:1.5px solid #ddd; border-radius:8px; font-size:.875rem; }
.filter-bar input { min-width:240px; }

/* ── Plan Cards ──────────────────────────────── */
.plans-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:20px; }
.plan-card { background:#fff; border:2px solid #eee; border-radius:14px; padding:24px; transition:.2s; }
.plan-card:hover { border-color:#1A3C8F; box-shadow:0 4px 12px rgba(26,60,143,.1); }
.plan-name { font-size:1.15rem; font-weight:700; }
.plan-price { font-size:1.8rem; font-weight:800; color:#1A3C8F; margin:8px 0; }
.plan-price span { font-size:.9rem; font-weight:400; color:#888; }
.plan-meta { font-size:.85rem; color:#666; margin-bottom:12px; }
.plan-features { list-style:none; margin:12px 0; }
.plan-features li { padding:4px 0; font-size:.875rem; color:#555; }
.plan-features li::before { content:'✓ '; color:#059669; font-weight:700; }

/* ── Modal ───────────────────────────────────── */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); display:flex; align-items:center; justify-content:center; z-index:200; padding:20px; }
.modal-box { background:#fff; border-radius:16px; width:100%; max-width:560px; max-height:90vh; overflow-y:auto; box-shadow:0 20px 60px rgba(0,0,0,.2); }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:18px 24px; border-bottom:1px solid #eee; }
.modal-header h3 { font-size:1.1rem; font-weight:700; }
.modal-close { font-size:24px; color:#888; width:36px; height:36px; display:flex; align-items:center; justify-content:center; border-radius:8px; }
.modal-close:hover { background:#f5f5f5; }
.modal-body { padding:24px; }
.modal-body .form-group { margin-bottom:16px; }
.modal-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:20px; }

/* ── Toast ───────────────────────────────────── */
.toast { position:fixed; bottom:24px; right:24px; padding:14px 24px; background:#1a1a2e; color:#fff; border-radius:10px; font-size:.9rem; z-index:300; opacity:0; transform:translateY(20px); transition:all .3s; pointer-events:none; max-width:400px; }
.toast.show { opacity:1; transform:translateY(0); pointer-events:auto; }
.toast.toast-error { background:#dc2626; }
.toast.toast-success { background:#059669; }

/* ── Charts / Mini chart area ────────────────── */
.chart-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:28px; }
.chart-card { background:#fff; border-radius:12px; box-shadow:0 1px 3px rgba(0,0,0,.06); padding:20px; }
.chart-card h4 { font-size:.95rem; font-weight:700; margin-bottom:12px; }
.bar-chart { display:flex; align-items:flex-end; gap:8px; height:120px; padding-top:8px; }
.bar-col { flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; }
.bar { background:linear-gradient(to top,#1A3C8F,#5b8cff); border-radius:4px 4px 0 0; width:100%; min-height:4px; transition:height .5s; }
.bar-label { font-size:.7rem; color:#888; white-space:nowrap; }

/* ── Recent Users Table ──────────────────────── */
.recent-section { }

/* ── Notification / Banner specific ──────────── */
.notif-type-badge { display:inline-block; padding:3px 8px; border-radius:6px; font-size:.75rem; font-weight:600; text-transform:uppercase; }
.banner-preview { width:100%; max-width:280px; border-radius:8px; padding:14px; margin:8px 0; }

/* ── Toggle Switch ───────────────────────────── */
.toggle { position:relative; display:inline-block; width:42px; height:24px; }
.toggle input { opacity:0; width:0; height:0; }
.toggle-slider { position:absolute; cursor:pointer; inset:0; background:#ccc; border-radius:24px; transition:.3s; }
.toggle-slider::before { content:''; position:absolute; height:18px; width:18px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.3s; }
.toggle input:checked + .toggle-slider { background:#059669; }
.toggle input:checked + .toggle-slider::before { transform:translateX(18px); }

/* ── Color preview ───────────────────────────── */
.color-swatch { width:28px; height:28px; border-radius:6px; border:2px solid #eee; display:inline-block; vertical-align:middle; }

/* ── Config Section ──────────────────────────── */
.config-section { margin-bottom:24px; }
.config-section h4 { font-size:1rem; font-weight:700; margin-bottom:12px; padding-bottom:8px; border-bottom:1px solid #eee; }
.config-row { display:flex; align-items:center; gap:16px; margin-bottom:12px; }
.config-row label { min-width:180px; font-weight:600; font-size:.875rem; color:#444; }
.config-row input, .config-row select { flex:1; padding:8px 12px; border:1.5px solid #ddd; border-radius:8px; }

/* ── Loader ──────────────────────────────────── */
.loader { display:flex; align-items:center; justify-content:center; padding:60px; }
.spinner { width:36px; height:36px; border:3px solid #eee; border-top-color:#1A3C8F; border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── Empty State ─────────────────────────────── */
.empty-state { text-align:center; padding:60px 20px; color:#888; }
.empty-state svg { width:48px; height:48px; margin-bottom:12px; opacity:.5; }
.empty-state p { font-size:.95rem; }

/* ── Responsive ──────────────────────────────── */
@media (max-width:1024px) {
  .chart-grid { grid-template-columns:1fr; }
}

@media (max-width:768px) {
  #sidebar { transform:translateX(-100%); }
  #sidebar.open { transform:translateX(0); }
  .sidebar-close { display:block; }
  #main-content { margin-left:0; }
  .hamburger { display:flex; }
  .topbar { padding:12px 16px; }
  #page-content { padding:16px; }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
  .filter-bar input { min-width:160px; }
  .config-row { flex-direction:column; align-items:flex-start; gap:4px; }
  .config-row label { min-width:unset; }
}

@media (max-width:480px) {
  .stats-grid { grid-template-columns:1fr; }
  .plans-grid { grid-template-columns:1fr; }
  .chart-grid { grid-template-columns:1fr; }
  .modal-box { max-width:100%; }
}
