/* ============================================ */
/* ADMIN PANEL - MODERN DEMO DESIGN             */
/* ============================================ */

body { font-family: 'Inter', system-ui, sans-serif; background: #f1f5f9; color: #0f172a; }
.demo-bar { background: linear-gradient(135deg, #1e1b4b, #312e81); color: white; text-align: center; padding: 8px 16px; font-size: 0.78rem; font-weight: 500; position: sticky; top: 0; z-index: 100; }

.admin-layout { display: flex; min-height: calc(100vh - 36px); }

/* SIDEBAR */
.sidebar { position: fixed; top: 36px; left: 0; bottom: 0; width: 220px; background: #0f172a; z-index: 50; display: flex; flex-direction: column; transform: translateX(-100%); transition: transform 0.3s ease; }
.sidebar.open { transform: translateX(0); }
@media (min-width: 769px) { .sidebar { transform: translateX(0); } }

.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; font-weight: 700; font-size: 0.95rem; color: white; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-head svg { color: var(--color-primary); }

.sidebar-nav { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: none; border: none; color: rgba(255,255,255,0.5); font-size: 0.83rem; font-weight: 500; cursor: pointer; transition: all 0.2s; width: 100%; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.8); }
.nav-item.active { background: linear-gradient(135deg, var(--color-primary), #1d4ed8); color: white; box-shadow: 0 4px 12px rgba(37,99,235,0.25); }

.sidebar-foot { padding: 8px; border-top: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; gap: 2px; }

/* MAIN */
.main-content { flex: 1; margin-left: 0; min-height: calc(100vh - 36px); }
@media (min-width: 769px) { .main-content { margin-left: 220px; } }

/* TOPBAR */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: white; border-bottom: 1px solid #e2e8f0; position: sticky; top: 36px; z-index: 40; }
.menu-btn { display: block; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: #64748b; padding: 4px; }
@media (min-width: 769px) { .menu-btn { display: none !important; } }
.topbar h1 { font-size: 1.1rem; font-weight: 600; margin: 0; color: #0f172a; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-badge { padding: 3px 10px; border-radius: 100px; background: #fef3c7; color: #92400e; font-size: 0.72rem; font-weight: 600; }
.topbar-user { font-size: 0.85rem; color: #64748b; font-weight: 500; }

/* VIEWS */
.view { display: none; padding: 24px; animation: fadeIn 0.3s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* STATS */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: white; border-radius: 12px; padding: 18px; display: flex; align-items: center; gap: 14px; border: 1px solid #e2e8f0; }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat div { display: flex; flex-direction: column; }
.stat strong { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.stat span { font-size: 0.78rem; color: #94a3b8; }

/* CARDS */
.card { background: white; border-radius: 12px; border: 1px solid #e2e8f0; overflow: hidden; margin-bottom: 20px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid #e2e8f0; }
.card-head h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.card-body { padding: 20px; }

/* TABLE */
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 12px 16px; text-align: left; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.table td { padding: 12px 16px; font-size: 0.85rem; color: #334155; border-bottom: 1px solid #f1f5f9; }
.table tr:hover td { background: #f8fafc; }
.table tr:last-child td { border: none; }
.loading { text-align: center; padding: 40px 16px !important; color: #94a3b8; font-size: 0.85rem; }
.product-td { display: flex; flex-direction: column; gap: 2px; }
.product-td strong { font-weight: 600; color: #0f172a; }
.product-td small { font-size: 0.75rem; color: #94a3b8; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 0.7rem; font-weight: 500; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-feat { background: #fef3c7; color: #92400e; }

.hide-mobile { display: table-cell; }
@media (max-width: 640px) { .hide-mobile { display: none; } }

/* SETTINGS */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.setting-group h3 { font-size: 0.9rem; font-weight: 600; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid #e2e8f0; color: #0f172a; }
.setting { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 0.85rem; }
.setting label { color: #64748b; font-weight: 500; }
.setting span { color: #0f172a; font-weight: 500; }

/* LOGIN PAGE */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a, #1e1b4b); padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: white; border-radius: 20px; padding: 40px 32px; box-shadow: 0 25px 60px rgba(0,0,0,0.3); text-align: center; animation: fadeIn 0.5s ease; }
.login-logo { width: 56px; height: 56px; margin: 0 auto 20px; background: var(--color-primary); border-radius: 14px; display: flex; align-items: center; justify-content: center; color: white; }
.login-card h1 { font-size: 1.3rem; font-weight: 700; margin: 0 0 4px; }
.login-sub { color: #94a3b8; font-size: 0.85rem; margin: 0 0 28px; }
.login-field { margin-bottom: 16px; text-align: left; }
.login-field label { display: block; font-size: 0.8rem; font-weight: 500; color: #475569; margin-bottom: 6px; }
.login-field input { width: 100%; padding: 11px 14px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 0.9rem; background: #f8fafc; transition: all 0.2s; box-sizing: border-box; font-family: inherit; }
.login-field input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); background: white; }
.login-btn { width: 100%; padding: 12px; border: none; border-radius: 10px; background: var(--color-primary); color: white; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: inherit; }
.login-btn:hover { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.login-error { background: #fef2f2; color: #dc2626; padding: 10px 14px; border-radius: 8px; font-size: 0.82rem; margin-bottom: 14px; text-align: center; }
.login-error.hidden { display: none; }
.login-hint { margin-top: 20px; font-size: 0.78rem; color: #94a3b8; }

/* DARK MODE */
@media (prefers-color-scheme: dark) {
  body { background: #0f172a; color: #f1f5f9; }
  .topbar { background: #1e293b; border-color: #334155; }
  .topbar h1 { color: #f1f5f9; }
  .menu-btn { color: #94a3b8; }
  .topbar-user { color: #94a3b8; }
  .stat, .card { background: #1e293b; border-color: #334155; }
  .card-head { border-color: #334155; }
  .card-head h2 { color: #f1f5f9; }
  .table th { background: #0f172a; color: #64748b; border-color: #334155; }
  .table td { color: #cbd5e1; border-color: #1e293b; }
  .table tr:hover td { background: #0f172a; }
  .product-td strong { color: #f1f5f9; }
  .setting { border-color: #334155; }
  .setting label { color: #94a3b8; }
  .setting span { color: #f1f5f9; }
  .setting-group h3 { border-color: #334155; color: #f1f5f9; }
  .login-card { background: #1e293b; }
  .login-card h1 { color: #f1f5f9; }
  .login-sub { color: #64748b; }
  .login-field label { color: #94a3b8; }
  .login-field input { background: #0f172a; border-color: #334155; color: #f1f5f9; }
  .login-field input:focus { background: #1e293b; }
  .login-hint { color: #64748b; }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .view { padding: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat { padding: 14px; }
  .stat strong { font-size: 1.2rem; }
  .settings-grid { grid-template-columns: 1fr; }
}