/* ==========================================
   Águas Glenn & Tevin Design System
   Clean White Water Theme
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ---- CSS Variables ---- */
:root {
  /* Core Colors */
  --bg-body: #F4F7FB; 
  --bg-white: #FFFFFF;
  --bg-input: #F8FAFC;
  --bg-hover: #F0F9FF; /* Sky 50 */
  
  /* Primary & Accents (Water Theme) */
  --primary: #0EA5E9; /* Sky 500 */
  --primary-dark: #0284C7; /* Sky 600 */
  --primary-light: #38BDF8; /* Sky 400 */
  --primary-50: #F0F9FF;
  --primary-100: #E0F2FE;
  
  /* Semantic Colors */
  --success: #10B981; /* Emerald 500 */
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #F59E0B; /* Amber 500 */
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #EF4444; /* Red 500 */
  --danger-bg: rgba(239, 68, 68, 0.1);
  --info: #0EA5E9;
  --info-bg: rgba(14, 165, 233, 0.1);

  /* Text */
  --text-primary: #0F172A; /* Slate 900 */
  --text-secondary: #475569; /* Slate 600 */
  --text-muted: #64748B; /* Slate 500 */
  --text-white: #FFFFFF;

  /* Borders & Shadows */
  --border: #E2E8F0; /* Slate 200 */
  --border-hover: #CBD5E1; /* Slate 300 */
  --border-focus: #7DD3FC; /* Sky 300 */
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(14, 165, 233, 0.08), 0 4px 6px -4px rgba(14, 165, 233, 0.04);
  --shadow-card: 0 4px 20px rgba(14, 165, 233, 0.04);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 72px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .brand-font {
  font-family: 'Outfit', sans-serif;
}

a { 
  color: var(--primary); 
  text-decoration: none; 
  transition: var(--transition);
}
a:hover { 
  color: var(--primary-dark); 
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; border: 2px solid var(--bg-body); }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }


/* ---- Login Page ---- */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-white);
  background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 50%, #FFFFFF 100%);
  position: relative;
  overflow: hidden;
}

.login-wrapper::before, .login-wrapper::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
}

.login-wrapper::before {
  width: 500px;
  height: 500px;
  background: rgba(14, 165, 233, 0.2);
  top: -150px;
  left: -150px;
  animation: float 10s ease-in-out infinite;
}

.login-wrapper::after {
  width: 400px;
  height: 400px;
  background: rgba(56, 189, 248, 0.15);
  bottom: -100px;
  right: -100px;
  animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.login-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 10;
  box-shadow: 0 20px 40px rgba(14, 165, 233, 0.08);
}

.login-logo {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-logo .icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
  border: 1px solid var(--primary-100);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.5rem;
  color: var(--primary);
  box-shadow: 0 8px 16px rgba(14, 165, 233, 0.15);
}

.login-logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
  font-family: 'Inter', sans-serif;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-control:hover {
  border-color: var(--border-hover);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
  background: var(--bg-white);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' 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 1rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

select.form-control option {
  background: var(--bg-white);
  color: var(--text-primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-white);
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.25);
  border-color: transparent;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(14, 165, 233, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-success {
  background: var(--success);
  color: var(--text-white);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(16, 185, 129, 0.35);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-white);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: #DC2626;
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(239, 68, 68, 0.3);
}

.btn-outline {
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-50);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ---- Layout ---- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

.sidebar-logo {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  height: var(--header-height);
}

.sidebar-logo .icon {
  width: 36px;
  height: 36px;
  background: var(--primary-50);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--primary);
  flex-shrink: 0;
}

.sidebar-logo h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 1rem;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 2rem;
}

.nav-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 1rem;
  margin-bottom: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 4px;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--primary-dark);
  background: var(--primary-100);
  font-weight: 600;
}

.nav-link .nav-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  transition: var(--transition);
}

.nav-link:hover .nav-icon {
  transform: scale(1.1);
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  background: #FCFDFE;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  background: var(--primary-100);
  color: var(--primary-dark);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
}

.user-details .name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-details .role {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
.header {
  height: var(--header-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-title h1 svg {
  color: var(--primary);
}

.header-title p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ---- Page Content ---- */
.page-content {
  padding: 2rem;
  flex: 1;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FCFDFE;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header h3 svg {
  color: var(--primary);
}

.card-body {
  padding: 1.5rem 1.75rem;
}

/* ---- KPI Cards ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition-slow);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-color, var(--primary));
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  background: var(--kpi-bg, var(--primary-50));
  color: var(--kpi-color, var(--primary));
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.kpi-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-card.blue { --kpi-color: var(--primary); --kpi-bg: var(--primary-50); }
.kpi-card.green { --kpi-color: var(--success); --kpi-bg: var(--success-bg); }
.kpi-card.orange { --kpi-color: var(--warning); --kpi-bg: var(--warning-bg); }
.kpi-card.red { --kpi-color: var(--danger); --kpi-bg: var(--danger-bg); }

/* ---- Tables ---- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-white);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 1rem 1.25rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  background: #FCFDFE;
  white-space: nowrap;
}

tbody td {
  padding: 1rem 1.25rem;
  font-size: 0.95em;
  border-bottom: 1px solid #F1F5F9;
  color: var(--text-secondary);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: var(--transition);
  background: var(--bg-white);
}

tbody tr:hover {
  background: var(--bg-hover);
}

td strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* ---- Status Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-slow);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.95) translateY(10px);
  transition: var(--transition-slow);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FCFDFE;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--danger);
}

.modal-body {
  padding: 1.75rem 2rem;
}

.modal-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  background: #F8FAFC;
}

/* ---- Alerts ---- */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }

/* ---- Search ---- */
.search-box {
  position: relative;
}

.search-box input {
  padding-left: 2.75rem !important;
}

.search-box .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
}

/* ---- Toolbar ---- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---- Charts ---- */
.chart-container {
  position: relative;
  height: 300px;
  padding: 1rem 0;
}

/* ---- Grid Layouts ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
  color: var(--border-hover);
}

/* ---- Toast Notification ---- */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 300px;
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-warning { border-left: 4px solid var(--warning); }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---- Responsive ---- */

/* Mobile menu button - hidden on desktop, shown on mobile */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.menu-toggle:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

@media (max-width: 768px) {
  /* Show hamburger menu */
  .menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Hide sidebar off-screen by default */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 260px;
    z-index: 1100 !important; /* Always above overlay (1050) */
  }

  /* Slide sidebar in when open */
  .sidebar.open {
    transform: translateX(0);
  }

  /* Remove left margin since sidebar is now overlaid */
  .main-content {
    margin-left: 0 !important;
  }

  /* Tighter page padding */
  .page-content {
    padding: 1rem;
  }

  /* Header slimmer */
  .header {
    padding: 0 1rem;
    height: 60px;
  }
  .header-title h1 {
    font-size: 1.1rem;
  }
  .header-title p {
    font-size: 0.75rem;
  }
  .header-actions {
    display: none; /* Hide date/extras on mobile header */
  }

  /* Stack KPI cards */
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  /* Stack grids */
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  /* Form rows stack */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Toolbar: stack vertically */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .toolbar-left, .toolbar-right {
    justify-content: stretch;
    flex-wrap: wrap;
  }
  .toolbar-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .toolbar-right .btn {
    font-size: 0.8rem;
    padding: 0.6rem 0.75rem;
  }

  /* Tables smaller text */
  thead th {
    padding: 0.75rem 0.8rem;
    font-size: 0.7rem;
  }
  tbody td {
    padding: 0.75rem 0.8rem;
    font-size: 0.85rem;
  }

  /* Login responsive */
  .login-card {
    margin: 1rem;
    padding: 2rem 1.25rem;
  }

  /* Modals full-width on mobile */
  .modal {
    max-width: calc(100vw - 2rem);
    max-height: 90vh;
    margin: 1rem;
  }

  /* Welcome header */
  .welcome-header h2 {
    font-size: 1.3rem;
  }

  /* KPI cards compact */
  .kpi-card {
    padding: 1rem;
  }
  .kpi-value {
    font-size: 1.3rem;
  }
  .kpi-label {
    font-size: 0.75rem;
  }
  .kpi-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  /* Card body tighter */
  .card-body {
    padding: 1rem;
  }

  /* Toast smaller on mobile */
  .toast-container {
    right: 0.75rem;
    left: 0.75rem;
    top: 0.75rem;
  }
  .toast {
    min-width: auto;
  }
}

/* Extra small screens (< 480px) */
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .toolbar-right {
    grid-template-columns: 1fr;
  }
  .header-title h1 {
    font-size: 1rem;
  }
}

/* ---- Utility ---- */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ---- Welcome Header ---- */
.welcome-header { margin-bottom: 2rem; }
.welcome-header h2 { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); }
.welcome-header p { color: var(--text-secondary); font-size: 0.95rem; margin-top: 0.25rem; }

/* ---- SVG Icon Alignment ---- */
h1 svg, h3 svg, .btn svg, .nav-icon svg, .kpi-icon svg, .toast-icon svg, .search-icon svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
h1 svg { margin-right: 0.5rem; vertical-align: -0.1em; }
h3 svg { margin-right: 0.5rem; vertical-align: -0.1em; }
.btn svg { vertical-align: -0.1em; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; }
.toast-icon { display: inline-flex; align-items: center; flex-shrink: 0; }

.toast.toast-success .toast-icon { color: var(--success); }
.toast.toast-error .toast-icon { color: var(--danger); }
.toast.toast-warning .toast-icon { color: var(--warning); }

.sidebar-logo .icon svg { color: var(--primary); }
.login-logo .icon svg { color: var(--primary); }

/* Table inputs */
table input.form-control {
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  background: var(--bg-white);
  border-color: var(--border);
}
table input.form-control:focus {
  background: var(--bg-white);
}

