:root {
  --primary: #0b5ea8; /* deep blue */
  --accent: #00a3c4; /* teal accent */
  --bg: #ffffff; /* white background for pages */
  --card-bg: #e8ecf1; /* subtle blue-tinted gray for cards */
  --muted: #374151; /* darker muted color for improved contrast on light backgrounds */
  --text: #0b1220; /* almost-black / gunmetal text color for maximum legibility */
  --nav-bg: #072b43; /* dark navy for header */
  --radius: 8px;
}

/* Base tweaks for a tighter, dashboard-like feel */
html { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; font-size: 14px; }
body { background: var(--bg); color: var(--text); margin: 0; font-size: 14px; }

/* Navbar adjustments: use the CSS variable so we can override bootstrap bg-dark */
.navbar { padding: .45rem 1rem; background: var(--nav-bg) !important; }
.navbar-brand { font-weight: 600; font-size: 1rem; letter-spacing: .2px; color: #fff !important; }
.navbar .nav-link { color: rgba(255,255,255,0.92); padding: .35rem .6rem; }
.navbar .nav-link.text-dark { color: #fff !important; } /* navbar links stay white on dark background */

/* Dashboard container centers content and allows full width */
.dashboard-container { max-width: 100%; margin: 0 auto; padding: 0.5rem 0.75rem; }
.dashboard-main { padding-top: .25rem; padding-bottom: 2rem; }

/* Grid and cards */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 1rem; }
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(7,43,67,0.06); border: 1px solid rgba(7,43,67,0.08); padding: 0.75rem; margin-left: 0; margin-right: 0; }
.card .card-title { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; color: var(--text); }
.card .card-body { padding: 0; color: var(--muted); }

/* Normalize legacy Bootstrap utility usage to the dashboard look */
/* Convert Bootstrap background utility classes used on cards to neutral card styling */
.card.bg-secondary, .card.text-white.bg-secondary,
.card.bg-primary, .card.text-white.bg-primary {
  background: var(--card-bg) !important;
  color: var(--text) !important;
  border-color: rgba(7,43,67,0.04) !important;
}

/* Card header styling */
.card .card-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(7,43,67,0.04);
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  color: #0f172a;
  margin: -0.75rem -0.75rem 0.5rem -0.75rem;
}

/* Button palette consistent with variables */
.btn-primary { background-color: var(--primary) !important; border-color: rgba(11,94,168,0.9) !important; color: #fff !important; }
.btn-primary:hover { background-color: darken(var(--primary), 5%); }
.btn-info { background-color: var(--accent) !important; border-color: rgba(0,163,196,0.9) !important; color: #fff !important; }

/* Table compacting and subtle borders for dashboard */
table.table { background: transparent; }
table.table thead th { 
  background: #e8ecf1; /* subtle light blue-gray background for headers */
  border-bottom: 1px solid rgba(7,43,67,0.12); 
  color: var(--text); /* nearly-black text for readability */
  font-weight: 600;
}
table.table tbody td { 
  border-top: 1px solid rgba(7,43,67,0.04);
  color: var(--text); /* ensure table body text is dark */
}

/* Make form groups and labels consistent */
.form-group { margin-bottom: .6rem; }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; display: inline-block; color: var(--text); }
.form-text, .form-help, small { color: var(--muted); font-size: .875rem; }

/* Enhanced form control styling for better visibility */
.form-control { 
  padding: .4rem .6rem; 
  border-radius: 6px;
  background-color: #fff;
  border: 1.5px solid #d1d5db;
  color: var(--text);
  font-size: .875rem;
}

.form-control:focus {
  background-color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 94, 168, 0.1);
  color: var(--text);
}

.form-control::placeholder {
  color: #9ca3af;
}

/* Form select boxes */
select.form-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230b5ea8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 16px 12px;
  padding-right: 2rem;
  appearance: none;
}

/* Textarea styling */
textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Helpers for spacing consistency */
.mb-3 { margin-bottom: .75rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mr-2 { margin-right: .5rem !important; }

/* Compact tables and lists inside dashboard */
.table { margin-bottom: 0; }
table.table thead th { font-weight: 600; font-size: .875rem; }
table.table tbody td { padding: .45rem .6rem; }

/* Footer tweaks */
.footer { position: static; padding: .75rem 0; background: transparent; color: var(--muted); }

/* Utilities */
.muted { color: var(--muted); }
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }

/* Icon styling for better contrast */
i, svg, [class*="icon"] { color: inherit; }
.fa-icon, [class^="fa-"] { color: var(--text) !important; }
.small-icon { font-size: 0.875rem; color: var(--text); }

/* Override inline bisque color on table icons to use dark color */
table i[style*="bisque"] { color: #374151 !important; }
table td i, table td a i { color: #374151 !important; }
table small i { color: #374151 !important; }

/* Responsive: reduce gaps on very small screens */
@media (max-width: 576px) {
  .dashboard-grid { grid-template-columns: 1fr; gap: .5rem; }
  .navbar { padding: .35rem .5rem; }
}

/* Small helpers to emphasize numbers/stats in dashboards */
.stat { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-sub { font-size: .85rem; color: var(--muted); }
