@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
  --navy-950: #060d18;
  --navy-900: #0a1628;
  --navy-800: #0f223a;
  --navy-700: #1a3354;
  --navy-600: #234870;
  --navy-500: #2d5a8a;
  --gold-600: #9a7b1a;
  --gold-500: #c9a227;
  --gold-400: #ddb94a;
  --gold-300: #ecd98a;
  --surface: #eef1f7;
  --surface-2: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #eef2f7;
  --primary: var(--navy-800);
  --primary-2: var(--navy-600);
  --gold: var(--gold-500);
  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #0284c7;
  --info-bg: #eff6ff;
  --sidebar-w: 280px;
  --topbar-h: 72px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-xs: 0 1px 2px rgba(15, 34, 58, 0.04);
  --shadow-sm: 0 4px 14px rgba(15, 34, 58, 0.06);
  --shadow-md: 0 12px 32px rgba(15, 34, 58, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 34, 58, 0.12);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: var(--navy-600);
  transition: color var(--transition);
}

a:hover { color: var(--navy-800); }

/* ========== APP SHELL ========== */
.app-shell {
  min-height: 100vh;
  display: flex;
  background: var(--surface);
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content-wrap {
  padding: 28px 32px 40px;
  flex: 1;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  color: #fff;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 20;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(201, 162, 39, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(45, 90, 138, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.brand-box {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 1;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.25), rgba(201, 162, 39, 0.08));
  border: 1px solid rgba(201, 162, 39, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-400);
  font-size: 22px;
  flex-shrink: 0;
}

.brand-title {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.35;
  color: #fff;
}

.brand-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  padding: 16px 14px;
  flex: 1;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  padding: 16px 12px 8px;
  margin-top: 4px;
}

.nav-section-label:first-child { margin-top: 0; padding-top: 4px; }

.sidebar .nav-link,
.mobile-nav .nav-link {
  color: rgba(255, 255, 255, 0.72);
  padding: 11px 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition);
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.sidebar .nav-link i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.85;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  transform: translateX(-3px);
}

.sidebar .nav-link.active {
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.2), rgba(201, 162, 39, 0.06));
  color: #fff;
  border-color: rgba(201, 162, 39, 0.25);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.sidebar .nav-link.active i { color: var(--gold-400); }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 1;
}

.sidebar-footer small {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
}

/* Mobile sidebar */
.offcanvas {
  border: none !important;
  box-shadow: var(--shadow-lg) !important;
}

.offcanvas-header {
  background: var(--navy-900);
  color: #fff;
  padding: 20px;
}

.offcanvas-header .offcanvas-title { font-weight: 800; font-size: 16px; }
.offcanvas-header .btn-close { filter: invert(1); opacity: 0.7; }

.mobile-nav {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav .nav-section-label { color: var(--text-muted); }

.mobile-nav .nav-link {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
}

.mobile-nav .nav-link:hover {
  background: #fff;
  border-color: var(--border);
}

.mobile-nav .nav-link.active {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

/* ========== TOPBAR ========== */
.topbar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0 32px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 15;
  box-shadow: var(--shadow-xs);
}

.page-title-wrap { display: flex; flex-direction: column; gap: 2px; }

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-date {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.topbar-date i { color: var(--gold-500); }

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px !important;
  border-radius: 50px !important;
  border: 1px solid var(--border) !important;
  background: #fff !important;
  transition: all var(--transition);
}

.user-menu-btn:hover {
  border-color: var(--navy-600) !important;
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.user-menu-info { text-align: right; line-height: 1.25; }
.user-menu-name { font-weight: 700; font-size: 13px; color: var(--text); display: block; }
.user-menu-role { font-size: 11px; color: var(--text-muted); display: block; }

.dropdown-menu {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 8px;
  min-width: 200px;
}

.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 500;
  font-size: 14px;
}

/* ========== PAGE HERO ========== */
.page-hero {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 55%, var(--navy-600) 100%);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -10%;
  width: 50%;
  height: 180%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.12) 0%, transparent 65%);
  pointer-events: none;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 200px;
  height: 200px;
  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");
  opacity: 0.5;
  pointer-events: none;
}

.page-hero-content { position: relative; z-index: 1; }

.page-hero h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.page-hero-actions { position: relative; z-index: 1; }

.page-hero .btn-light {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
}

.page-hero .btn-light:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.portal-welcome {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
  border: none;
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  color: #fff;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.portal-welcome::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 100%, rgba(201, 162, 39, 0.15), transparent 50%);
}

.portal-welcome h4 { font-weight: 800; position: relative; }
.portal-welcome p { color: rgba(255,255,255,.7) !important; position: relative; }

/* ========== STAT CARDS ========== */
.stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: transform var(--transition), box-shadow var(--transition);
  height: 100%;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-card .card-body {
  padding: 22px 22px 20px;
  position: relative;
  z-index: 1;
}

.stat-card .stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.stat-card .stat-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-card .stat-value.stat-sm { font-size: 20px; }

.stat-card .stat-trend {
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
}

.stat-card .icon { display: none; }

.stat-card--blue .stat-icon-wrap { background: var(--info-bg); color: var(--info); }
.stat-card--navy .stat-icon-wrap { background: rgba(15, 34, 58, 0.08); color: var(--navy-700); }
.stat-card--green .stat-icon-wrap { background: var(--success-bg); color: var(--success); }
.stat-card--gold .stat-icon-wrap { background: rgba(201, 162, 39, 0.12); color: var(--gold-600); }
.stat-card--purple .stat-icon-wrap { background: #f3e8ff; color: #7c3aed; }
.stat-card--orange .stat-icon-wrap { background: var(--warning-bg); color: var(--warning); }
.stat-card--red .stat-icon-wrap { background: var(--danger-bg); color: var(--danger); }

.stat-card--blue { border-top: 3px solid var(--info); }
.stat-card--navy { border-top: 3px solid var(--navy-700); }
.stat-card--green { border-top: 3px solid var(--success); }
.stat-card--gold { border-top: 3px solid var(--gold-500); }
.stat-card--purple { border-top: 3px solid #7c3aed; }
.stat-card--orange { border-top: 3px solid var(--warning); }
.stat-card--red { border-top: 3px solid var(--danger); }

/* ========== CARDS & PANELS ========== */
.card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background: var(--card);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  background: var(--card);
  border-bottom: 1px solid var(--border-light);
  border-radius: 0 !important;
  padding: 18px 22px;
  font-weight: 800;
  font-size: 15px;
  color: var(--navy-900);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(15, 34, 58, 0.06);
  color: var(--navy-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.card-header .btn { font-weight: 600; border-radius: var(--radius-sm); }

.panel-card .card-body.p-0 { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.alert-banner {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(217, 119, 6, 0.25);
  background: linear-gradient(135deg, #fffbeb, #fff);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.alert-banner-header {
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid rgba(217, 119, 6, 0.12);
  background: rgba(255, 251, 235, 0.6);
}

.alert-banner-header strong { color: #92400e; }

.finance-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.finance-chip strong { color: var(--navy-900); }

/* ========== TABLES ========== */
.table {
  vertical-align: middle;
  margin-bottom: 0;
}

.table thead th {
  color: var(--text-secondary);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
  padding: 14px 18px;
  white-space: nowrap;
}

.table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text);
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr {
  transition: background var(--transition);
}

.table-hover tbody tr:hover,
.table tbody tr:hover {
  background: rgba(15, 34, 58, 0.02);
}

.table a { font-weight: 600; }

.table-empty td {
  padding: 48px 24px !important;
  text-align: center;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 40px;
  opacity: 0.25;
  margin-bottom: 12px;
  display: block;
}

/* ========== BADGES ========== */
.badge-soft {
  background: rgba(35, 72, 112, 0.08);
  color: var(--navy-700);
  border: 1px solid rgba(35, 72, 112, 0.12);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
}

.badge-status-pending { background: var(--warning-bg); color: #92400e; border-color: rgba(217,119,6,.2); }
.badge-status-success { background: var(--success-bg); color: #065f46; border-color: rgba(5,150,105,.2); }
.badge-status-danger { background: var(--danger-bg); color: #991b1b; border-color: rgba(220,38,38,.2); }
.badge-status-info { background: var(--info-bg); color: #075985; border-color: rgba(2,132,199,.2); }

/* ========== BUTTONS ========== */
.btn {
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 14px;
  transition: all var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  border: none;
  box-shadow: 0 4px 14px rgba(15, 34, 58, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15, 34, 58, 0.3);
}

.btn-outline-primary {
  color: var(--navy-700);
  border-color: rgba(35, 72, 112, 0.35);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}

.btn-gold, .btn-warning {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  border: none;
  color: var(--navy-950);
  font-weight: 700;
}

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; border-radius: var(--radius-md); }

/* ========== FORMS ========== */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--navy-600);
  box-shadow: 0 0 0 4px rgba(35, 72, 112, 0.1);
}

.form-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control-sm, .form-select-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.form-check-input:checked {
  background-color: var(--navy-700);
  border-color: var(--navy-700);
}

.input-group-text {
  border-color: var(--border);
  color: var(--text-muted);
}

.input-group .form-control { border-color: var(--border); }
.input-group .form-control:focus { z-index: 3; }
.input-group:focus-within .input-group-text {
  border-color: var(--navy-600);
  color: var(--navy-700);
}

/* ========== ALERTS ========== */
.alert {
  border-radius: var(--radius-md);
  border: none;
  font-weight: 500;
  padding: 14px 18px;
  box-shadow: var(--shadow-xs);
}

.alert-success { background: var(--success-bg); color: #065f46; }
.alert-danger { background: var(--danger-bg); color: #991b1b; }
.alert-warning { background: var(--warning-bg); color: #92400e; }
.alert-light { background: var(--surface-2); border: 1px solid var(--border-light) !important; color: var(--text); }

/* ========== TASK / LIST ITEMS ========== */
.task-item {
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  background: var(--surface-2);
  transition: all var(--transition);
  border-right: 3px solid var(--navy-600);
}

.task-item:hover {
  background: #fff;
  box-shadow: var(--shadow-sm);
  border-right-color: var(--gold-500);
}

.task-item-title { font-weight: 700; font-size: 14px; color: var(--text); }
.task-item-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.event-item {
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: #fff;
  transition: box-shadow var(--transition);
}

.event-item:hover { box-shadow: var(--shadow-sm); }

/* ========== TABS (case view etc) ========== */
.nav-tabs {
  border-bottom: 2px solid var(--border-light);
  gap: 4px;
  padding-bottom: 0;
}

.nav-tabs .nav-link {
  border: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 18px;
  transition: all var(--transition);
}

.nav-tabs .nav-link:hover {
  color: var(--navy-700);
  background: var(--surface-2);
}

.nav-tabs .nav-link.active {
  color: var(--navy-900);
  background: #fff;
  border-bottom: 2px solid var(--gold-500);
  margin-bottom: -2px;
}

.tab-content {
  padding-top: 20px;
}

/* ========== CALENDAR (legacy grid) ========== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

/* ========== CALENDAR PRO ========== */
.calendar-page { margin-top: -4px; }

.cal-toolbar-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff;
}

.cal-toolbar-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.cal-toolbar-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 4px;
}

.cal-nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cal-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.cal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.cal-today-btn {
  padding: 8px 14px;
  width: auto;
  font-size: 13px;
  font-weight: 700;
}

.cal-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 22px;
  background: var(--surface-2);
  border-top: 1px solid var(--border-light);
  align-items: center;
}

.cal-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.cal-filter-chip:hover { border-color: var(--navy-600); color: var(--navy-800); }
.cal-filter-chip.active { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.cal-filter-chip .dot { width: 8px; height: 8px; border-radius: 50%; }

.cal-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.cal-stat-pill {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-xs);
}

.cal-stat-pill-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.cal-stat-pill-value { font-size: 22px; font-weight: 800; line-height: 1; color: var(--navy-900); }
.cal-stat-pill-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

.cal-month-wrap {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-light);
}

.cal-weekday {
  padding: 12px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.cal-weekday.weekend { color: var(--danger); opacity: 0.85; }

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}

.cal-cell {
  min-height: 118px;
  border-left: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 8px;
  background: #fff;
  transition: background var(--transition);
  cursor: pointer;
  position: relative;
}

.cal-cell:nth-child(7n) { border-left: none; }

.cal-cell:hover { background: rgba(15, 34, 58, 0.02); }

.cal-cell--other {
  background: var(--surface-2);
  opacity: 0.65;
}

.cal-cell--other .cal-cell-num { color: var(--text-muted); }

.cal-cell--today {
  background: linear-gradient(180deg, rgba(35, 72, 112, 0.04), #fff);
  box-shadow: inset 0 -3px 0 var(--gold-500);
}

.cal-cell--today .cal-cell-num {
  background: var(--navy-800);
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-cell--selected {
  background: rgba(201, 162, 39, 0.08);
  box-shadow: inset 0 0 0 2px rgba(201, 162, 39, 0.35);
}

.cal-cell-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--navy-900);
  margin-bottom: 6px;
}

.cal-cell-events { display: flex; flex-direction: column; gap: 3px; }

.cal-event-link {
  display: block;
  font-size: 10px;
  line-height: 1.35;
  padding: 4px 6px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 3px solid transparent;
  transition: transform var(--transition);
}

.cal-event-link:hover { transform: translateX(-2px); }

.cal-event-more {
  font-size: 10px;
  font-weight: 800;
  color: var(--navy-700);
  padding: 2px 6px;
  cursor: pointer;
}

.cal-event.cal-hearing, .cal-event-link.cal-hearing {
  background: #fef2f2; color: #991b1b; border-right-color: #dc2626;
}
.cal-event.cal-appointment, .cal-event-link.cal-appointment {
  background: #eff6ff; color: #1d4ed8; border-right-color: #2563eb;
}
.cal-event.cal-deadline, .cal-event-link.cal-deadline {
  background: #fffbeb; color: #92400e; border-right-color: #d97706;
}
.cal-event.cal-task, .cal-event-link.cal-task {
  background: #ecfdf5; color: #065f46; border-right-color: #059669;
}
.cal-event.cal-personal, .cal-event-link.cal-personal {
  background: #f3e8ff; color: #6b21a8; border-right-color: #9333ea;
}
.cal-event.cal-other, .cal-event-link.cal-other {
  background: #f1f5f9; color: #475569; border-right-color: #64748b;
}

.cal-sidebar-card { position: sticky; top: calc(var(--topbar-h) + 16px); }

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--surface-2);
}

.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.cal-legend-item span:first-child {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.cal-agenda-day {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.cal-agenda-day:last-child { border-bottom: none; }

.cal-agenda-date {
  font-size: 12px;
  font-weight: 800;
  color: var(--navy-800);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-agenda-date.is-today { color: var(--gold-600); }

.cal-agenda-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-light);
}

.cal-agenda-item:last-child { border-bottom: none; padding-bottom: 0; }

.cal-agenda-time {
  min-width: 44px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
}

.cal-agenda-body { flex: 1; min-width: 0; }
.cal-agenda-title { font-size: 13px; font-weight: 700; color: var(--text); }
.cal-agenda-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.cal-add-panel .form-label { font-size: 11px; margin-bottom: 4px; }

/* Day detail panel (click a day) */
.cal-day-panel {
  border: none;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.cal-day-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  transition: background 0.35s ease;
}

.cal-day-panel-date {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cal-day-panel-date > i {
  font-size: 28px;
  opacity: 0.9;
}

.cal-day-panel-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
}

.cal-day-panel-sub {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

.cal-day-panel-count {
  min-width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.cal-day-panel-body {
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
  background: linear-gradient(180deg, #fafbff, #fff);
}

.cal-day-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}

.cal-day-empty i {
  font-size: 36px;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.cal-day-empty p {
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cal-day-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  background: var(--item-bg, #f8fafc);
  border: 1px solid var(--item-border, #e2e8f0);
  border-right: 4px solid var(--item-color, #64748b);
  transition: transform var(--transition), box-shadow var(--transition);
}

.cal-day-item:hover {
  transform: translateX(-3px);
  box-shadow: var(--shadow-sm);
}

.cal-day-item-time {
  min-width: 46px;
  font-size: 13px;
  font-weight: 800;
  color: var(--item-color, var(--navy-700));
  padding-top: 2px;
}

.cal-day-item-main { flex: 1; min-width: 0; }

.cal-day-item-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.4;
}

.cal-day-item-title i {
  color: var(--item-color);
  margin-left: 6px;
}

.cal-day-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.cal-day-type-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  background: var(--item-bg);
  color: var(--item-color);
  border: 1px solid var(--item-border);
}

.cal-day-priority {
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.cal-priority-high { background: #fef2f2; color: #dc2626; }
.cal-priority-medium { background: #fffbeb; color: #d97706; }
.cal-priority-low { background: #ecfdf5; color: #059669; }

.cal-day-item-notes {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

.cal-day-task-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  color: var(--item-color, var(--navy-600));
}

.cal-cell-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-right: 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  vertical-align: middle;
}

.cal-cell--selected .cal-event-more {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
  border-radius: 6px;
  padding: 4px 6px;
}

.cal-agenda-day.is-selected {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), transparent);
}

.cal-agenda-date.is-selected {
  color: #2563eb;
}

.cal-event-more {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-radius: 6px;
  padding: 3px 6px;
}

@media (max-width: 991px) {
  .cal-stats-row { grid-template-columns: repeat(2, 1fr); }
  .cal-cell { min-height: 90px; padding: 6px; }
  .cal-event-link { font-size: 9px; padding: 3px 4px; }
  .cal-sidebar-card { position: static; }
  .cal-toolbar-title { font-size: 18px; }
}

@media (max-width: 575px) {
  .cal-stats-row { grid-template-columns: 1fr 1fr; }
  .cal-cell { min-height: 72px; }
  .cal-weekday { font-size: 10px; padding: 8px 2px; }
}

.calendar-day {
  min-height: 100px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px;
  transition: box-shadow var(--transition);
}

.calendar-day:hover { box-shadow: var(--shadow-sm); }

.calendar-day.today {
  border-color: var(--navy-600);
  box-shadow: 0 0 0 2px rgba(35, 72, 112, 0.12);
  background: linear-gradient(180deg, #fff, var(--surface-2));
}

.calendar-day .day-num {
  font-weight: 800;
  color: var(--navy-800);
  margin-bottom: 8px;
  font-size: 14px;
}

.cal-event {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  background: var(--info-bg);
  color: #1e40af;
  font-weight: 600;
}

/* ========== TIMELINE ========== */
.timeline-list {
  border-right: 3px solid var(--border);
  padding-right: 20px;
}

.timeline-item {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  position: relative;
}

.timeline-item::before {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--gold-500);
  border: 3px solid #fff;
  border-radius: 50%;
  position: absolute;
  right: -27px;
  top: 8px;
  box-shadow: 0 0 0 2px var(--border);
}

.timeline-date {
  min-width: 90px;
  font-weight: 700;
  color: var(--navy-700);
  font-size: 13px;
}

.timeline-body {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-xs);
}

/* ========== LOGIN ========== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--navy-950);
  padding: 0;
}

.login-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.login-brand-panel {
  flex: 1;
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-950) 50%, #060d18 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
  color: #fff;
  text-align: center;
}

.login-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(201, 162, 39, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(45, 90, 138, 0.2) 0%, transparent 50%);
}

.login-brand-panel > * { position: relative; z-index: 1; }

.login-brand-icon {
  width: 88px;
  height: 88px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.25), rgba(201, 162, 39, 0.05));
  border: 1px solid rgba(201, 162, 39, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  color: var(--gold-400);
  margin-bottom: 28px;
}

.login-brand-panel h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
}

.login-brand-panel p {
  color: rgba(255, 255, 255, 0.65);
  max-width: 360px;
  font-size: 15px;
  line-height: 1.7;
}

.login-brand-features {
  margin-top: 40px;
  text-align: right;
  max-width: 340px;
}

.login-brand-features li {
  list-style: none;
  padding: 10px 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand-features li i {
  color: var(--gold-400);
  width: 20px;
}

.login-form-panel {
  width: 480px;
  max-width: 100%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.2);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.login-card h3 {
  font-weight: 800;
  color: var(--navy-900);
  font-size: 24px;
}

.login-logo { display: none; }

.login-demo-hint {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 20px;
}

.login-demo-hint code {
  background: rgba(15, 34, 58, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--navy-700);
}

/* Legacy login single card fallback on mobile */
@media (max-width: 991px) {
  .login-split { flex-direction: column; }
  .login-brand-panel { padding: 40px 24px; min-height: auto; }
  .login-brand-features { display: none; }
  .login-form-panel {
    width: 100%;
    box-shadow: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin-top: -20px;
  }
}

/* ========== MISC ========== */
.border.rounded-3 { border-color: var(--border-light) !important; border-radius: var(--radius-md) !important; }

code {
  background: rgba(15, 34, 58, 0.06);
  color: var(--navy-700);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
}

.print-header { display: none; }

.text-primary { color: var(--navy-700) !important; }

/* Scrollbar global */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ========== RESPONSIVE ========== */
@media (max-width: 991px) {
  .content-wrap { padding: 20px 16px 32px; }
  .topbar { padding: 0 16px; height: 64px; }
  .page-title { font-size: 17px; }
  .topbar-date { display: none !important; }
  .page-hero { padding: 22px 20px; border-radius: var(--radius-lg); }
  .page-hero h1 { font-size: 22px; }
  .stat-card .stat-value { font-size: 26px; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .btn, .dropdown, .alert, .page-hero, .case-file-toolbar { display: none !important; }
  .content-wrap { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  .print-header { display: block; text-align: center; margin-bottom: 20px; }
  .case-file-hero { background: #fff !important; color: #000 !important; box-shadow: none; border: 1px solid #ddd; }
  .case-file-sidebar { position: static !important; }
}

/* ========== CASE FILE PAGE ========== */
.case-file-page { margin-top: -8px; }

.case-file-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.case-file-toolbar .btn-light {
  background: #fff;
  border: 1px solid var(--border);
  font-weight: 600;
}

.case-file-hero {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
  border-radius: var(--radius-xl);
  padding: 28px 30px;
  margin-bottom: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.case-file-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, rgba(201, 162, 39, 0.14), transparent 50%);
  pointer-events: none;
}

.case-file-hero-inner { position: relative; z-index: 1; }

.case-file-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

.case-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

.case-status-badge.gold {
  background: rgba(201, 162, 39, 0.22);
  border-color: rgba(201, 162, 39, 0.4);
  color: var(--gold-300);
}

.case-file-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 16px;
}

.case-file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.case-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
}

.case-meta-item i {
  color: var(--gold-400);
  width: 16px;
  text-align: center;
}

.case-meta-item a { color: #fff; font-weight: 700; }
.case-meta-item a:hover { color: var(--gold-300); }

.case-file-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.case-mini-stat {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: center;
}

.case-mini-stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
  font-weight: 600;
}

.case-mini-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.case-mini-stat-value.text-success-lite { color: #6ee7b7; }
.case-mini-stat-value.text-danger-lite { color: #fca5a5; }

.case-file-sidebar { position: sticky; top: calc(var(--topbar-h) + 16px); }

.case-info-card .card-body { padding: 0; }

.case-info-row {
  display: flex;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
}

.case-info-row:last-child { border-bottom: none; }

.case-info-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--navy-700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.case-info-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.case-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}

.case-info-desc {
  padding: 16px 20px;
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  border-top: 1px solid var(--border-light);
}

.team-member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
}

.team-member:last-child { border-bottom: none; }

.team-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.team-member-name { font-weight: 700; font-size: 14px; }
.team-member-role { font-size: 12px; color: var(--text-muted); }

.finance-summary-card .card-body { padding: 20px; }

.finance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-light);
}

.finance-row:last-of-type { border-bottom: none; }

.finance-row-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.finance-row-value { font-weight: 800; font-size: 15px; }

.fee-progress-wrap { margin-top: 16px; }
.fee-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.fee-progress {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.fee-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #34d399);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.case-tabs-wrap {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.case-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-light);
  scrollbar-width: thin;
}

.case-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  background: transparent;
  transition: all var(--transition);
}

.case-tabs .nav-link i { font-size: 14px; opacity: 0.85; }

.case-tabs .nav-link:hover {
  background: #fff;
  color: var(--navy-700);
  border-color: var(--border-light);
}

.case-tabs .nav-link.active {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(15, 34, 58, 0.2);
}

.case-tabs .nav-link.active i { opacity: 1; color: var(--gold-400); }

.tab-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 34, 58, 0.08);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.case-tabs .nav-link.active .tab-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.case-tab-content {
  padding: 24px;
  min-height: 420px;
}

.add-panel {
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  background: linear-gradient(180deg, #fff, var(--surface-2));
  overflow: hidden;
}

.add-panel-head {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 800;
  color: var(--navy-800);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-panel-head i {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(15, 34, 58, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--navy-700);
}

.add-panel-body { padding: 16px 18px; }

.data-panel {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
}

.data-panel .table thead th { background: var(--surface-2); }

.hearing-card {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition);
}

.hearing-card:hover { box-shadow: var(--shadow-sm); }

.hearing-card-date {
  width: 90px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 10px;
  text-align: center;
}

.hearing-card-day {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.hearing-card-month {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 4px;
  font-weight: 600;
}

.hearing-card-time {
  font-size: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 600;
}

.hearing-card-body { flex: 1; padding: 18px 20px; min-width: 0; }

.hearing-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy-900);
  margin-bottom: 8px;
}

.hearing-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.hearing-result-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  background: var(--surface-2);
  margin-left: -20px;
  margin-right: -20px;
  margin-bottom: -18px;
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 18px;
  border-radius: 0 0 var(--radius-lg) 0;
}

.hearing-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--gold-500);
}

.case-tab-content .timeline-list { margin-top: 8px; }

@media (max-width: 991px) {
  .case-file-stats { grid-template-columns: 1fr; }
  .case-file-title { font-size: 21px; }
  .case-file-sidebar { position: static; }
  .hearing-card { flex-direction: column; }
  .hearing-card-date {
    width: 100%;
    flex-direction: row;
    gap: 16px;
    padding: 12px 16px;
    justify-content: flex-start;
  }
  .hearing-card-time { margin-top: 0; padding-top: 0; border-top: none; margin-right: auto; }
  .case-tab-content { padding: 16px; }
}

/* ========== PERMISSIONS UI ========== */
.perm-group-card .card-body {
  max-height: 420px;
  overflow-y: auto;
}
.perm-row-custom {
  background: rgba(124, 58, 237, 0.06);
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
}
.perm-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 14px);
  box-shadow: var(--shadow-md, 0 12px 32px rgba(15, 34, 58, 0.08));
  backdrop-filter: blur(8px);
}

/* ========== SELECT2 (see select2-app.css) ========== */

/* ========== VIVID THEME (colorful UI) ========== */
body.theme-vivid {
  background: linear-gradient(135deg, #eef2ff 0%, #fdf4ff 35%, #ecfdf5 70%, #fff7ed 100%);
  background-attachment: fixed;
}

body.theme-vivid .app-shell {
  background: transparent;
}

body.theme-vivid .content-wrap {
  background: transparent;
}

body.theme-vivid .topbar {
  background: rgba(255, 255, 255, 0.88);
  border-bottom-color: rgba(124, 58, 237, 0.12);
}

body.theme-vivid .page-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #5b21b6 45%, #be185d 100%);
  box-shadow: 0 20px 50px rgba(91, 33, 182, 0.25);
}

body.theme-vivid .page-hero::before {
  background: radial-gradient(circle at 20% 80%, rgba(251, 191, 36, 0.35), transparent 50%);
}

body.theme-vivid .stat-card {
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 24px rgba(15, 34, 58, 0.06);
}

body.theme-vivid .stat-card--blue { background: linear-gradient(145deg, #fff, #eff6ff); }
body.theme-vivid .stat-card--green { background: linear-gradient(145deg, #fff, #ecfdf5); }
body.theme-vivid .stat-card--gold { background: linear-gradient(145deg, #fff, #fffbeb); }
body.theme-vivid .stat-card--purple { background: linear-gradient(145deg, #fff, #f3e8ff); }
body.theme-vivid .stat-card--orange { background: linear-gradient(145deg, #fff, #fff7ed); }
body.theme-vivid .stat-card--red { background: linear-gradient(145deg, #fff, #fef2f2); }
body.theme-vivid .stat-card--navy { background: linear-gradient(145deg, #fff, #f0f4f8); }

body.theme-vivid .card,
body.theme-vivid .panel-card {
  border-color: rgba(226, 232, 240, 0.8);
  box-shadow: 0 6px 20px rgba(15, 34, 58, 0.05);
}

body.theme-vivid .card-header {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.06), rgba(124, 58, 237, 0.04), transparent);
  border-bottom-color: rgba(124, 58, 237, 0.1);
}

body.theme-vivid .card-header-icon {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
}

body.theme-vivid .btn-primary {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

body.theme-vivid .btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #6d28d9);
  box-shadow: 0 6px 20px rgba(91, 33, 182, 0.4);
}

body.theme-vivid .btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  border: none;
}

body.theme-vivid .btn-warning {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  border: none;
  color: #fff;
}

body.theme-vivid .btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  border: none;
}

body.theme-vivid .badge-soft {
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
}

body.theme-vivid .badge-status-pending { background: #fef3c7; color: #b45309; }
body.theme-vivid .badge-status-active { background: #d1fae5; color: #047857; }
body.theme-vivid .badge-status-closed { background: #e2e8f0; color: #475569; }

body.theme-vivid .sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
}

body.theme-vivid .sidebar .nav-link:hover {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.25), rgba(124, 58, 237, 0.15));
}

body.theme-vivid .sidebar .nav-link.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(201, 162, 39, 0.2));
  border-color: rgba(201, 162, 39, 0.35);
}

body.theme-vivid .table tbody tr:hover {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.04), rgba(124, 58, 237, 0.03));
}

body.theme-vivid .cal-toolbar {
  background: linear-gradient(135deg, #1e3a8a, #5b21b6, #be185d);
}

body.theme-vivid .cal-stat-pill {
  border: none;
  box-shadow: 0 4px 16px rgba(15, 34, 58, 0.06);
}

body.theme-vivid .cal-stat-pill:nth-child(1) { background: linear-gradient(145deg, #fff, #eff6ff); }
body.theme-vivid .cal-stat-pill:nth-child(2) { background: linear-gradient(145deg, #fff, #fef2f2); }
body.theme-vivid .cal-stat-pill:nth-child(3) { background: linear-gradient(145deg, #fff, #fffbeb); }
body.theme-vivid .cal-stat-pill:nth-child(4) { background: linear-gradient(145deg, #fff, #ecfdf5); }

body.theme-vivid .cal-cell--selected {
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.12), rgba(37, 99, 235, 0.06));
  box-shadow: inset 0 0 0 2px rgba(124, 58, 237, 0.45);
}

body.theme-vivid .cal-cell--today {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), #fff);
  box-shadow: inset 0 -3px 0 #7c3aed;
}

body.theme-vivid .cal-filter-chip.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-color: transparent;
}

body.theme-vivid .login-card {
  box-shadow: 0 24px 60px rgba(91, 33, 182, 0.2);
}

body.theme-vivid .case-file-hero {
  background: linear-gradient(135deg, #1e3a8a, #5b21b6, #0f766e);
}

/* ========== APP MODALS (add forms) ========== */
.app-modal .modal-content {
  border: none;
  border-radius: var(--radius-xl);
  overflow: visible;
  box-shadow: var(--shadow-lg);
}

.app-modal-header {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  border: none;
  padding: 18px 22px;
}

.app-modal-header .modal-title {
  font-weight: 800;
  font-size: 17px;
}

.app-modal-body {
  padding: 22px;
  background: linear-gradient(180deg, #fafbff, #fff);
  max-height: min(70vh, 620px);
  overflow-y: auto;
  overflow-x: visible;
}

.app-modal-footer {
  border-top: 1px solid var(--border-light);
  padding: 14px 22px;
  background: var(--surface-2);
}

.btn-add-new {
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
  font-weight: 700;
  white-space: nowrap;
}

.btn-add-new.btn-sm {
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.22);
}

.tab-action-bar {
  display: flex;
  justify-content: flex-end;
}

.list-page-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-toolbar .btn-add-new {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border: none;
  color: #1e1b4b;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  width: auto;
  height: auto;
  padding: 8px 14px;
  font-size: 13px;
}

.cal-toolbar .btn-add-new:hover {
  background: linear-gradient(135deg, #fcd34d, #fbbf24);
  color: #1e1b4b;
}

