/* ============================================================================
   CSIDS Design System — "Aegis Command"
   Generated from Google Stitch · Sentinel Ethos design language
   Naval-grade interface for cybersecurity compliance operations.
   Dark-first, tonal layering, editorial authority.

   Design principles:
   • Tonal layering over borders (surface hierarchy, not 1px lines)
   • Asymmetric white space (critical data gets more breathing room)
   • Editorial command (Manrope headlines, Inter body)
   • Ghost borders only where accessibility requires them
   ============================================================================ */

/* --- Google Fonts + Material Symbols --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

/* --- Design Tokens (CSS Custom Properties) --- */
:root {
  /* Typography */
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', ui-monospace, monospace;

  /* Legacy accent alias */
  --accent: #afc8f0;
  --accent-hover: #d4e3ff;

  /* Surface borders — ghost borders at 15% outline-variant */
  --surface-border: rgba(67, 71, 78, 0.15);
  --ghost-border: rgba(67, 71, 78, 0.15);

  /* Transition defaults */
  --transition-fast: 0.15s ease;
  --transition-med: 0.25s ease;
}

/* Light mode overrides */
html:not(.dark) {
  --surface-border: #e2e8f0;
  --ghost-border: rgba(0, 0, 0, 0.06);
}


/* ===== GLOBAL TYPOGRAPHY ===== */

body,
input,
select,
textarea,
button {
  font-family: var(--font-body) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .font-display {
  font-family: var(--font-display) !important;
}

code, pre, .font-mono {
  font-family: var(--font-mono) !important;
}

body {
  font-size: 0.875rem !important;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em !important;
}


/* ===== CUI BANNERS ===== */

#cui-banner-top,
#cui-banner-bottom {
  background: linear-gradient(90deg, #15803d 0%, #0f5c2c 50%, #15803d 100%) !important;
  border-color: #0a4a20 !important;
  padding-top: 0.2rem !important;
  padding-bottom: 0.2rem !important;
}

#cui-banner-top > div,
#cui-banner-bottom > div {
  font-family: var(--font-display) !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.35em !important;
  font-weight: 900 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1.2 !important;
}


/* ===== MATERIAL SYMBOLS ===== */

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}


/* ===== LEFT SIDEBAR NAVIGATION ===== */

#sidebar-nav {
  background: #050810 !important;
  border-right: 1px solid rgba(175, 200, 240, 0.05);
}

html:not(.dark) #sidebar-nav {
  background: #0f172a !important;
}

#sidebar-nav .nav-item {
  transition: all var(--transition-fast);
}

#sidebar-nav .nav-item:hover {
  background: rgba(175, 200, 240, 0.06);
}

#sidebar-nav .nav-item.active {
  background: rgba(175, 200, 240, 0.10);
  color: #afc8f0;
}

/* Sidebar logo */
#sidebar-nav img[alt="CSIDS"] {
  height: 40px !important;
  width: 40px !important;
  object-fit: contain;
}


/* ===== SLIM TOP HEADER BAR ===== */

#top-header {
  background: rgba(10, 14, 20, 0.80) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(175, 200, 240, 0.05);
}

html:not(.dark) #top-header {
  background: rgba(255, 255, 255, 0.90) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0 !important;
}

/* Legacy: keep #top-nav styles for any remaining references */
#top-nav {
  background: linear-gradient(180deg, #0a0e14 0%, #10141a 100%) !important;
  border-bottom: 1px solid var(--ghost-border) !important;
  backdrop-filter: blur(12px);
}

html:not(.dark) #top-nav {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

/* Logo sizing */
#top-nav img[alt="CSIDS"] {
  height: 64px !important;
  width: 64px !important;
  max-height: 64px !important;
  object-fit: contain;
  margin-top: -4px !important;
  margin-bottom: -4px !important;
}

#top-nav a[href] {
  transition: all var(--transition-fast) !important;
}

/* Mobile nav panel */
#mobile-nav-panel {
  background: #0a0e14 !important;
  border-bottom: 1px solid var(--ghost-border) !important;
}

html:not(.dark) #mobile-nav-panel {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05) !important;
}


/* ===== CARDS — Tonal Layering ===== */
/* Per Stitch design doc: avoid 1px borders, use surface hierarchy instead.
   Ghost borders only where accessibility requires visible edges. */

.shadow.rounded-lg,
.rounded-xl,
.rounded-2xl {
  border: 1px solid var(--ghost-border) !important;
  box-shadow: none !important;
  border-radius: 0.75rem !important;
}

.dark .shadow.rounded-lg,
.dark .rounded-xl,
.dark .rounded-2xl {
  border-color: rgba(175, 200, 240, 0.06) !important;
  box-shadow: none !important;
}

/* Elevated cards (modals, dropdowns, hovered) get ambient shadow */
.shadow-lg,
[role="dialog"],
.dropdown-menu {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
}


/* ===== DATA TABLES ===== */

table {
  font-variant-numeric: tabular-nums;
}

table thead th {
  font-family: var(--font-body) !important;
  font-size: 0.67rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase;
  padding-top: 0.55rem !important;
  padding-bottom: 0.55rem !important;
  border-bottom: 2px solid var(--ghost-border) !important;
}

.dark table thead th {
  border-bottom-color: rgba(175, 200, 240, 0.08) !important;
}

table thead.bg-gray-50 {
  background-color: #f1f5f9 !important;
}

.dark table thead.bg-gray-50,
.dark table thead.bg-gray-700 {
  background-color: #0a0e14 !important;
}

table tbody td {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

table tbody tr {
  transition: background-color 0.1s ease;
}

/* Alternating row tint */
table tbody tr:nth-child(even) {
  background-color: rgba(0,0,0,0.012);
}

.dark table tbody tr:nth-child(even) {
  background-color: rgba(175, 200, 240, 0.015);
}

/* Row hover — primary tint */
table tbody tr:hover {
  background-color: rgba(175, 200, 240, 0.05) !important;
}

.dark table tbody tr:hover {
  background-color: rgba(175, 200, 240, 0.08) !important;
}


/* ===== STATUS BADGES — Tactical Chips ===== */
/* 10% opacity background, 100% opacity text */

span.rounded-full.text-xs {
  font-family: var(--font-body) !important;
  font-size: 0.64rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  padding: 0.15rem 0.6rem !important;
}


/* ===== FORM INPUTS — Minimalist ===== */

input[type="text"],
input[type="date"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
select:not([multiple]),
textarea {
  border-radius: 0.5rem !important;
  font-size: 0.875rem !important;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.dark input[type="text"],
.dark input[type="date"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="search"],
.dark input[type="number"],
.dark select:not([multiple]),
.dark textarea {
  background-color: #262a31 !important;
  border-color: rgba(175, 200, 240, 0.08) !important;
  color: #dfe2eb !important;
}

input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 2px rgba(175, 200, 240, 0.25) !important;
}


/* ===== BUTTONS — Command Actions ===== */

/* Primary CTA — gradient command */
.bg-navy,
.bg-slate-900,
button[type="submit"]:not(.bg-green-600):not(.bg-red-600) {
  background: linear-gradient(135deg, #afc8f0, #001f3f) !important;
  color: #dfe2eb !important;
  transition: all var(--transition-fast) !important;
  border: none !important;
}

.bg-navy:hover,
.bg-slate-900:hover,
button[type="submit"]:not(.bg-green-600):not(.bg-red-600):hover {
  box-shadow: 0 0 20px rgba(175, 200, 240, 0.15) !important;
  transform: translateY(-0.5px);
}

.bg-navy:active,
.bg-slate-900:active,
button[type="submit"]:not(.bg-green-600):not(.bg-red-600):active {
  transform: translateY(0);
  box-shadow: none !important;
}

/* Secondary button — ghost border */
.bg-white.border,
.dark .bg-gray-700.border {
  background: transparent !important;
  border: 1px solid rgba(67, 71, 78, 0.15) !important;
  transition: all var(--transition-fast) !important;
}

.bg-white.border:hover,
.dark .bg-gray-700.border:hover {
  background: rgba(175, 200, 240, 0.08) !important;
}

/* Green action buttons */
.bg-green-600 {
  transition: all var(--transition-fast) !important;
}

.bg-green-600:hover {
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.2) !important;
  transform: translateY(-0.5px);
}


/* ===== LINKS — Primary accent ===== */

a.text-navy,
a.text-blue-400 {
  color: #afc8f0 !important;
  transition: color 0.1s ease;
}

a.text-navy:hover,
a.text-blue-400:hover {
  color: #d4e3ff !important;
}


/* ===== SEARCH INPUT ===== */

header input[type="text"][placeholder*="Search"] {
  transition: width var(--transition-med), box-shadow var(--transition-fast) !important;
}

header input[type="text"][placeholder*="Search"]:focus {
  width: 280px !important;
}


/* ===== SCROLLBARS (Webkit) ===== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.22);
}

.dark ::-webkit-scrollbar-thumb {
  background: rgba(175, 200, 240, 0.08);
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(175, 200, 240, 0.15);
}

#sidebar::-webkit-scrollbar-thumb,
#sidebar nav::-webkit-scrollbar-thumb {
  background: rgba(175, 200, 240, 0.04);
}


/* ===== TEXT SELECTION — Primary tint ===== */

::selection {
  background: rgba(175, 200, 240, 0.25);
  color: inherit;
}


/* ===== FOCUS RING ===== */

*:focus-visible {
  outline: 2px solid #afc8f0 !important;
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none !important;
}


/* ===== PROGRESS BARS & GAUGES ===== */
/* Thick-to-thin stroke, per Stitch design doc */

progress,
.progress-bar {
  border-radius: 999px;
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background: #31353c;
  border-radius: 999px;
}

progress::-webkit-progress-value {
  border-radius: 999px;
  transition: width 0.5s ease;
}


/* ===== GLASSMORPHISM — Panels & modals ===== */

.glass,
.glass-panel {
  background: rgba(28, 32, 38, 0.70) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

html:not(.dark) .glass,
html:not(.dark) .glass-panel {
  background: rgba(255, 255, 255, 0.85) !important;
}


/* ===== RADIAL GAUGES — SVG circular score rings ===== */

.radial-gauge-glow {
  filter: drop-shadow(0 0 12px rgba(175, 200, 240, 0.3));
}

/* Animated gauge fill on page load */
.gauge-animate {
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Radial gradient background for main content (Stitch design) */
.bg-aegis-radial {
  background: radial-gradient(circle at top right, rgba(0, 31, 63, 0.20), #10141a 60%, #10141a);
}

html:not(.dark) .bg-aegis-radial {
  background: radial-gradient(circle at top right, rgba(175, 200, 240, 0.08), #f3f4f6 60%, #f3f4f6);
}


/* ===== PRINT ===== */

@media print {
  #sidebar-nav,
  #top-header,
  #sidebar,
  header,
  #cui-banner-top,
  #cui-banner-bottom,
  #bulk-action-bar {
    display: none !important;
  }

  body { font-size: 11px !important; }
  .md\:pl-64 { padding-left: 0 !important; }
  .md\:ml-64 { margin-left: 0 !important; }
}


/* ===== MISC POLISH ===== */

a[href*="/poams/"] {
  font-variant-numeric: tabular-nums;
}

/* Smooth page transitions */
main {
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0.85; }
  to { opacity: 1; }
}
