/* AXD Advisory Services — Internal Portal
   Brand: Deep Slate #1C2B3A | Electric Teal #00C2B3
   Theme: Dark sidebar + Light main content
   Font: DM Sans (body) + DM Mono (labels/data)
*/

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,300&family=DM+Mono:wght@300;400;500&display=swap');

:root {
  /* Brand */
  --deep-slate: #1C2B3A;
  --slate-800: #243347;
  --slate-700: #2d3f52;
  --slate-600: #3d526a;
  --slate-500: #546882;
  --teal: #00C2B3;
  --teal-dark: #0a8c80;
  --teal-dim: rgba(0,194,179,0.1);
  --teal-border: rgba(0,194,179,0.3);
  --white: #FFFFFF;

  /* Main content — light */
  --page-bg: #F2F5F7;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --border: #E2E8ED;
  --border-mid: #D0D8DF;

  /* Typography — light context */
  --text-primary: #1C2B3A;
  --text-secondary: #4A5568;
  --text-muted: #8fa3b2;

  /* Semantic */
  --danger: #d94f4f;
  --warning: #e09427;
  --success: #00C2B3;

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 60px;
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s ease;
  --shadow-sm: 0 1px 4px rgba(28,43,58,0.07);
  --shadow: 0 2px 12px rgba(28,43,58,0.1);
  --shadow-teal: 0 4px 16px rgba(0,194,179,0.2);
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--page-bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ─── SIDEBAR (stays dark — brand anchor) ────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--deep-slate);
  border-right: none;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-hex {
  width: 32px; height: 32px;
  flex-shrink: 0;
}

.brand-text { flex: 1; }
.brand-text .brand-axd {
  font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -0.5px; line-height: 1.1;
}
.brand-text .brand-sub {
  font-size: 9px; font-weight: 400; color: var(--teal); letter-spacing: 0.12em; text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px; font-weight: 500;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 14px 18px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  color: rgba(255,255,255,0.95);
  background: rgba(255,255,255,0.06);
  border-left-color: rgba(255,255,255,0.3);
}

.nav-item.active {
  color: var(--teal);
  background: rgba(0,194,179,0.1);
  border-left-color: var(--teal);
  font-weight: 500;
}

.nav-item .nav-icon {
  width: 16px; height: 16px;
  opacity: 0.75;
  flex-shrink: 0;
}
.nav-item.active .nav-icon { opacity: 1; }

.nav-item .nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.45);
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 500;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}
.sidebar-footer .version {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.05em;
}

/* ─── MAIN CONTENT ───────────────────────────────────── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--page-bg);
}

.topbar {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.topbar-breadcrumb a:hover { color: var(--text-secondary); }
.topbar-breadcrumb .sep { opacity: 0.4; }
.topbar-breadcrumb .current { color: var(--text-primary); font-weight: 500; }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-date {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.page-content {
  flex: 1;
  padding: 28px;
  max-width: 1200px;
}

/* ─── PAGE HEADER ────────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
}
.page-header .page-tag {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--teal-dark);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--deep-slate);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.page-header p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ─── CARDS & SURFACES ───────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card-sm { padding: 16px; }
.card-lg { padding: 28px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.card-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card.teal-border { border-top: 2px solid var(--teal); }
.card.elevated { background: var(--surface); box-shadow: var(--shadow); }

/* ─── GRID LAYOUTS ───────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }

/* ─── STAT TILES ─────────────────────────────────────── */
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--teal);
  opacity: 0;
  transition: var(--transition);
}
.stat-tile:hover::before { opacity: 1; }
.stat-tile .label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.stat-tile .value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
}
.stat-tile .value.teal { color: var(--teal); }
.stat-tile .delta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ─── BUTTONS ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--teal);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { background: #00d9c8; box-shadow: var(--shadow-teal); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-dim); }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(217,79,79,0.25);
}
.btn-danger:hover { background: rgba(217,79,79,0.06); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }
.btn-icon { padding: 8px; border-radius: 6px; }

/* ─── FORMS ──────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 9px 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select option { background: var(--surface); color: var(--text-primary); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ─── TABLES ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr {
  border-bottom: 1px solid var(--border);
  background: #FAFBFC;
}
thead th {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 14px;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
tbody tr:hover { background: #F8FAFB; }
tbody td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-primary);
}
.td-mono {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
}
.td-amount {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.td-teal { color: var(--teal-dark); font-weight: 600; }

/* ─── BADGES & TAGS ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.badge-teal { background: var(--teal-dim); color: var(--teal-dark); border: 1px solid var(--teal-border); }
.badge-gray { background: #F2F5F7; color: var(--text-secondary); border: 1px solid var(--border); }
.badge-warning { background: rgba(224,148,39,0.1); color: var(--warning); border: 1px solid rgba(224,148,39,0.25); }
.badge-danger { background: rgba(217,79,79,0.08); color: var(--danger); border: 1px solid rgba(217,79,79,0.2); }
.badge-coming { background: #F2F5F7; color: var(--text-muted); border: 1px solid var(--border); }

/* ─── DIVIDERS & UTILITIES ───────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
.teal-rule { height: 2px; background: linear-gradient(90deg, var(--teal) 0%, transparent 100%); margin: 22px 0; opacity: 0.4; }
.spacer-8 { height: 8px; }
.spacer-16 { height: 16px; }
.spacer-24 { height: 24px; }
.text-teal { color: var(--teal-dark); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-white { color: var(--white); }
.text-mono { font-family: 'DM Mono', monospace; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.fw-600 { font-weight: 600; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-auto { margin-top: auto; }

/* ─── PLACEHOLDER / COMING SOON ──────────────────────── */
.placeholder-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-lg);
  text-align: center;
  gap: 12px;
  background: var(--surface);
}
.placeholder-block .ph-icon {
  width: 40px; height: 40px;
  opacity: 0.2;
  color: var(--text-primary);
}
.placeholder-block .ph-title {
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
}
.placeholder-block .ph-sub {
  font-size: 12px; color: var(--text-muted); max-width: 300px;
}

/* ─── NOTIFICATION TOAST ─────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--deep-slate);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--teal);
  z-index: 999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translateY(0); }

/* ─── SCROLLBAR ──────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ─── ANIMATIONS ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease both; }
.fade-up-1 { animation-delay: 0.05s; }
.fade-up-2 { animation-delay: 0.1s; }
.fade-up-3 { animation-delay: 0.15s; }
.fade-up-4 { animation-delay: 0.2s; }
.fade-up-5 { animation-delay: 0.25s; }

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

/* ─── SECTION 508 / WCAG 2.1 AA ACCESSIBILITY ──────────── */

/* Skip navigation link */
.skip-nav {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--teal);
  color: #fff;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
}
.skip-nav:focus { top: 0; }

/* Visible focus indicators for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Sidebar nav focus */
.nav-item:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

/* Adjusted muted text to meet WCAG AA 4.5:1 on white */
.text-muted, .card-subtitle, .page-header p { color: #5a6e7f; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ATOM logo nav icon — active state brightness */
.nav-item img.nav-icon { opacity: 0.65; filter: none; transition: var(--transition); }
.nav-item:hover img.nav-icon { opacity: 0.85; }
.nav-item.active img.nav-icon { opacity: 1; filter: hue-rotate(0deg) saturate(1.2) brightness(1.1); }
