/* =========================================================
   Seifert Dynamics — Readiness Platform
   App stylesheet
   ========================================================= */

/* === DESIGN TOKENS === */
:root {
  /* Base backgrounds */
  --bg:              #050506;
  --bg-2:            #07090d;
  --bg-3:            #0c1018;
  --surface:         #10151e;
  --surface-soft:    #141a26;
  --surface-card:    #181f2c;
  --surface-card-alt:#1c2534;

  /* Borders */
  --border:          rgba(255, 255, 255, 0.09);
  --border-strong:   rgba(180, 200, 230, 0.30);

  /* Text */
  --text:            #f0f3f8;
  --text-soft:       #ccd4e0;
  --text-muted:      #889aac;

  /* Brand accent */
  --accent:          #b8c9df;
  --accent-strong:   #d8e6f5;

  /* Semantic status colors */
  --green:           #6ee7a0;
  --green-bg:        rgba(78, 190, 130, 0.14);
  --green-border:    rgba(110, 231, 160, 0.38);

  --amber:           #fcd27a;
  --amber-bg:        rgba(252, 180, 60, 0.13);
  --amber-border:    rgba(252, 210, 122, 0.40);

  --red:             #f98d97;
  --red-bg:          rgba(240, 80, 95, 0.14);
  --red-border:      rgba(249, 141, 151, 0.40);

  --blue:            #82b4f0;
  --blue-bg:         rgba(96, 160, 240, 0.13);
  --blue-border:     rgba(130, 180, 240, 0.38);

  /* Shadows */
  --shadow-soft:     0 12px 40px rgba(0, 0, 0, 0.44);
  --shadow-card:     0 2px 14px rgba(0, 0, 0, 0.30);

  /* Radii — hard-edge brand (0) */
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;

  /* Fonts */
  --font-body:    "Red Hat Text", "Segoe UI", Arial, sans-serif;
  --font-display: "Source Serif 4", Georgia, serif;
  --font-mono:    Consolas, "SFMono-Regular", Menlo, monospace;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  background:
    radial-gradient(1000px 600px at 108% -8%,  rgba(130, 160, 210, 0.11), transparent 62%),
    radial-gradient(900px 560px at -8% 108%,   rgba(75, 110, 160, 0.09),  transparent 66%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.5;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: #e8f2ff; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

p { margin: 0; }
ul { margin: 0; }

code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #ecf2fa;
  background: rgba(140, 165, 200, 0.14);
  border: 1px solid rgba(178, 198, 228, 0.26);
  padding: 0.1rem 0.32rem;
}


/* =========================================================
   AUTH PAGES
   ========================================================= */
.auth-body {
  background:
    radial-gradient(900px 500px at 90% -10%, rgba(120, 150, 196, 0.14), transparent 60%),
    radial-gradient(760px 440px at 0% 100%,  rgba(68, 100, 148, 0.14),  transparent 60%),
    linear-gradient(180deg, #050607 0%, #090c12 100%);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 460px) minmax(340px, 520px);
  gap: 2rem;
  align-items: start;
  align-content: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.auth-brand {
  border: 1px solid var(--border);
  padding: clamp(1.2rem, 2.4vw, 2rem);
  background: linear-gradient(165deg, rgba(22, 27, 34, 0.92) 0%, rgba(12, 15, 20, 0.95) 100%);
  box-shadow: var(--shadow-soft);
}

.auth-brand-eyebrow {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

.auth-brand-logo {
  width: min(220px, 100%);
  height: auto;
  margin-bottom: 0.9rem;
  opacity: 0.96;
}

.auth-brand h1 { font-size: clamp(1.8rem, 3.8vw, 2.5rem); }

.auth-brand-subtitle {
  margin-top: 0.3rem;
  color: var(--accent-strong);
  font-size: 0.94rem;
}

.auth-brand-copy {
  margin-top: 1rem;
  color: var(--text-soft);
  line-height: 1.68;
  font-size: 0.93rem;
  max-width: 42ch;
}

.auth-panel-wrap { display: grid; gap: 0.85rem; }

.auth-panel {
  border: 1px solid var(--border);
  background: linear-gradient(170deg, rgba(19, 24, 32, 0.97) 0%, rgba(11, 14, 20, 0.98) 100%);
  padding: clamp(1.2rem, 2.8vw, 2rem);
  box-shadow: var(--shadow-soft);
}

.auth-footnote {
  color: var(--text-muted);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.classification-tag {
  margin-top: 0.9rem;
  border: 1px solid rgba(177, 197, 225, 0.38);
  padding: 0.3rem 0.6rem;
  display: inline-flex;
  width: fit-content;
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #d4e0f1;
  background: rgba(56, 75, 104, 0.24);
}


/* =========================================================
   FORMS
   ========================================================= */
.form-grid { display: grid; gap: 0.95rem; }

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.form-field {
  display: grid;
  gap: 0.4rem;
}

.form-field label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 500;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  color: var(--text);
  background: rgba(12, 16, 22, 0.98);
  border: 1px solid var(--border-strong);
  padding: 0.68rem 0.78rem;
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field textarea {
  min-height: 100px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: rgba(190, 212, 240, 0.68);
  box-shadow: 0 0 0 3px rgba(120, 152, 192, 0.18);
}

.form-field input[disabled],
.form-field select[disabled],
.form-field textarea[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.18rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}


/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(176, 196, 224, 0.38);
  background: linear-gradient(180deg, rgba(32, 42, 56, 0.96), rgba(20, 28, 38, 0.97));
  color: #edf2f9;
  font-size: 0.77rem;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 500;
  padding: 0.62rem 1rem;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.12s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(46, 58, 76, 0.98), rgba(28, 38, 52, 0.98));
  border-color: rgba(196, 216, 244, 0.50);
}

.btn:active { transform: translateY(0); }

.btn-primary {
  border-color: rgba(180, 200, 232, 0.50);
  background: linear-gradient(180deg, rgba(40, 60, 92, 0.96), rgba(26, 42, 68, 0.97));
}

.btn-primary:hover {
  background: linear-gradient(180deg, rgba(52, 76, 112, 0.98), rgba(34, 54, 84, 0.98));
}

.btn-secondary, .btn-ghost {
  background: transparent;
  border-color: rgba(160, 180, 210, 0.28);
}

.btn-secondary:hover, .btn-ghost:hover {
  background: rgba(120, 145, 180, 0.15);
  border-color: rgba(180, 200, 228, 0.40);
}

.btn-danger {
  border-color: rgba(240, 120, 130, 0.55);
  background: linear-gradient(180deg, rgba(120, 38, 50, 0.94), rgba(88, 26, 36, 0.96));
  color: #ffe6e9;
}

.btn-danger:hover {
  background: linear-gradient(180deg, rgba(145, 50, 64, 0.97), rgba(108, 34, 46, 0.98));
  border-color: rgba(250, 140, 150, 0.68);
}

.btn-success {
  border-color: rgba(100, 220, 140, 0.45);
  background: linear-gradient(180deg, rgba(30, 100, 62, 0.94), rgba(20, 72, 44, 0.96));
  color: #d8f7e8;
}

.btn-success:hover {
  background: linear-gradient(180deg, rgba(38, 120, 74, 0.97), rgba(26, 88, 54, 0.98));
}

.btn-sm {
  font-size: 0.71rem;
  padding: 0.42rem 0.7rem;
}

.link-inline {
  font-size: 0.82rem;
  color: var(--accent-strong);
  transition: color 0.15s ease;
}

.link-inline:hover { color: #e8f3ff; text-decoration: underline; }


/* =========================================================
   ALERTS & NOTICES
   ========================================================= */
@keyframes alertIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert {
  border: 1px solid;
  padding: 0.72rem 0.88rem;
  font-size: 0.84rem;
  line-height: 1.5;
  animation: alertIn 0.2s ease;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.alert-dismiss {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.alert-dismiss:hover { opacity: 1; }

.alert-danger {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: #fceef0;
}

.alert-success {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: #e4f9ef;
}

.alert-warning {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: #fdf3da;
}

.alert-info {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  color: #e4f0fc;
}

.notice {
  border: 1px solid rgba(175, 195, 220, 0.30);
  background: rgba(28, 36, 50, 0.56);
  color: var(--text-soft);
  padding: 0.82rem 0.95rem;
  font-size: 0.86rem;
  line-height: 1.62;
}

.notice-warning {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: #fdf3da;
}

.notice-danger {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: #fceef0;
}


/* =========================================================
   APP SHELL (sidebar + main)
   ========================================================= */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

/* Sidebar */
.app-sidebar {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: linear-gradient(175deg, rgba(13, 16, 22, 0.99) 0%, rgba(8, 10, 14, 1) 100%);
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Scrollbar in sidebar */
.app-sidebar::-webkit-scrollbar { width: 4px; }
.app-sidebar::-webkit-scrollbar-track { background: transparent; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(160, 180, 210, 0.25); }

.sidebar-brand {
  border: 1px solid rgba(168, 185, 210, 0.22);
  padding: 0.82rem 0.78rem;
  background: rgba(18, 24, 33, 0.72);
  margin-bottom: 0.8rem;
}

.sidebar-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.42rem;
}

.brand-logo {
  width: min(180px, 100%);
  display: block;
  height: auto;
}

.sidebar-subtext {
  margin-top: 0.55rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 0.78rem;
}

/* Sidebar nav */
.sidebar-nav { margin-top: 0.6rem; }

.sidebar-nav + .sidebar-nav {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sidebar-nav-label {
  font-size: 0.61rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 0 0 0.45rem;
  padding-left: 0.22rem;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.22rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-soft);
  padding: 0.56rem 0.68rem;
  border: 1px solid transparent;
  font-size: 0.83rem;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.sidebar-nav a svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.is-active {
  color: #f2f6ff;
  border-color: rgba(170, 192, 222, 0.36);
  background: rgba(60, 82, 114, 0.24);
}

.sidebar-nav a:hover svg,
.sidebar-nav a.is-active svg {
  opacity: 1;
}

.sidebar-nav a.is-active {
  border-color: rgba(180, 204, 236, 0.44);
  background: rgba(72, 96, 132, 0.28);
  font-weight: 500;
}

.sidebar-nav-admin .sidebar-nav-label {
  color: var(--amber);
  opacity: 0.8;
}

.sidebar-nav-admin a.is-active {
  border-color: rgba(252, 210, 122, 0.40);
  background: rgba(110, 80, 20, 0.22);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.25rem;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.68rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s;
}

.sidebar-footer a svg { width: 14px; height: 14px; opacity: 0.7; }

.sidebar-footer a:hover {
  color: var(--text-soft);
  background: rgba(80, 100, 130, 0.18);
}

/* Main area */
.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.app-topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(9, 11, 16, 0.92);
  backdrop-filter: blur(8px);
  padding: 0.78rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-soft);
  padding: 0.44rem 0.6rem;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-toggle:hover { background: rgba(100, 125, 165, 0.18); }

.topbar-left { display: flex; align-items: center; gap: 0.75rem; }

.topbar-title-wrap h2 { font-size: 1.18rem; }
.topbar-title-wrap p {
  margin-top: 0.14rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-meta { display: grid; gap: 0.06rem; text-align: right; }
.user-meta strong { font-size: 0.81rem; }
.user-meta span { font-size: 0.72rem; color: var(--text-muted); }

.user-role-badge {
  border: 1px solid var(--border-strong);
  padding: 0.2rem 0.46rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #dce8f8;
  background: rgba(58, 78, 108, 0.32);
}

/* Content area */
.app-content {
  padding: 1.1rem 1.2rem 1.4rem;
  display: grid;
  gap: 0.95rem;
}


/* =========================================================
   BREADCRUMB
   ========================================================= */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--accent-strong); }
.breadcrumb-sep { opacity: 0.45; font-size: 0.68rem; }
.breadcrumb-current { color: var(--text-soft); }


/* =========================================================
   PAGE CARDS
   ========================================================= */
.page-card {
  border: 1px solid var(--border);
  padding: 1rem 1.05rem;
  background: linear-gradient(170deg, rgba(20, 27, 38, 0.86), rgba(12, 16, 24, 0.90));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.card-header-text { flex: 1 1 0; min-width: 0; }
.card-header-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.page-section-title { font-size: 1.04rem; }
.page-section-title + .page-lead { margin-top: 0.3rem; }

.page-lead {
  color: var(--text-soft);
  font-size: 0.88rem;
  margin-bottom: 0.8rem;
  line-height: 1.6;
}


/* =========================================================
   KPI GRID
   ========================================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.72rem;
}

.kpi-card {
  border: 1px solid rgba(168, 188, 214, 0.28);
  padding: 0.88rem 0.92rem;
  background: linear-gradient(180deg, rgba(28, 36, 50, 0.90), rgba(18, 24, 35, 0.93));
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: rgba(168, 192, 228, 0.35);
}

.kpi-card-green::before  { background: var(--green); }
.kpi-card-amber::before  { background: var(--amber); }
.kpi-card-red::before    { background: var(--red); }
.kpi-card-blue::before   { background: var(--blue); }

.kpi-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-size: 0.62rem;
  font-weight: 500;
}

.kpi-value {
  margin-top: 0.46rem;
  font-family: var(--font-display);
  font-size: 1.56rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.kpi-sub {
  margin-top: 0.18rem;
  font-size: 0.73rem;
  color: var(--text-muted);
}


/* =========================================================
   TWO-COLUMN GRID
   ========================================================= */
.grid-2 {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}


/* =========================================================
   TABLE
   ========================================================= */
.table-wrap {
  border: 1px solid rgba(162, 182, 210, 0.24);
  overflow: auto;
  background: rgba(9, 12, 18, 0.84);
}

table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid rgba(108, 136, 178, 0.20);
  font-size: 0.81rem;
  line-height: 1.46;
}

th {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-muted);
  background: rgba(22, 30, 42, 0.90);
  position: sticky;
  top: 0;
  z-index: 1;
  font-family: var(--font-body);
  font-weight: 500;
  white-space: nowrap;
}

tbody tr { transition: background 0.12s ease; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(68, 88, 118, 0.16); }

td.td-muted { color: var(--text-muted); font-size: 0.76rem; }
td small { display: block; color: var(--text-muted); font-size: 0.74rem; margin-top: 0.18rem; }


/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid;
  padding: 0.16rem 0.46rem;
  font-size: 0.61rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  font-weight: 500;
}

/* Status: active / resolved */
.badge-status-active,
.badge-status-resolved {
  color: var(--green);
  border-color: var(--green-border);
  background: var(--green-bg);
}

/* Status: open, investigating, in_review, new */
.badge-status-open,
.badge-status-investigating,
.badge-status-new,
.badge-status-in_review,
.badge-status-deferred {
  color: var(--amber);
  border-color: var(--amber-border);
  background: var(--amber-bg);
}

/* Status: inactive, suspended, expired, rejected, closed */
.badge-status-inactive,
.badge-status-suspended,
.badge-status-expired,
.badge-status-rejected,
.badge-status-closed {
  color: var(--red);
  border-color: var(--red-border);
  background: var(--red-bg);
}

/* Status: approved */
.badge-status-approved {
  color: var(--blue);
  border-color: var(--blue-border);
  background: var(--blue-bg);
}

/* Severity */
.badge-severity-low {
  color: #a0e8b8;
  border-color: rgba(100, 200, 140, 0.45);
  background: rgba(40, 110, 70, 0.28);
}

.badge-severity-medium {
  color: var(--amber);
  border-color: var(--amber-border);
  background: var(--amber-bg);
}

.badge-severity-high {
  color: #ffb08a;
  border-color: rgba(240, 150, 100, 0.45);
  background: rgba(140, 60, 20, 0.28);
}

.badge-severity-critical {
  color: var(--red);
  border-color: var(--red-border);
  background: var(--red-bg);
}

/* Roles */
.badge-role-platform_admin {
  color: var(--amber);
  border-color: var(--amber-border);
  background: var(--amber-bg);
}

.badge-role-company_admin {
  color: var(--blue);
  border-color: var(--blue-border);
  background: var(--blue-bg);
}

.badge-role-standard_user {
  color: var(--text-soft);
  border-color: var(--border-strong);
  background: rgba(50, 65, 88, 0.28);
}

/* Plan badges */
.badge-plan-pilot {
  color: var(--text-muted);
  border-color: rgba(148, 165, 190, 0.38);
  background: rgba(46, 58, 78, 0.28);
}

.badge-plan-standard {
  color: var(--blue);
  border-color: var(--blue-border);
  background: var(--blue-bg);
}

.badge-plan-enterprise {
  color: var(--amber);
  border-color: var(--amber-border);
  background: var(--amber-bg);
}


/* =========================================================
   FILTERS ROW
   ========================================================= */
.filters-row {
  display: flex;
  align-items: flex-end;
  gap: 0.72rem;
  flex-wrap: wrap;
}

.filters-row .form-field { min-width: 180px; max-width: 280px; }

.filters-grid {
  display: grid;
  gap: 0.72rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.search-field {
  position: relative;
}

.search-field input { padding-left: 2rem; }

.search-field::before {
  content: '';
  position: absolute;
  left: 0.68rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238899aa' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat center / contain;
  pointer-events: none;
}


/* =========================================================
   PAGINATION
   ========================================================= */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.pagination-info { color: var(--text-muted); font-size: 0.78rem; }


/* =========================================================
   MISC UTILITIES
   ========================================================= */
.muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red   { color: var(--red); }

.fw-500 { font-weight: 500; }

.empty-state {
  border: 1px dashed rgba(168, 186, 214, 0.30);
  padding: 1.4rem 1rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.88rem;
}

.chart-wrap {
  border: 1px solid rgba(166, 184, 210, 0.26);
  background: linear-gradient(175deg, rgba(24, 32, 46, 0.86), rgba(14, 19, 28, 0.90));
  padding: 0.9rem;
  height: 320px;
  position: relative;
}

.chart-wrap canvas {
  max-height: 260px;
}

.page-card ul {
  margin-top: 0.5rem;
  padding-left: 1.1rem;
}

.page-card ul li {
  margin-bottom: 0.28rem;
  color: var(--text-soft);
  font-size: 0.86rem;
}


/* =========================================================
   DANGER ZONE
   ========================================================= */
.danger-zone {
  border: 1px solid var(--red-border);
  background: linear-gradient(170deg, rgba(36, 14, 18, 0.88), rgba(22, 8, 12, 0.92));
}

.danger-zone .page-section-title { color: var(--red); }

.danger-zone .notice {
  border-color: var(--red-border);
  background: rgba(100, 28, 36, 0.24);
  color: #fce8ea;
  margin-bottom: 0.9rem;
}


/* =========================================================
   COMPANY HEADER SUMMARY
   ========================================================= */
.company-meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.company-meta-row .badge { font-size: 0.67rem; }


/* =========================================================
   REQUEST CARD
   ========================================================= */
.request-card {
  border: 1px solid var(--border);
  padding: 0.95rem 1rem;
  background: rgba(16, 22, 32, 0.72);
  transition: border-color 0.15s ease;
}

.request-card:hover { border-color: rgba(175, 198, 230, 0.32); }

.request-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.request-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.request-card-body p {
  font-size: 0.84rem;
  color: var(--text-soft);
  line-height: 1.58;
  margin-bottom: 0.4rem;
}

.request-card-body p strong { color: var(--text); }

.request-card-form {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.request-card-form details > summary { padding: 0.1rem 0; }
.request-card-form details[open] > summary svg { transform: rotate(180deg); }
.request-card-form details > summary svg { transition: transform 0.15s; }


/* =========================================================
   AUDIT LOG ENTRY
   ========================================================= */
.audit-entry {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 0.6rem 0.9rem;
  align-items: start;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid rgba(108, 136, 178, 0.18);
  font-size: 0.8rem;
}

.audit-entry:last-child { border-bottom: none; }
.audit-entry:hover { background: rgba(60, 80, 115, 0.14); }

.audit-time { color: var(--text-muted); white-space: nowrap; }
.audit-action { font-weight: 500; }
.audit-detail { color: var(--text-muted); font-size: 0.76rem; }


/* =========================================================
   MOBILE OVERLAY BACKDROP
   ========================================================= */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 49;
  backdrop-filter: blur(2px);
}

.sidebar-backdrop.is-visible { display: block; }


/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1280px) {
  .kpi-grid    { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }

  .app-shell { grid-template-columns: 1fr; }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 50;
  }

  .app-sidebar.is-open { transform: translateX(0); }

  .sidebar-toggle { display: inline-flex; }

  .topbar-user .user-meta,
  .topbar-user .user-role-badge { display: none; }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .form-row { grid-template-columns: 1fr; }
  .filters-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .filters-row { flex-direction: column; align-items: stretch; }
  .filters-row .form-field { min-width: 0; max-width: none; }
  .audit-entry { grid-template-columns: 1fr; }
}


/* =========================================================
   PRINT
   ========================================================= */
@media print {
  .app-sidebar, .app-topbar, .form-actions, .filters-grid, .filters-row,
  .pagination, .btn, .sidebar-toggle, .classification-tag,
  .sidebar-backdrop { display: none !important; }

  .app-shell, .app-main, .app-content, .page-card, .table-wrap {
    display: block;
    background: #fff !important;
    color: #000 !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  th, td, p, h1, h2, h3, h4 {
    color: #000 !important;
    border-color: #bbb !important;
  }
}
