/* ============================================================
   FullContab - Design Premium v4.0
   Inter + Dark Sidebar + Glass Effects + Motion
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-light: #6366F1;
  --primary-glow: rgba(79,70,229,.18);
  --green: #059669;
  --green-light: #D1FAE5;
  --red: #DC2626;
  --red-light: #FEE2E2;
  --yellow: #D97706;
  --yellow-light: #FEF3C7;
  --blue: #0EA5E9;
  --blue-light: #E0F2FE;
  --cyan: #0891B2;
  --cyan-light: #CFFAFE;
  --sidebar-bg: #0F172A;
  --sidebar-hover: rgba(255,255,255,0.06);
  --sidebar-active: rgba(79,70,229,0.2);
  --sidebar-text: #94A3B8;
  --sidebar-text-active: #FFFFFF;
  --topbar-h: 64px;
  --sidebar-w: 260px;
  --body-bg: #F1F5F9;
  --card-bg: #FFFFFF;
  --border: #E2E8F0;
  --text: #1E293B;
  --text-muted: #64748B;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --trans: all 0.2s cubic-bezier(.4,0,.2,1);
  --trans-fast: all 0.15s cubic-bezier(.4,0,.2,1);
  --trans-slow: all 0.35s cubic-bezier(.4,0,.2,1);
}

/* Dark Mode */
[data-theme="dark"] {
  --body-bg: #0F172A;
  --card-bg: #1E293B;
  --border: #334155;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --shadow: 0 1px 3px rgba(0,0,0,.2), 0 1px 2px rgba(0,0,0,.15);
  --shadow-md: 0 4px 16px rgba(0,0,0,.3);
  --sidebar-bg: #020617;
}
[data-theme="dark"] .table tbody tr:hover { background: #1E293B; }
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea { background: #0F172A; border-color: #334155; color: #F1F5F9; }
[data-theme="dark"] .modal-content { background: #1E293B; }
[data-theme="dark"] .topbar { background: #1E293B; }
[data-theme="dark"] .stat-card { background: #1E293B; }
[data-theme="dark"] .badge-default { background: #334155; color: #94A3B8; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Global Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569; }

/* Selection */
::selection { background: var(--primary); color: #fff; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--body-bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==============================
   ANIMATIONS
   ============================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes subtlePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}
.animate-in { animation: fadeInUp .4s cubic-bezier(.4,0,.2,1) both; }
.animate-in-1 { animation-delay: .05s; }
.animate-in-2 { animation-delay: .1s; }
.animate-in-3 { animation-delay: .15s; }
.animate-in-4 { animation-delay: .2s; }
.animate-in-5 { animation-delay: .25s; }

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; width: 60%; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 40%; margin-bottom: 12px; }
.skeleton-card { height: 120px; border-radius: var(--radius); }

/* LAYOUT */
.container { display: flex; min-height: 100vh; }
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ==============================
   SIDEBAR — Premium Glass Effect
   ============================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  background-image: linear-gradient(180deg, rgba(79,70,229,.06) 0%, transparent 40%);
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 200; display: flex; flex-direction: column; overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }

.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-decoration: none;
}
.sidebar-logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff; flex-shrink: 0; letter-spacing: -.5px;
  box-shadow: 0 4px 12px rgba(79,70,229,.35);
  transition: var(--trans);
}
.sidebar-logo:hover .sidebar-logo-icon { transform: scale(1.05); box-shadow: 0 6px 16px rgba(79,70,229,.45); }
.sidebar-logo-text { color: #fff; font-size: 18px; font-weight: 700; line-height: 1.1; }
.sidebar-logo-text span { display: block; font-size: 11px; color: var(--sidebar-text); font-weight: 400; margin-top: 2px; letter-spacing: .3px; }

.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: rgba(148,163,184,.5);
  padding: 16px 12px 6px; margin-top: 4px;
}

.sidebar-nav { flex: 1; padding: 8px 12px; }
.sidebar-nav ul { list-style: none; }
.sidebar-nav ul li { margin-bottom: 2px; }
.sidebar-nav ul li a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); text-decoration: none;
  font-size: 13.5px; font-weight: 500; transition: var(--trans);
  position: relative;
}
.sidebar-nav ul li a:hover { background: var(--sidebar-hover); color: #E2E8F0; }
.sidebar-nav ul li a.active {
  background: var(--sidebar-active); color: var(--sidebar-text-active);
  box-shadow: inset 3px 0 0 var(--primary), 0 0 20px rgba(79,70,229,.08);
  font-weight: 600;
}
.sidebar-nav ul li a .nav-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; line-height: 1.3; min-width: 20px; text-align: center;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }

.sidebar-user {
  padding: 16px; border-top: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.15);
}
.sidebar-user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.sidebar-user-info { flex: 1; min-width: 0; overflow: hidden; }
.sidebar-user-name { color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: var(--sidebar-text); font-size: 11px; }
.sidebar-user-logout {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  color: var(--sidebar-text); border-radius: var(--radius-sm); transition: var(--trans);
  text-decoration: none;
}
.sidebar-user-logout:hover { background: rgba(220,38,38,.15); color: var(--red); }
.sidebar-user-info a { color: var(--sidebar-text); font-size: 11px; text-decoration: none; transition: var(--trans); }
.sidebar-user-info a:hover { color: var(--red); }

/* ==============================
   TOPBAR — Glassmorphism
   ============================== */
.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 100;
}
[data-theme="dark"] .topbar { background: rgba(30,41,59,.85); }
.topbar-left { display: flex; flex-direction: column; }
.topbar-title { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.2; }
.topbar-breadcrumb { display: flex; gap: 6px; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.topbar-breadcrumb span:not(:last-child)::after { content: '›'; margin-left: 6px; color: #CBD5E1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.topbar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 8px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--trans); white-space: nowrap;
  text-decoration: none; box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.topbar-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.35); }

/* Theme Toggle */
.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--card-bg);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--text-muted); transition: var(--trans);
}
.theme-toggle:hover { background: var(--body-bg); color: var(--text); }

/* PAGE BODY */
.page-body { padding: 28px 32px; flex: 1; animation: fadeIn .3s ease; }

/* ==============================
   CARDS — Elevated Design
   ============================== */
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 20px;
  transition: var(--trans);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(241,245,249,.5) 0%, transparent 100%);
}
[data-theme="dark"] .card-header { background: linear-gradient(180deg, rgba(15,23,42,.3) 0%, transparent 100%); }
.card-header h2 {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px; margin: 0;
}
.card-header h3 {
  font-size: 14px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px; margin: 0;
}
.card-header-icon {
  font-size: 16px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #EEF2FF; border-radius: 8px; color: var(--primary);
  flex-shrink: 0;
}
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--body-bg); }

/* ==============================
   STATS GRID — Premium Cards
   ============================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: flex-start; gap: 14px;
  position: relative; overflow: hidden; box-shadow: var(--shadow);
  transition: var(--trans);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card.blue::before  { background: linear-gradient(90deg, var(--blue), #38BDF8); }
.stat-card.green::before { background: linear-gradient(90deg, var(--green), #34D399); }
.stat-card.red::before   { background: linear-gradient(90deg, var(--red), #F87171); }
.stat-card.yellow::before{ background: linear-gradient(90deg, var(--yellow), #FBBF24); }
.stat-card.cyan::before  { background: linear-gradient(90deg, var(--cyan), #22D3EE); }

/* Icon wrap inside stat card */
.stat-icon-wrap {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0; transition: var(--trans);
}
.stat-card.blue .stat-icon-wrap   { background: var(--blue-light); color: var(--blue); }
.stat-card.green .stat-icon-wrap  { background: var(--green-light); color: var(--green); }
.stat-card.red .stat-icon-wrap    { background: var(--red-light); color: var(--red); }
.stat-card.yellow .stat-icon-wrap { background: var(--yellow-light); color: var(--yellow); }
.stat-card.cyan .stat-icon-wrap   { background: var(--cyan-light); color: var(--cyan); }
.stat-card:hover .stat-icon-wrap  { transform: scale(1.08); }

.stat-content { flex: 1; min-width: 0; }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; margin-top: 2px; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Legacy stat-card class names fallback */
.stat-card-icon { font-size: 28px; margin-bottom: 4px; }
.stat-card-label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-card-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-card.blue .stat-card-value   { color: var(--blue); }
.stat-card.green .stat-card-value  { color: var(--green); }
.stat-card.red .stat-card-value    { color: var(--red); }
.stat-card.yellow .stat-card-value { color: var(--yellow); }
.stat-card.cyan .stat-card-value   { color: var(--cyan); }
.stat-card-sub { font-size: 11px; color: var(--text-muted); }

/* ==============================
   TABLES — Refined
   ============================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead tr { background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%); }
[data-theme="dark"] .table thead tr { background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%); }
.table th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; transition: background .15s; }
.table tbody tr { transition: var(--trans-fast); }
.table tbody tr:hover { background: rgba(79,70,229,.03); }
[data-theme="dark"] .table tbody tr:hover { background: rgba(79,70,229,.08); }
.table tbody tr:last-child td { border-bottom: none; }
.td-bold { font-weight: 600; color: var(--text); }
.td-bold small { display: block; font-weight: 400; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.table-actions { display: flex; gap: 6px; align-items: center; }
.empty-row td { text-align: center; padding: 48px 20px !important; color: var(--text-muted); font-size: 14px; }
.empty-row td i { display: block; font-size: 32px; margin-bottom: 8px; opacity: .4; }

/* ==============================
   BUTTONS — Polished
   ============================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: none; transition: var(--trans); white-space: nowrap; text-decoration: none;
  position: relative; overflow: hidden;
}
.btn:active { transform: scale(.97); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-primary   { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(79,70,229,.25); }
.btn-primary:hover  { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.35); }
.btn-success   { background: var(--green); color: #fff; box-shadow: 0 2px 6px rgba(5,150,105,.25); }
.btn-success:hover  { background: #047857; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5,150,105,.35); }
.btn-danger    { background: var(--red); color: #fff; box-shadow: 0 2px 6px rgba(220,38,38,.25); }
.btn-danger:hover   { background: #B91C1C; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(220,38,38,.35); }
.btn-warning   { background: var(--yellow); color: #fff; box-shadow: 0 2px 6px rgba(217,119,6,.25); }
.btn-warning:hover  { background: #B45309; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(217,119,6,.35); }
.btn-secondary { background: var(--card-bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover{ background: var(--body-bg); border-color: #CBD5E1; }
.btn-ghost     { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover    { background: var(--body-bg); color: var(--text); border-color: #CBD5E1; }

.btn-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; font-size: 14px; transition: var(--trans); background: transparent;
}
.btn-icon:active { transform: scale(.9); }
.btn-icon.edit   { background: #EFF6FF; border-color: #BFDBFE; color: #2563EB; }
.btn-icon.edit:hover  { background: #2563EB; color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.3); }
.btn-icon.delete { background: var(--red-light); border-color: #FECACA; color: var(--red); }
.btn-icon.delete:hover{ background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,.3); }
.btn-icon.view   { background: #F0FDF4; border-color: #BBF7D0; color: var(--green); }
.btn-icon.view:hover  { background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(5,150,105,.3); }

/* ==============================
   BADGES — Refined
   ============================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  letter-spacing: .2px;
}
.badge-default { background: #F1F5F9; color: var(--text-muted); border: 1px solid var(--border); }
.badge-primary { background: #EEF2FF; color: var(--primary); border: 1px solid rgba(79,70,229,.15); }
.badge-success { background: var(--green-light); color: var(--green); border: 1px solid rgba(5,150,105,.15); }
.badge-danger  { background: var(--red-light); color: var(--red); border: 1px solid rgba(220,38,38,.15); }
.badge-warning { background: var(--yellow-light); color: var(--yellow); border: 1px solid rgba(217,119,6,.15); }
.badge-info    { background: var(--blue-light); color: var(--blue); border: 1px solid rgba(14,165,233,.15); }
.badge i { font-size: 10px; }

/* ==============================
   FORMS — Accessible & Polished
   ============================== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 4px; }
.req { color: var(--red); margin-left: 2px; }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; color: var(--text);
  background: var(--card-bg); outline: none; transition: var(--trans);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: #CBD5E1; }
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover { border-color: #CBD5E1; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: 2px solid transparent; outline-offset: 2px;
}
.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled { background: var(--body-bg); opacity: .6; cursor: not-allowed; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.form-error { font-size: 11px; color: var(--red); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.form-section-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 12px 0 8px; border-bottom: 1px solid var(--border);
  margin-bottom: 14px; margin-top: 8px;
  display: flex; align-items: center; gap: 8px;
}

/* ==============================
   MODALS — Refined with Glass Backdrop
   ============================== */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal.active { display: flex; animation: fadeIn .2s ease; }
.modal-content {
  background: var(--card-bg); border-radius: var(--radius-lg);
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.1);
  animation: modalIn .25s cubic-bezier(.4,0,.2,1);
}
.modal-lg { max-width: 700px; }
@keyframes modalIn { from { opacity:0; transform: scale(.95) translateY(-10px); } to { opacity:1; transform: none; } }

.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
}
.modal-title-wrap { display: flex; align-items: center; gap: 12px; }
.modal-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: #EEF2FF; display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.2; }
.modal-header h2 small { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.modal-close {
  width: 32px; height: 32px; border: none; background: var(--body-bg);
  border-radius: 8px; cursor: pointer; font-size: 18px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; transition: var(--trans); flex-shrink: 0;
}
.modal-close:hover { background: var(--red-light); color: var(--red); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-top: 1px solid var(--border);
  background: var(--body-bg); border-radius: 0 0 var(--radius) var(--radius);
}
.ml-auto { margin-left: auto; display: flex; gap: 8px; }

/* ==============================
   TABS — Smooth
   ============================== */
.tabs-wrap {
  display: flex; gap: 4px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); overflow-x: auto; flex-wrap: wrap;
}
.tab-btn {
  padding: 7px 16px; border: 1px solid transparent; border-radius: 20px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--text-muted); transition: var(--trans); white-space: nowrap;
}
.tab-btn:hover { background: var(--body-bg); color: var(--text); }
.tab-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.tab-pane { display: none; padding: 20px; animation: fadeIn .3s ease; }
.tab-pane.active { display: block; }

/* ==============================
   ALERTS — Enhanced
   ============================== */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 16px; border: 1px solid transparent;
  animation: fadeInUp .3s ease;
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-info    { background: var(--blue-light); color: #0369A1; border-color: #BAE6FD; }
.alert-success { background: var(--green-light); color: #065F46; border-color: #A7F3D0; }
.alert-error   { background: var(--red-light); color: #991B1B; border-color: #FECACA; }
.alert-warning { background: var(--yellow-light); color: #92400E; border-color: #FDE68A; }

/* ==============================
   REPORT CARDS — Hover Effects
   ============================== */
.report-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: var(--trans); display: flex; flex-direction: column;
  cursor: pointer;
}
.report-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(79,70,229,.2); }
.report-card-icon {
  height: 80px; display: flex; align-items: center; justify-content: center; font-size: 36px;
  transition: var(--trans);
}
.report-card:hover .report-card-icon { transform: scale(1.1); }
.report-card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.report-card-body h3 { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; }
.report-card-body p { font-size: 13px; color: var(--text-muted); margin: 0; flex: 1; line-height: 1.5; }

/* ==============================
   LOGIN PAGE — Premium Glass
   ============================== */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #4F46E5 60%, #0EA5E9 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  position: relative; overflow: hidden;
}
.login-bg::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-bg::after {
  content: ''; position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(99,102,241,.15) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(14,165,233,.15) 0%, transparent 50%);
  animation: subtlePulse 8s ease-in-out infinite;
}
.login-card {
  background: rgba(255,255,255,.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 20px; padding: 40px 36px;
  width: 100%; max-width: 420px;
  box-shadow: 0 30px 80px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.2) inset;
  position: relative; z-index: 1;
  animation: fadeInUp .5s cubic-bezier(.4,0,.2,1);
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.login-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  box-shadow: 0 8px 20px rgba(79,70,229,.4);
}
.login-logo-name { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1; }
.login-logo-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ==============================
   PARTIDAS LANCAMENTOS
   ============================== */
.partida-item {
  display: grid; grid-template-columns: 2fr 1fr 1fr 2fr auto;
  gap: 8px; align-items: end;
  background: var(--body-bg); padding: 12px;
  border-radius: var(--radius-sm); margin-bottom: 8px; border: 1px solid var(--border);
}
@media (max-width: 700px) { .partida-item { grid-template-columns: 1fr 1fr; } }
.totalizador {
  display: grid; grid-template-columns: 2fr 1fr 1fr 2fr auto; gap: 8px;
  background: var(--primary); color: #fff;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 13px; margin-top: 8px;
}
.partidas-container { margin-bottom: 8px; }

/* ==============================
   LOG ENTRIES
   ============================== */
.log-entry {
  padding: 10px 12px; border-left: 3px solid var(--border); margin-bottom: 8px;
  font-size: 13px; background: var(--body-bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.log-entry strong { color: var(--text); display: block; }
.log-entry small { color: var(--text-muted); }

/* ==============================
   DASHBOARD — Premium
   ============================== */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #818CF8 100%);
  color: #fff; border-radius: var(--radius); padding: 24px 28px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 20px rgba(79,70,229,.3);
  position: relative; overflow: hidden;
}
.welcome-banner::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/svg%3E");
}
.welcome-banner h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; position: relative; }
.welcome-banner p  { font-size: 13px; opacity: .85; position: relative; }
.welcome-banner .btn { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(8px); }
.welcome-banner .btn:hover { background: rgba(255,255,255,.3); }
.dashboard-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: 1fr; } }

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .3s cubic-bezier(.4,0,.2,1); }
  .sidebar.open { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.3); }
  .main-content { margin-left: 0; }
  .page-body { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .partida-item, .totalizador { grid-template-columns: 1fr 1fr; }
  .modal-content { margin: 12px; border-radius: var(--radius); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-row, .form-row.cols-2 { grid-template-columns: 1fr; }
  .topbar-date { display: none; }
  .login-card { padding: 28px 20px; }
}

/* ==============================
   FOCUS / ACCESSIBILITY
   ============================== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible, .tab-btn:focus-visible, .btn-icon:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--primary-glow);
}
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ==============================
   TOOLTIPS
   ============================== */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: #1E293B; color: #fff; font-size: 11px; font-weight: 500;
  padding: 5px 10px; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 500;
}
[data-tooltip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==============================
   PROGRESS BAR
   ============================== */
.progress { height: 6px; background: var(--body-bg); border-radius: 10px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 10px; transition: width .6s cubic-bezier(.4,0,.2,1);
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}
.progress-bar.green { background: linear-gradient(90deg, var(--green) 0%, #34D399 100%); }
.progress-bar.red   { background: linear-gradient(90deg, var(--red) 0%, #F87171 100%); }
.progress-bar.yellow{ background: linear-gradient(90deg, var(--yellow) 0%, #FBBF24 100%); }

/* ==============================
   EMPTY STATE
   ============================== */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px; opacity: .3; margin-bottom: 16px;
}
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state-text { font-size: 14px; margin-bottom: 20px; }

/* ==============================
   DIVIDER
   ============================== */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 12px; font-weight: 500;
  margin: 20px 0;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ==============================
   AVATAR GROUP
   ============================== */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.avatar-green { background: linear-gradient(135deg, var(--green), #34D399); }
.avatar-blue { background: linear-gradient(135deg, var(--blue), #38BDF8); }

/* ==============================
   STATUS DOT
   ============================== */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.status-dot.offline { background: #CBD5E1; }
.status-dot.warning { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-light); }
.status-dot.danger { background: var(--red); box-shadow: 0 0 0 3px var(--red-light); }

/* ==============================
   UTILITY CLASSES
   ============================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--green); }
.text-danger { color: var(--red); }
.text-warning { color: var(--yellow); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-sm { font-size: 12px; }
.fs-lg { font-size: 16px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ==============================
   PRINT STYLES
   ============================== */
@media print {
  .sidebar, .topbar, .topbar-btn, .btn, .table-actions,
  .sidebar-user, .modal, .theme-toggle { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-body { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .stat-card { box-shadow: none !important; }
  body { background: #fff !important; color: #000 !important; font-size: 12pt; }
  .table th, .table td { padding: 6px 8px !important; }
  a { color: inherit !important; text-decoration: none !important; }
}

/* ── Impersonation Banner ── */
.impersonate-banner {
  background: linear-gradient(135deg, #7C3AED, #6D28D9);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 2px solid rgba(255,255,255,.2);
}
.impersonate-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.impersonate-info i { font-size: 16px; opacity: .9; }
.impersonate-info strong { font-weight: 700; }
.impersonate-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(255,255,255,.2);
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
  text-align: center;
  justify-content: center;
}
.impersonate-back:hover { background: rgba(255,255,255,.35); }

/* ── Modo Demo Banner ── */
.demo-banner {
  background: linear-gradient(135deg, #065f46, #047857);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 2px solid rgba(255,255,255,.2);
}
.demo-banner-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.demo-banner-info i { font-size: 15px; opacity: .9; }
.demo-banner-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.demo-banner-signup {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: #fff;
  color: #065f46;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s;
}
.demo-banner-signup:hover { background: #d1fae5; }
.demo-banner-exit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(255,255,255,.18);
  color: #fff;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.demo-banner-exit:hover { background: rgba(255,255,255,.32); }
