
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
  --bg: #0a0a0a; --bg2: #111111; --bg3: #1a1a1a; --bg4: #222222; --border: #2a2a2a; --border2: #333333;
  --text: #f0f0f0; --text2: #a0a0a0; --muted: #888888; --accent: #e60000; --accent2: #ff3333; --success: #22c55e; --warning: #f59e0b; --info: #3b82f6;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, -apple-system, sans-serif; margin: 0; -webkit-font-smoothing: antialiased; }

/* ===== SIDEBAR ===== */
.sidebar { width: 260px; background: var(--bg2); border-right: 1px solid var(--border); height: 100vh; max-height: 100vh; position: fixed; top: 0; left: 0; padding: 20px 14px; display: flex; flex-direction: column; z-index: 100; transition: transform 0.3s; overflow: hidden; box-sizing: border-box; }
.sidebar-header { display:flex; align-items:center; gap:10px; margin-bottom:24px; padding: 0 6px; }
.sidebar-header img { height:36px; }
.sidebar-header span { font-weight:700; font-size:15px; letter-spacing:-0.3px; }
.sidebar-section-title { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; color:var(--muted); padding:16px 10px 6px; }
.sidebar a { display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:10px; text-decoration:none; font-size:13.5px; font-weight:500; color:var(--text2); transition: all 0.15s; margin: 2px 0; position:relative; }
.sidebar a:hover { background: var(--bg3); color: var(--text); }
.sidebar a.active { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(230,0,0,0.25); }
.sidebar a .badge { position:absolute; right:8px; top:50%; transform:translateY(-50%); background:var(--accent); color:#fff; font-size:10px; font-weight:700; padding:1px 6px; border-radius:10px; min-width:18px; text-align:center; }
.sidebar-footer { border-top:1px solid var(--border); margin-top:auto; padding-top:12px; }
.sidebar-toggle { display:none; position:fixed; top:14px; left:14px; z-index:200; width:40px; height:40px; background:var(--bg2); border:1px solid var(--border); border-radius:10px; color:var(--text); align-items:center; justify-content:center; cursor:pointer; font-size:16px; }

/* ===== MAIN ===== */
.main { margin-left: 260px; padding: 28px 32px; min-height: 100vh; transition: margin-left 0.3s; flex: 1 1 auto; min-width: 0; width: 100%; box-sizing: border-box; }
.main .main { margin-left: 0; padding: 0; }
.page-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:28px; }
.page-header h1 { font-size:22px; font-weight:700; margin:0; letter-spacing:-0.3px; }
.page-header .breadcrumb { font-size:13px; color:var(--muted); margin-top:4px; }
.page-header .actions { display:flex; gap:10px; }

/* ===== CARDS ===== */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 20px; transition: border-color 0.2s; }
.card:hover { border-color: var(--border2); }
.card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.card-title { font-size:15px; font-weight:700; margin:0; display:flex; align-items:center; gap:8px; }
.card-subtitle { font-size:12.5px; color:var(--muted); margin-top:4px; }
.admin-section-title { font-size:13px; font-weight:700; color:var(--text2); text-transform:uppercase; letter-spacing:0.08em; margin:32px 0 16px 0; padding-bottom:8px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:8px; }
.admin-section-title:first-of-type { margin-top:0; }

/* ===== STAT CARDS ===== */
.stat-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:28px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 20px; display:flex; flex-direction:column; }
.stat-card .stat-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.stat-card .stat-icon { width:42px; height:42px; border-radius:11px; display:flex; align-items:center; justify-content:center; font-size:18px; }
.stat-card .stat-label { font-size:12.5px; color:var(--muted); font-weight:500; margin-bottom:6px; }
.stat-card .stat-value { font-size:26px; font-weight:700; letter-spacing:-0.5px; }
.stat-card .stat-change { font-size:12px; margin-top:6px; font-weight:500; }

/* ===== BUTTONS ===== */
.btn-primary { background: var(--accent); color: #fff; border: none; padding: 10px 18px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size:13.5px; display:inline-flex; align-items:center; gap:6px; transition: all 0.15s; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(230,0,0,0.25); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); padding: 10px 18px; border-radius: 10px; cursor: pointer; font-weight: 500; font-size:13.5px; display:inline-flex; align-items:center; gap:6px; transition: all 0.15s; }
.btn-secondary:hover { background: var(--bg4); border-color: var(--border2); }
.btn-ghost { background:transparent; color:var(--muted); border:none; padding:8px 12px; border-radius:8px; cursor:pointer; font-size:13px; transition:0.15s; }
.btn-ghost:hover { background:var(--bg3); color:var(--text); }
.btn-danger { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 500; display:inline-flex; align-items:center; gap:4px; transition:0.15s; }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-success { background: rgba(16,185,129,0.1); color: #10b981; border: 1px solid rgba(16,185,129,0.2); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 500; display:inline-flex; align-items:center; gap:4px; transition:0.15s; }
.btn-success:hover { background: rgba(16,185,129,0.2); }
.status-badge { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:20px; font-size:11.5px; font-weight:600; white-space:nowrap; }
.btn-sm { padding:6px 12px; font-size:12.5px; border-radius:8px; }
.form-ctrl { width:100%; background:var(--bg3); border:1px solid var(--border); border-radius:8px; color:var(--text); outline:none; transition:border-color 0.15s; }
.form-ctrl:focus { border-color:var(--accent); }
.mr-1 { margin-right:4px; }

/* ===== TABLES ===== */
.table-wrap { overflow-x:auto; border-radius:12px; border:1px solid var(--border); }
table { width: 100%; font-size: 13.5px; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; color: var(--muted); font-weight: 600; font-size:12px; text-transform:uppercase; letter-spacing:0.3px; background:var(--bg3); border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); color:var(--text2); }
tr:hover td { background: rgba(255,255,255,0.02); }
tr:last-child td { border-bottom:none; }
.product-row { display:flex; align-items:center; gap:12px; }
.product-row img { width:44px; height:44px; object-fit:cover; border-radius:10px; background:var(--bg3); }

/* ===== FORMS ===== */
input, textarea, select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg3); color: var(--text); font-size: 14px; box-sizing: border-box; font-family:inherit; transition: border-color 0.15s, box-shadow 0.15s; }
input:focus, textarea:focus, select:focus { outline:none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(230,0,0,0.08); }
label { display:block; font-size:12.5px; font-weight:600; color:var(--text2); margin-bottom:6px; }
.form-row { display:grid; gap:12px; margin-bottom:12px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ===== MODALS ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity:0; pointer-events:none; transition: opacity 0.2s; }
.modal-bg.show { opacity:1; pointer-events:auto; }
.modal-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 28px; width: 92%; max-width: 640px; max-height: 90vh; overflow: auto; transform: translateY(20px) scale(0.97); transition: transform 0.2s; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.modal-bg.show .modal-box { transform: translateY(0) scale(1); }
.modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.modal-title { font-size:17px; font-weight:700; margin:0; }
.modal-close { background:none; border:none; color:var(--muted); cursor:pointer; font-size:18px; padding:4px; border-radius:6px; transition:0.15s; }
.modal-close:hover { background:var(--bg3); color:var(--text); }
.modal-body { margin-bottom:20px; overflow-y:auto; max-height:60vh; }
.modal-footer { display:flex; justify-content:flex-end; gap:8px; padding-top:16px; border-top:1px solid var(--border); }

/* ===== STATUS ===== */
.status-pill { padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; display:inline-flex; align-items:center; gap:5px; }
.status-pill::before { content:''; width:6px; height:6px; border-radius:50%; display:inline-block; }

/* ===== TOASTS ===== */
.toast-container { position:fixed; top:20px; right:20px; z-index:10000; display:flex; flex-direction:column; gap:10px; }
.toast { background:var(--bg2); border:1px solid var(--border); border-radius:12px; padding:14px 18px; display:flex; align-items:center; gap:12px; box-shadow:0 10px 40px rgba(0,0,0,0.4); transform: translateX(120%); transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); max-width:360px; font-size:13.5px; }
.toast.show { transform: translateX(0); }
.toast-icon { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0; }
.toast-success .toast-icon { background:rgba(34,197,94,0.15); color:var(--success); }
.toast-error .toast-icon { background:rgba(239,68,68,0.15); color:#ef4444; }
.toast-warning .toast-icon { background:rgba(245,158,11,0.15); color:var(--warning); }
.toast-info .toast-icon { background:rgba(59,130,246,0.15); color:var(--info); }
.toast-title { font-weight:600; margin-bottom:2px; }
.toast-msg { color:var(--muted); font-size:12.5px; }

/* ===== SEARCH & FILTERS ===== */
.search-bar { position:relative; max-width:320px; }
.search-bar input { padding-left:38px; background:var(--bg3); border-color:var(--border); }
.search-bar i { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--muted); font-size:13px; }
.filter-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.filter-chip { padding:6px 14px; border-radius:20px; border:1px solid var(--border); background:var(--bg3); color:var(--text2); font-size:12.5px; cursor:pointer; transition:0.15s; font-weight:500; }
.filter-chip:hover, .filter-chip.active { background:var(--accent); color:#fff; border-color:var(--accent); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align:center; padding:48px 24px; }
.empty-state .icon { width:64px; height:64px; border-radius:16px; background:var(--bg3); display:flex; align-items:center; justify-content:center; margin:0 auto 16px; font-size:24px; color:var(--muted); }
.empty-state .title { font-size:15px; font-weight:600; margin-bottom:6px; }
.empty-state .sub { font-size:13px; color:var(--muted); }

/* ===== SKELETON ===== */
.skeleton { background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%); background-size: 200% 100%; animation: skeleton 1.5s infinite; border-radius: 6px; }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== CARD GRID (for content managers) ===== */
.card-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:16px; }
.content-card { background:var(--bg2); border:1px solid var(--border); border-radius:14px; overflow:hidden; transition: all 0.2s; }
.content-card:hover { border-color:var(--border2); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.content-card .card-img { width:100%; height:150px; object-fit:cover; background:var(--bg3); }
.content-card .card-body { padding:16px; }
.content-card .card-title { font-size:14px; font-weight:600; margin-bottom:6px; line-height:1.4; }
.content-card .card-meta { font-size:12px; color:var(--muted); margin-bottom:12px; }
.content-card .card-actions { display:flex; gap:8px; padding:0 16px 16px; }

/* ===== ORDER DETAIL ===== */
.order-detail-grid { display:grid; grid-template-columns: 1fr 1fr; gap:16px; margin-bottom:20px; }
.order-detail-item { background:var(--bg3); border-radius:10px; padding:14px; }
.order-detail-label { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:0.5px; font-weight:600; margin-bottom:4px; }
.order-detail-value { font-size:14px; font-weight:500; }

/* ===== PAGINATION ===== */
.pagination { display:flex; align-items:center; gap:6px; justify-content:center; margin-top:20px; }
.pagination button { min-width:36px; height:36px; border-radius:8px; border:1px solid var(--border); background:var(--bg3); color:var(--text2); cursor:pointer; font-size:13px; font-weight:500; transition:0.15s; display:flex; align-items:center; justify-content:center; }
.pagination button:hover { background:var(--bg4); }
.pagination button.active { background:var(--accent); color:#fff; border-color:var(--accent); }

/* ===== ICON PICKER ===== */
.icon-picker-wrap { display:flex; align-items:center; gap:10px; }
.icon-picker-wrap select { flex:1; }
.icon-picker-preview { width:38px; height:38px; border-radius:10px; background:var(--bg4); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:16px; color:var(--accent); flex-shrink:0; }
.icon-picker-wrap option { font-family: inherit; }
.pagination button:disabled { opacity:0.4; cursor:not-allowed; }

/* ===== PAGE SYSTEM ===== */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 20px; }
  .sidebar-toggle { display: flex; }
  .stat-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction:column; align-items:flex-start; gap:12px; }
  .filter-bar { width:100%; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}
