/* =============================================
   style.css - e-Budget ศธจ.นราธิวาส
   Blue Theme | Responsive | Glassmorphism
   ============================================= */

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

/* ===== CSS Variables ===== */
:root {
  --primary:       #1e3a8a;
  --primary-dark:  #1e2d6b;
  --primary-mid:   #1d4ed8;
  --primary-light: #3b82f6;
  --primary-pale:  #dbeafe;
  --secondary:     #0ea5e9;
  --accent:        #06b6d4;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --white:         #ffffff;
  --bg:            #f0f4ff;
  --bg-card:       rgba(255,255,255,0.92);
  --text-dark:     #0f172a;
  --text-mid:      #334155;
  --text-light:    #64748b;
  --text-pale:     #94a3b8;
  --border:        rgba(30,58,138,0.15);
  --shadow-sm:     0 1px 3px rgba(30,58,138,0.1);
  --shadow-md:     0 4px 16px rgba(30,58,138,0.12);
  --shadow-lg:     0 12px 40px rgba(30,58,138,0.18);
  --radius:        12px;
  --radius-lg:     20px;
  --sidebar-w:     260px;
  --transition:    all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Prompt', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Layout ===== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(170deg, #0f2460 0%, #1e3a8a 40%, #1d4ed8 100%);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(30,58,138,0.25);
  transition: var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 99px; }

.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand .logo-wrap {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.sidebar-brand .logo-img {
  width: 42px; height: 42px; border-radius: 10px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.sidebar-brand .office-name {
  font-size: 12px; font-weight: 600;
  line-height: 1.4; letter-spacing: 0.02em;
}
.sidebar-brand .system-label {
  font-size: 10px; color: rgba(255,255,255,0.55);
  letter-spacing: 0.05em; margin-top: 2px;
}

.sidebar-user {
  padding: 12px 18px;
  background: rgba(255,255,255,0.07);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user .user-avatar {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #60a5fa, #818cf8);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
  color: white;
}
.sidebar-user .user-info { overflow: hidden; }
.sidebar-user .user-name {
  font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user .user-role {
  font-size: 10px; color: rgba(255,255,255,0.5); margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex; flex-direction: column; gap: 2px;
}

.nav-section-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase;
  padding: 10px 10px 4px;
  margin-top: 4px;
}

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(255,255,255,0.75);
  font-size: 13.5px; font-weight: 500;
  transition: var(--transition);
  position: relative;
}
.nav-link .nav-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  transition: var(--transition);
}
.nav-link:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  transform: translateX(3px);
}
.nav-link:hover .nav-icon {
  background: rgba(255,255,255,0.15);
}
.nav-link.active {
  background: rgba(255,255,255,0.15);
  color: white;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.nav-link.active .nav-icon {
  background: var(--primary-light);
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}
.nav-link.active::before {
  content: '';
  position: absolute; left: -10px;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--secondary);
  border-radius: 0 3px 3px 0;
}
.nav-link.danger { color: #fca5a5; }
.nav-link.danger:hover { background: rgba(239,68,68,0.15); color: #fecaca; }

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ===== Main Content ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  min-height: 100vh;
}

/* ===== Mobile Header ===== */
.mobile-header {
  display: none;
  align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #0f2460, #1e3a8a);
  color: white;
  position: sticky; top: 0; z-index: 90;
  box-shadow: 0 2px 12px rgba(30,58,138,0.3);
}
.mobile-header .app-title { font-size: 14px; font-weight: 600; }
.hamburger-btn {
  background: rgba(255,255,255,0.15); border: none;
  border-radius: 8px; padding: 8px; cursor: pointer;
  color: white; font-size: 18px; line-height: 1;
  transition: var(--transition);
}
.hamburger-btn:hover { background: rgba(255,255,255,0.25); }

.sidebar-overlay {
  display: none; position: fixed;
  inset: 0; background: rgba(0,0,0,0.45);
  z-index: 99; backdrop-filter: blur(2px);
}

/* ===== Page Header ===== */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 26px; font-weight: 700; color: var(--text-dark); line-height: 1.3; }
.page-subtitle { font-size: 13px; color: var(--text-light); margin-top: 4px; }
.fiscal-badge {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  background: var(--white);
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 600; color: var(--primary);
  white-space: nowrap; flex-shrink: 0;
}
.fiscal-badge .dot {
  width: 8px; height: 8px;
  background: var(--success); border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.7; }
}

/* ===== Stat Cards ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  position: relative; overflow: hidden;
  transition: var(--transition);
}
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.blue::before   { background: var(--primary-light); }
.stat-card.green::before  { background: var(--success); }
.stat-card.amber::before  { background: var(--warning); }
.stat-card.purple::before { background: #8b5cf6; }
.stat-card.cyan::before   { background: var(--accent); }

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 14px;
}
.stat-card.blue .stat-icon   { background: #eff6ff; }
.stat-card.green .stat-icon  { background: #ecfdf5; }
.stat-card.amber .stat-icon  { background: #fffbeb; }
.stat-card.purple .stat-icon { background: #f5f3ff; }
.stat-card.cyan .stat-icon   { background: #ecfeff; }

.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-pale); margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-dark); line-height: 1; }
.stat-sub   { font-size: 11px; color: var(--text-light); margin-top: 6px; font-weight: 500; }

/* ===== Glass Card ===== */
.glass-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 24px;
  transition: var(--transition);
}
.glass-card:hover { box-shadow: var(--shadow-lg); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid rgba(30,58,138,0.08);
}
.card-title {
  font-size: 15px; font-weight: 700; color: var(--text-dark);
  display: flex; align-items: center; gap: 8px;
}
.card-title .card-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: #eff6ff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

/* ===== Charts Grid ===== */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.charts-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* ===== Tables ===== */
.table-wrapper { overflow-x: auto; border-radius: 10px; }
.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
.data-table thead th {
  padding: 12px 14px;
  background: #f0f4ff;
  color: var(--primary);
  font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.07em;
  border-bottom: 2px solid var(--primary-pale);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-mid);
  vertical-align: top;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f8fbff; }

/* ===== Progress Bar ===== */
.progress-wrap {
  background: #e2e8f0; border-radius: 999px; height: 8px;
  overflow: hidden; min-width: 60px;
}
.progress-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-light), var(--accent));
  transition: width 0.5s ease;
}
.progress-text {
  font-size: 11px; font-weight: 700; color: var(--primary-mid);
  white-space: nowrap;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-pending  { background: #f3f4f6; color: #374151; }
.badge-progress { background: #dbeafe; color: #1e40af; }
.badge-done     { background: #d1fae5; color: #065f46; }
.badge-admin    { background: #ede9fe; color: #5b21b6; }
.badge-school   { background: #cffafe; color: #0e7490; }
.badge-user     { background: #fef3c7; color: #92400e; }
.badge-active   { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #fee2e2; color: #991b1b; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 9px;
  font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
  transition: var(--transition);
  text-decoration: none; line-height: 1;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary-mid), var(--primary-light));
  color: white; box-shadow: 0 4px 12px rgba(29,78,216,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(29,78,216,0.4); }
.btn-secondary {
  background: var(--white); color: var(--primary);
  border: 1.5px solid var(--primary-pale); box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--primary-pale); }
.btn-success { background: linear-gradient(135deg, #059669, #10b981); color: white; box-shadow: 0 4px 12px rgba(5,150,105,0.3); }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(5,150,105,0.4); }
.btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); color: white; box-shadow: 0 4px 12px rgba(220,38,38,0.3); }
.btn-danger:hover { transform: translateY(-2px); }
.btn-warning { background: linear-gradient(135deg, #d97706, #f59e0b); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }
.btn-icon { padding: 7px; border-radius: 8px; line-height: 0; }

/* ===== Forms ===== */
.form-section { margin-bottom: 30px; }
.form-section-title {
  font-size: 13px; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-pale);
  display: flex; align-items: center; gap: 8px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label {
  font-size: 12px; font-weight: 600; color: var(--text-mid);
  display: flex; align-items: center; gap: 4px;
}
.form-label .req { color: var(--danger); }
.form-control {
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  font-size: 13.5px; font-family: 'Prompt', sans-serif;
  color: var(--text-dark);
  background: var(--white);
  transition: var(--transition);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.form-control[readonly] { background: #f8fafc; color: var(--text-light); }
.form-hint { font-size: 11px; color: var(--text-pale); }

textarea.form-control { resize: vertical; min-height: 88px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(145deg, #0f2460 0%, #1e3a8a 45%, #1d4ed8 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
  top: -200px; right: -100px;
}
.login-page::after {
  content: '';
  position: absolute; width: 350px; height: 350px; border-radius: 50%;
  background: rgba(255,255,255,0.03);
  bottom: -100px; left: -80px;
}
.login-card {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 44px 40px;
  width: 100%; max-width: 440px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.3);
  position: relative; z-index: 1;
}
.login-logo {
  text-align: center; margin-bottom: 28px;
}
.login-logo .logo-circle {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  border-radius: 20px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; box-shadow: 0 8px 24px rgba(30,58,138,0.35);
}
.login-logo .office-title { font-size: 15px; font-weight: 700; color: var(--primary); }
.login-logo .system-sub   { font-size: 12px; color: var(--text-light); margin-top: 3px; }
.login-title {
  font-size: 20px; font-weight: 700; color: var(--text-dark);
  margin-bottom: 22px; text-align: center;
}
.login-tabs {
  display: flex; border-radius: 10px; overflow: hidden;
  background: #f1f5f9; padding: 3px; margin-bottom: 24px; gap: 3px;
}
.login-tab {
  flex: 1; padding: 9px 12px;
  border: none; background: transparent;
  border-radius: 8px; cursor: pointer;
  font-size: 13px; font-family: 'Prompt', sans-serif;
  font-weight: 500; color: var(--text-light);
  transition: var(--transition);
}
.login-tab.active {
  background: var(--white);
  color: var(--primary); font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ===== Modals ===== */
.modal-overlay {
  display: none; position: fixed;
  inset: 0; background: rgba(0,0,0,0.5);
  z-index: 200; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(3px);
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--white); border-radius: 20px;
  padding: 30px; width: 100%; max-width: 520px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
  animation: modalIn 0.25s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-box.modal-lg { max-width: 720px; }
@keyframes modalIn {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--text-dark); }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: #f1f5f9; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-light); transition: var(--transition);
}
.modal-close:hover { background: #fee2e2; color: var(--danger); }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

/* ===== Search & Filter ===== */
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px; align-items: center;
}
.search-input-wrap {
  position: relative; flex: 1; min-width: 200px;
}
.search-input-wrap .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-pale); font-size: 16px; pointer-events: none;
}
.search-input {
  padding: 9px 14px 9px 38px;
  border: 1.5px solid #cbd5e1; border-radius: 9px;
  font-size: 13px; font-family: 'Prompt', sans-serif;
  width: 100%; background: var(--white);
  transition: var(--transition);
}
.search-input:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.filter-select {
  padding: 9px 14px; border: 1.5px solid #cbd5e1; border-radius: 9px;
  font-size: 13px; font-family: 'Prompt', sans-serif;
  background: var(--white); cursor: pointer; transition: var(--transition);
}
.filter-select:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

/* ===== Alerts ===== */
.alert {
  padding: 12px 16px; border-radius: 10px;
  margin-bottom: 16px; font-size: 13.5px; font-weight: 500;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid #059669; }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #dc2626; }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }

/* ===== Image Grid ===== */
.image-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
  margin-top: 10px;
}
.image-gallery img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-radius: 8px; border: 2px solid var(--border);
  cursor: pointer; transition: var(--transition);
}
.image-gallery img:hover { transform: scale(1.04); border-color: var(--primary-light); }

/* ===== Pagination ===== */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 24px; flex-wrap: wrap;
}
.page-btn {
  min-width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; text-decoration: none;
  border: 1.5px solid #cbd5e1; background: var(--white);
  color: var(--text-mid); transition: var(--transition); padding: 0 10px;
}
.page-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.page-btn.active { background: var(--primary-mid); color: white; border-color: var(--primary-mid); }
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ===== Confirm Dialog ===== */
.confirm-icon { font-size: 48px; text-align: center; margin-bottom: 12px; }
.confirm-msg  { text-align: center; color: var(--text-mid); font-size: 14px; line-height: 1.6; }

/* ===== Upload Area ===== */
.upload-area {
  border: 2px dashed #cbd5e1; border-radius: 12px;
  padding: 24px; text-align: center; cursor: pointer;
  transition: var(--transition); background: #f8fbff;
}
.upload-area:hover { border-color: var(--primary-light); background: #eff6ff; }
.upload-area .upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-area .upload-text { font-size: 13px; color: var(--text-light); }
.upload-area .upload-hint { font-size: 11px; color: var(--text-pale); margin-top: 4px; }

/* ===== No Data ===== */
.no-data {
  text-align: center; padding: 48px 20px; color: var(--text-pale);
}
.no-data .no-data-icon { font-size: 48px; margin-bottom: 12px; }
.no-data .no-data-text { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.no-data .no-data-sub  { font-size: 13px; }

/* ===== Budget Meter ===== */
.budget-meter { background: var(--white); border-radius: 12px; padding: 16px; border: 1px solid var(--border); }
.budget-row   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.budget-label { font-size: 12px; color: var(--text-light); font-weight: 600; }
.budget-value { font-size: 13px; font-weight: 700; color: var(--text-dark); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .charts-grid-3 { grid-template-columns: 1fr 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 110;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .main-content { margin-left: 0; padding: 16px; }
  .mobile-header { display: flex; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .charts-grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; gap: 10px; }
  .page-title { font-size: 20px; }
  .stat-value { font-size: 22px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .table-wrapper { font-size: 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px; }
  .modal-box { padding: 20px; }
  .stat-card { padding: 16px; }
}

/* ===== Utilities ===== */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-left   { text-align: left; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mt-4 { margin-top: 28px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 28px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }

/* ===== Custom Dashboard Enhancements ===== */

/* Strategy Badge Hover Effect */
.strategy-badge-hover {
    transition: all 0.2s ease;
    cursor: help;
}
.strategy-badge-hover:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Year Selector Dropdown */
#yearSelector {
    transition: all 0.3s ease;
    outline: none;
}
#yearSelector:hover {
    background: rgba(255,255,255,1) !important;
    border-color: var(--primary-mid) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
#yearSelector:focus {
    border-color: var(--primary-light) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Tooltip like behavior for strategy titles */
[title] {
    cursor: help;
}

/* Budget Usage Overview Card */
.budget-overview-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    padding: 28px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(30,58,138,0.08);
}

.budget-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

.budget-overview-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.budget-overview-values {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-light);
}

.budget-overview-values strong {
    color: var(--text-dark);
}

.budget-overview-percentage {
    font-size: 42px;
    font-weight: 800;
    color: var(--primary-mid);
    line-height: 1;
    letter-spacing: -0.02em;
}

.budget-progress-container {
    height: 14px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.budget-progress-bar {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 50%, #1e40af 100%);
    position: relative;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

.budget-progress-glow {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: budget-glow 2s infinite linear;
}

@keyframes budget-glow {
    0% { transform: translateX(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(300px); opacity: 0; }
}

.budget-overview-footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-pale);
    font-weight: 600;
}

.budget-overview-footer strong {
    color: var(--primary-mid);
}

/* Budget Overview Card Responsiveness */
@media (max-width: 640px) {
    .budget-overview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .budget-overview-percentage {
        font-size: 36px;
        order: -1;
    }
    
    .budget-overview-values {
        flex-direction: column;
        gap: 4px;
    }
}
