/* ============================================
   UNI Admin — Theme Glass (Red Dark Liquid)
   Override layer — include SAU admin.css
   Palette: Crimson Velvet #2C0F12 → #6B1E23
   ============================================ */

:root {
  /* Override core colors */
  --bg: #1a0708;
  --bg-card: rgba(43, 15, 18, 0.55);
  --bg-glass: rgba(107, 30, 35, 0.18);
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(214, 90, 100, 0.35);
  --text: #f5e6e6;
  --text-muted: rgba(245, 230, 230, 0.62);
  --primary: #b8323e;
  --primary-hover: #d6505d;
  --accent: #f59e7a;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #7dd3fc;
  --crimson-deep: #2C0F12;
  --crimson: #6B1E23;
  --crimson-light: #a83541;
  --radius: 14px;
  --radius-pill: 999px;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 50px rgba(40, 0, 5, 0.55);
  --shadow-glow: 0 0 30px rgba(184, 50, 62, 0.45);
}

/* ============ Background — Liquid Crimson Mesh ============ */
html, body {
  background:
    radial-gradient(circle at 18% 22%, rgba(168, 53, 65, 0.28) 0%, transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(107, 30, 35, 0.32) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(44, 15, 18, 0.4) 0%, transparent 60%),
    linear-gradient(135deg, #1a0708 0%, #2C0F12 40%, #1a0708 100%);
  background-attachment: fixed;
  color: var(--text) !important;
  min-height: 100vh;
}

/* Subtle film grain để cảm giác sang */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.85' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.2  0 0 0 0 0.2  0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
  mix-blend-mode: overlay;
}

/* ============ Sidebar — Dark glass với glow ============ */
.sidebar {
  background:
    linear-gradient(180deg, rgba(43, 15, 18, 0.92) 0%, rgba(26, 7, 8, 0.95) 100%) !important;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-right: 1px solid var(--border) !important;
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.4);
  z-index: 50;
}
.sidebar .logo {
  border-bottom-color: var(--border) !important;
}
.sidebar .logo h1 {
  background: linear-gradient(135deg, #f5e6e6 0%, #d6505d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sidebar .nav-item,
.sidebar a {
  color: rgba(245, 230, 230, 0.7) !important;
  border-radius: var(--radius-pill);
  margin: 4px 12px;
  padding: 10px 16px !important;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.sidebar a:hover,
.sidebar .nav-item:hover {
  background: rgba(184, 50, 62, 0.15) !important;
  color: #fff !important;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(214, 90, 100, 0.25);
}
.sidebar .nav-item.active,
.sidebar a.active {
  background:
    linear-gradient(135deg, rgba(184, 50, 62, 0.35), rgba(107, 30, 35, 0.45)) !important;
  color: #fff !important;
  box-shadow:
    inset 0 0 0 1px rgba(214, 90, 100, 0.4),
    0 4px 20px rgba(184, 50, 62, 0.3);
}

/* ============ Topbar — Glass blur ============ */
.topbar {
  background: rgba(43, 15, 18, 0.55) !important;
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border) !important;
  color: var(--text) !important;
  z-index: 40;
}
.topbar h2,
.topbar .topbar-title { color: var(--text) !important; }

/* ============ Main area ============ */
.main, .content {
  position: relative;
  z-index: 2;
}

/* ============ Cards — Glassmorphism ============ */
.card,
.modal,
.modal-content,
.panel,
.box,
.stat,
.stat-card,
.dash-card,
.metric-card {
  background: var(--bg-card) !important;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: var(--text) !important;
  position: relative;
}
.card::before,
.modal::before,
.modal-content::before,
.stat::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(214, 90, 100, 0.08), transparent 60%);
  pointer-events: none;
}

/* Dashboard stat numbers — đảm bảo visible trên dark glass */
.stat .num,
.stat-card .num,
.dash-card .num {
  color: #fff !important;
  text-shadow: 0 2px 12px rgba(184, 50, 62, 0.5);
}
.stat .label,
.stat-card .label {
  color: rgba(245, 230, 230, 0.55) !important;
  font-weight: 600;
}
.stat .delta { color: var(--success) !important; }

/* ============ Buttons — Pill with glow ============ */
.btn {
  border-radius: var(--radius-pill) !important;
  padding: 10px 22px !important;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  letter-spacing: 0.01em;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}
.btn-primary, button[type="submit"], .btn:not(.btn-outline):not(.btn-danger):not(.btn-sm):not(.btn-ghost) {
  background: linear-gradient(135deg, #b8323e, #6B1E23) !important;
  color: #fff !important;
  border-color: rgba(214, 90, 100, 0.4) !important;
  box-shadow:
    0 4px 14px rgba(184, 50, 62, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 22px rgba(184, 50, 62, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-outline, .btn-ghost {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text) !important;
  border: 1px solid var(--border-glow) !important;
  backdrop-filter: blur(10px);
}
.btn-outline:hover, .btn-ghost:hover {
  background: rgba(184, 50, 62, 0.15) !important;
  border-color: var(--primary-hover) !important;
}
.btn-danger {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d) !important;
  color: #fff !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
}
.btn-sm {
  padding: 6px 14px !important;
  font-size: 0.82rem !important;
}

/* ============ Forms — Glass inputs ============ */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="url"],
input[type="tel"], input[type="date"], select, textarea {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 10px !important;
  padding: 11px 16px !important;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}
input::placeholder, textarea::placeholder {
  color: rgba(245, 230, 230, 0.35) !important;
}
input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: var(--primary-hover) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 0 0 3px rgba(184, 50, 62, 0.2) !important;
}
label { color: var(--text) !important; font-weight: 500; }

/* Select dropdown options - native, can't fully style nhưng background ok */
select option { background: var(--crimson-deep); color: var(--text); }

/* ============ Tables ============ */
table {
  background: transparent !important;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
thead th {
  background: rgba(107, 30, 35, 0.25) !important;
  color: var(--text-muted) !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
  padding: 14px 16px !important;
  border-bottom: 1px solid var(--border) !important;
}
tbody td {
  padding: 14px 16px !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text) !important;
}
tbody tr:hover {
  background: rgba(184, 50, 62, 0.08) !important;
}
tbody tr:last-child td { border-bottom: none !important; }

/* ============ Badges ============ */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  backdrop-filter: blur(8px);
}
.badge-published, .badge-active, .badge-opening, .badge-selling {
  background: rgba(74, 222, 128, 0.18) !important;
  color: #86efac !important;
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.badge-draft, .badge-pending, .badge-upcoming {
  background: rgba(251, 191, 36, 0.18) !important;
  color: #fcd34d !important;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.badge-archived, .badge-soldout, .badge-inactive {
  background: rgba(148, 163, 184, 0.18) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* ============ Modal overlay ============ */
.modal-bg,
.modal-overlay,
[class*="modal-backdrop"] {
  background: rgba(10, 3, 4, 0.78) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* Modal box overrides — đè cả .modal (admin.css default) */
.modal,
.modal-content,
.modal-body,
.modal-dialog {
  background: linear-gradient(135deg, rgba(43, 15, 18, 0.92), rgba(26, 7, 8, 0.92)) !important;
  border: 1px solid var(--border-glow) !important;
  color: var(--text) !important;
}
.modal-foot,
.modal-header {
  border-color: var(--border) !important;
}
.modal h3, .modal h4, .modal label { color: var(--text) !important; }

/* ============ Headings ============ */
h1, h2, h3, h4, h5, h6 { color: var(--text); }
.topbar h2, .topbar strong { color: var(--text) !important; }

/* ============ Card heading inside dashboard ============ */
.card-head h3, .card-head h4 { color: var(--text) !important; margin: 0; }
.card-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

/* ============ Quill editor — glass adaptation ============ */
.ql-toolbar {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border) !important;
  border-bottom: none !important;
  border-radius: 10px 10px 0 0 !important;
}
.ql-toolbar .ql-stroke { stroke: var(--text-muted) !important; }
.ql-toolbar .ql-fill { fill: var(--text-muted) !important; }
.ql-toolbar button:hover .ql-stroke,
.ql-toolbar .ql-active .ql-stroke { stroke: var(--primary-hover) !important; }
.ql-container {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--border) !important;
  border-radius: 0 0 10px 10px !important;
  color: var(--text) !important;
  min-height: 200px;
}
.ql-editor.ql-blank::before { color: rgba(245, 230, 230, 0.3) !important; }

/* ============ Login page — center glass card ============ */
.login-wrap, .login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.login-card {
  background: linear-gradient(135deg, rgba(43, 15, 18, 0.85), rgba(26, 7, 8, 0.9)) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-glow) !important;
  border-radius: 20px !important;
  padding: 40px !important;
  max-width: 420px;
  width: 100%;
  box-shadow:
    var(--shadow-lg),
    0 0 60px rgba(184, 50, 62, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ============ Toast / Notification ============ */
.toast,
[class*="toast"] {
  background: rgba(43, 15, 18, 0.95) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glow) !important;
  color: var(--text) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg);
}
.toast-success { border-color: rgba(74, 222, 128, 0.4) !important; }
.toast-error { border-color: rgba(248, 113, 113, 0.4) !important; }

/* ============ Misc ============ */
.empty, .muted, small { color: var(--text-muted) !important; }
hr { border-color: var(--border) !important; }
code, pre { background: rgba(0, 0, 0, 0.35) !important; color: #fcd34d !important; border-radius: 6px; padding: 2px 6px; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(43, 15, 18, 0.3); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(184, 50, 62, 0.5), rgba(107, 30, 35, 0.5));
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(184, 50, 62, 0.7), rgba(107, 30, 35, 0.7)); }

/* ============ Animation helpers ============ */
@keyframes liquidPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(184, 50, 62, 0.3); }
  50% { box-shadow: 0 0 50px rgba(184, 50, 62, 0.5); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.btn-primary, .login-card {
  animation: liquidPulse 4s ease-in-out infinite;
}
