/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #060611; --bg-card: #0e0e1a; --bg-sidebar: #090915;
  --border: rgba(255,255,255,0.07);
  --text: #f1f5f9; --text-muted: #64748b; --text-sub: #94a3b8;
  --accent: #6366f1; --accent-2: #8b5cf6;
  --success: #10b981; --danger: #ef4444; --warning: #f59e0b;
  --radius: 14px;
}
body { background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; font-size: 14px; }

/* ─── Login Page ─────────────────────────────────────────────── */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.login-bg { position: fixed; inset: 0; z-index: 0; }
.login-orb { position: absolute; border-radius: 50%; filter: blur(100px); pointer-events: none; }
.lo-1 { width: 500px; height: 500px; background: rgba(99,102,241,0.2); top: -150px; left: -150px; }
.lo-2 { width: 400px; height: 400px; background: rgba(139,92,246,0.15); bottom: -100px; right: -100px; }
.login-card {
  position: relative; z-index: 1; width: 420px;
  background: rgba(14,14,26,0.8); backdrop-filter: blur(24px);
  border: 1px solid var(--border); border-radius: 24px; padding: 40px;
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.login-brand { font-size: 20px; font-weight: 800; }
.login-sub { font-size: 12px; color: var(--text-muted); }
.logo-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 22px; color: #fff;
  box-shadow: 0 0 24px rgba(99,102,241,0.4);
}
.login-form .form-group { margin-bottom: 20px; }
.btn-login {
  width: 100%; padding: 14px; border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  font-weight: 700; font-size: 15px; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(99,102,241,0.4); transition: all 0.2s; margin-top: 8px;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(99,102,241,0.5); }

/* ─── Admin Layout ───────────────────────────────────────────── */
.admin-body { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 240px; min-height: 100vh; background: var(--bg-sidebar);
  border-right: 1px solid var(--border); padding: 24px 16px;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; padding: 8px 0 28px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.sidebar-brand { font-size: 15px; font-weight: 800; }
.sidebar-role { font-size: 11px; color: var(--text-muted); }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; padding-top: 16px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: 10px; text-decoration: none; color: var(--text-sub);
  font-size: 14px; font-weight: 500; transition: all 0.2s;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active { background: rgba(99,102,241,0.12); color: var(--accent); }
.nav-item i { width: 18px; text-align: center; }

/* Sidebar Footer */
.sidebar-footer { padding-top: 16px; border-top: 1px solid var(--border); }
.admin-user { display: flex; align-items: center; gap: 12px; }
.admin-avatar {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #fff;
}
.admin-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.logout-btn {
  background: none; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer;
  padding: 0; display: flex; align-items: center; gap: 4px; transition: color 0.2s;
}
.logout-btn:hover { color: var(--danger); }

/* Main */
.admin-main { margin-left: 240px; flex: 1; padding: 32px; min-height: 100vh; }

/* ─── Flash ──────────────────────────────────────────────────── */
.flash {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-radius: 12px; margin-bottom: 24px; font-size: 14px; font-weight: 500;
  animation: fadeIn 0.3s ease;
}
.flash-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); color: #34d399; }
.flash-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #f87171; }
@keyframes fadeIn { from{opacity:0;transform:translateY(-8px);} to{opacity:1;transform:translateY(0);} }

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; font-size: 14px; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #f87171; }

/* ─── Page Header ────────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; gap: 16px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); text-decoration: none; font-size: 13px; margin-bottom: 6px; transition: color 0.2s; }
.back-link:hover { color: var(--text); }
.page-title { font-size: 24px; font-weight: 800; }
.page-sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; text-decoration: none; transition: all 0.2s;
}
.btn-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; box-shadow: 0 4px 16px rgba(99,102,241,0.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(99,102,241,0.45); }
.btn-ghost { background: rgba(255,255,255,0.04); color: var(--text-sub); border-color: var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.btn-danger { background: rgba(239,68,68,0.1); color: #f87171; border-color: rgba(239,68,68,0.25); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ─── Products Table ─────────────────────────────────────────── */
.products-table-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.products-table { width: 100%; border-collapse: collapse; }
.products-table thead tr { background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border); }
.products-table th { padding: 14px 20px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }
.products-table td { padding: 16px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.products-table tbody tr:last-child td { border-bottom: none; }
.products-table tbody tr { transition: background 0.15s; }
.products-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.product-cell { display: flex; align-items: center; gap: 12px; }
.product-icon-sm { font-size: 28px; line-height: 1; }
.product-cell-name { font-weight: 700; font-size: 14px; }
.product-cell-tag { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.status-active { background: rgba(16,185,129,0.1); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.status-inactive { background: rgba(100,116,139,0.1); color: #64748b; border: 1px solid rgba(100,116,139,0.25); }
.status-coming_soon { background: rgba(251,191,36,0.1); color: #fbbf24; border: 1px solid rgba(251,191,36,0.25); }

.table-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 7px; transition: background 0.2s; }
.table-link:hover { background: rgba(99,102,241,0.1); }
.admin-link { color: #8b5cf6; }
.admin-link:hover { background: rgba(139,92,246,0.1); }
.sort-badge { background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 6px; padding: 2px 10px; font-size: 13px; font-weight: 600; }
.action-btns { display: flex; align-items: center; gap: 8px; }
.text-muted { color: var(--text-muted); }

/* ─── Empty Card ─────────────────────────────────────────────── */
.empty-card {
  background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 64px 32px; text-align: center;
}
.empty-icon { font-size: 48px; color: var(--text-muted); margin-bottom: 16px; }
.empty-card h3 { font-size: 18px; margin-bottom: 8px; color: var(--text-sub); }
.empty-card p { font-size: 14px; color: var(--text-muted); }

/* ─── Product Form Card ──────────────────────────────────────── */
.form-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; max-width: 860px;
}
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-sub); margin-bottom: 8px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; pointer-events: none; z-index: 1; }
.form-input {
  width: 100%; padding: 11px 14px 11px 40px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-family: inherit; transition: all 0.2s;
  outline: none;
}
.form-input:not(.has-icon) { padding-left: 14px; }
textarea.form-input { padding-left: 14px; resize: vertical; }
.form-input:focus { border-color: rgba(99,102,241,0.5); background: rgba(99,102,241,0.04); }
.form-input::placeholder { color: var(--text-muted); }
.form-select { padding-left: 14px; cursor: pointer; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }

/* Color picker wrap */
.color-wrap { display: flex; align-items: center; gap: 8px; }
.color-picker { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; padding: 4px; background: none; flex-shrink: 0; }
.color-text { flex: 1; padding-left: 14px; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; min-height: auto; }
  .admin-body { flex-direction: column; }
  .admin-main { margin-left: 0; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) { .form-grid-3 { grid-template-columns: 1fr; } }
