/* ===================================================
   Audit — CSS Design System v2.0
   =================================================== */
:root {
  --bg: #0c0e15;
  --bg-2: #12141e;
  --bg-3: #1a1e2c;
  --sidebar-bg: #0a0c13;
  --surface: #1a1e2c;
  --surface-2: #232838;
  --border: #2a2f45;
  --blue: #4b8cf7;
  --blue-dim: rgba(75,140,247,0.13);
  --green: #2dd4bf;
  --green-dim: rgba(45,212,191,0.11);
  --red: #f2637a;
  --red-dim: rgba(242,99,122,0.11);
  --amber: #f6ad4d;
  --amber-dim: rgba(246,173,77,0.11);
  --purple: #9b6dfa;
  --text: #eaedf7;
  --text-muted: #8992b3;
  --text-faint: #545d7d;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 8px 32px rgba(2,4,16,0.55), 0 1px 0 rgba(255,255,255,0.03) inset;
  --shadow-glow: 0 0 0 1px rgba(75,140,247,0.08), 0 12px 40px rgba(6,10,30,0.5);
  --glass: rgba(255,255,255,0.035);
  --divider: rgba(44,49,71,0.4);
  --topbar-bg: rgba(18,20,30,0.72);
  --transition: all 0.22s cubic-bezier(.2,.9,.2,1);
  --sidebar-w: 280px;
  color-scheme: dark;
}

/* ===== Light theme (opt-in via the topbar toggle; dark stays default) ===== */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-2: #ffffff;
  --bg-3: #eef1f7;
  --sidebar-bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --border: #e1e5ef;
  --divider: rgba(15,23,42,0.08);
  --topbar-bg: rgba(255,255,255,0.75);
  --blue: #2563eb;
  --blue-dim: rgba(37,99,235,0.10);
  --green: #0d9488;
  --green-dim: rgba(13,148,136,0.10);
  --red: #dc2626;
  --red-dim: rgba(220,38,38,0.10);
  --amber: #b45309;
  --amber-dim: rgba(180,83,9,0.12);
  --purple: #7c3aed;
  --text: #161a2b;
  --text-muted: #5b6478;
  --text-faint: #98a0b3;
  --shadow: 0 8px 28px rgba(15,23,42,0.10), 0 1px 0 rgba(255,255,255,0.6) inset;
  --shadow-glow: 0 0 0 1px rgba(37,99,235,0.10), 0 12px 36px rgba(15,23,42,0.12);
  --glass: rgba(15,23,42,0.03);
}

/* -------- Base -------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }
html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(1100px 620px at 14% -8%, rgba(75,140,247,0.10), transparent 60%),
    radial-gradient(900px 560px at 100% 0%, rgba(155,109,250,0.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
h1 { font-family: 'Outfit', sans-serif; letter-spacing: -0.01em; }
h3 { font-weight: 600; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }
::selection { background: rgba(75,140,247,0.32); color: #fff; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* -------- Layout -------- */
body { display: flex; min-height: 100vh; overflow: hidden; }

/* -------- Sidebar -------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.28s var(--transition);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}
.brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(75,140,247,0.35), 0 1px 0 rgba(255,255,255,0.25) inset;
}
.brand-icon svg { width: 20px; height: 20px; }
.brand-name { display: block; font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1.08rem; color: var(--text); letter-spacing: -0.01em; }
.brand-sub { display: block; font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 1rem 0.625rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.25rem; }
.nav-section-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); padding: 0.25rem 0.5rem; margin-top: 0.25rem; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-link:hover { background: var(--bg-3); color: var(--text); }
.nav-link.active {
  background: linear-gradient(90deg, rgba(75,140,247,0.14), rgba(155,109,250,0.08));
  color: var(--text);
  border: 1px solid rgba(75,140,247,0.25);
  box-shadow: 0 6px 18px rgba(11,22,50,0.3), 0 0 0 1px rgba(75,140,247,0.05) inset;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: -0.625rem;
  top: 0.2rem;
  bottom: 0.2rem;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--blue), var(--purple));
}
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 100px;
  padding: 0.1em 0.45em;
}

.sidebar-footer { padding: 0.75rem; border-top: 1px solid var(--border); }
.current-user { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem; border-radius: var(--radius-sm); background: var(--bg-3); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--purple)); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-name { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.user-role { font-size: 0.65rem; color: var(--text-muted); }

/* -------- Main wrapper -------- */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
/* -------- Topbar -------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 58px;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.menu-toggle { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0.25rem; display: flex; border-radius: 6px; transition: var(--transition); }
.menu-toggle svg { width: 20px; height: 20px; }
.menu-toggle:hover { color: var(--text); background: var(--bg-3); }
.breadcrumb { font-size: 0.88rem; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.topbar-right { display: flex; align-items: center; gap: 0.875rem; }

.role-switcher { display: flex; align-items: center; gap: 0.5rem; }
.role-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }
.role-select { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 0.35rem 0.7rem; cursor: pointer; transition: var(--transition); }
.role-select:hover { border-color: var(--text-faint); }
.role-select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }

.notif-btn { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; padding: 0.45rem 0.55rem; display: flex; align-items: center; transition: var(--transition); }
.notif-btn svg { width: 18px; height: 18px; }
.notif-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); }
.notif-count { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: 0.6rem; font-weight: 700; border-radius: 100px; min-width: 16px; padding: 0 3px; text-align: center; box-shadow: 0 0 0 2px var(--bg-2); }

/* -------- Content Area -------- */
.content-area { flex: 1; overflow-y: auto; padding: 2rem 2rem; scroll-behavior: smooth; background: linear-gradient(180deg, rgba(255,255,255,0.01), transparent); }

/* -------- Tab Panes -------- */
.tab-pane { display: none; animation: fadeUp 0.3s ease; }
.tab-pane.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px) scale(0.995); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.page-header { margin-bottom: 1.75rem; }
.page-header h1 { font-size: 1.7rem; font-weight: 700; color: var(--text); }
.page-header p { color: var(--text-muted); margin-top: 0.25rem; font-size: 0.875rem; }

/* -------- KPI Cards -------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.kpi-card {
  position: relative;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  border: 1px solid transparent;
  transition: var(--transition);
  background: linear-gradient(165deg, rgba(255,255,255,0.025), rgba(255,255,255,0.00) 55%);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: 0 20px 44px rgba(3,10,35,0.55); }
.kpi-blue  { background: linear-gradient(165deg, var(--blue-dim), rgba(75,140,247,0.02) 60%);  border-color: rgba(75,140,247,0.22); }
.kpi-red   { background: linear-gradient(165deg, var(--red-dim), rgba(242,99,122,0.02) 60%);   border-color: rgba(242,99,122,0.22); }
.kpi-green { background: linear-gradient(165deg, var(--green-dim), rgba(45,212,191,0.02) 60%); border-color: rgba(45,212,191,0.22); }
.kpi-amber { background: linear-gradient(165deg, var(--amber-dim), rgba(246,173,77,0.02) 60%); border-color: rgba(246,173,77,0.22); }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-blue  .kpi-icon { background: rgba(75,140,247,0.18);  color: var(--blue);  box-shadow: 0 0 0 1px rgba(75,140,247,0.15) inset; }
.kpi-red   .kpi-icon { background: rgba(242,99,122,0.18);  color: var(--red);   box-shadow: 0 0 0 1px rgba(242,99,122,0.15) inset; }
.kpi-green .kpi-icon { background: rgba(45,212,191,0.18);  color: var(--green); box-shadow: 0 0 0 1px rgba(45,212,191,0.15) inset; }
.kpi-amber .kpi-icon { background: rgba(246,173,77,0.18);  color: var(--amber); box-shadow: 0 0 0 1px rgba(246,173,77,0.15) inset; }
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-val { font-size: 1.85rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi-blue  .kpi-val { color: var(--blue); }
.kpi-red   .kpi-val { color: var(--red); }
.kpi-green .kpi-val { color: var(--green); }
.kpi-amber .kpi-val { color: var(--amber); }
.kpi-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

/* -------- Dashboard Grid -------- */
.dashboard-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; margin-bottom: 1.5rem; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; transition: var(--transition); }
.dash-card:hover { transform: translateY(-6px); box-shadow: 0 18px 36px rgba(3,10,35,0.45); }
.dash-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.dash-card-header h3 { font-size: 0.9rem; color: var(--text); }
.badge-note { font-size: 0.65rem; color: var(--amber); background: var(--amber-dim); padding: 0.2rem 0.5rem; border-radius: 100px; }
.chart-area { min-height: 160px; }

/* Gauge */
.gauge-wrapper { position: relative; display: flex; align-items: center; justify-content: center; margin: 1rem 0; }
.gauge-svg { width: 120px; height: 120px; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: var(--border); stroke-width: 12; }
.gauge-fill { fill: none; stroke: var(--green); stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray 0.8s ease; }
.gauge-center { position: absolute; text-align: center; }
.gauge-pct { font-size: 1.4rem; font-weight: 700; color: var(--green); }
.gauge-sub { font-size: 0.65rem; color: var(--text-muted); }
.gauge-legend { display: flex; justify-content: center; align-items: center; gap: 0.25rem; font-size: 0.7rem; color: var(--text-muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Chart Bars */
.chart-bar-group { display: flex; align-items: flex-end; gap: 0.625rem; height: 120px; margin-top: 0.5rem; }
.chart-bar-col { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; flex: 1; }
.chart-bar { width: 100%; border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.6s ease; box-shadow: inset 0 -6px 16px rgba(0,0,0,0.25); }
.chart-bar-label { font-size: 0.6rem; color: var(--text-muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60px; }
.chart-bar-val { font-size: 0.7rem; font-weight: 700; color: var(--text); }

/* Upcoming */
.upcoming-list { display: flex; flex-direction: column; gap: 0.5rem; }
.upcoming-item { background: var(--bg-3); border-radius: var(--radius-sm); padding: 0.625rem 0.875rem; display: flex; align-items: center; gap: 0.75rem; border: 1px solid rgba(255,255,255,0.02); }
.upcoming-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }
.upcoming-info { flex: 1; }
.upcoming-proj { font-size: 0.8rem; font-weight: 600; }
.upcoming-date { font-size: 0.68rem; color: var(--text-muted); }

/* -------- Section Card -------- */
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-card-header { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.section-card-header h3 { font-size: 0.92rem; letter-spacing: -0.005em; }

/* -------- Tables -------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 0.8rem 1rem; text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; background: rgba(255,255,255,0.015); }
.data-table td { padding: 0.8rem 1rem; font-size: 0.82rem; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: rgba(75,140,247,0.045); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Status badges */
.status-badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.6rem; border-radius: 100px; font-size: 0.7rem; font-weight: 600; }
.status-open    { background: var(--red-dim);   color: var(--red);   }
.status-closed  { background: var(--green-dim); color: var(--green); }
.status-pending { background: var(--amber-dim); color: var(--amber); }
.status-inprog  { background: var(--blue-dim);  color: var(--blue);  }
.type-nc   { background: rgba(240,82,82,0.15);   color: var(--red);   padding: 0.1rem 0.5rem; border-radius: 4px; font-size: 0.68rem; font-weight: 700; }
.type-obs  { background: rgba(249,194,79,0.15);  color: var(--amber); padding: 0.1rem 0.5rem; border-radius: 4px; font-size: 0.68rem; font-weight: 700; }
.type-ofi  { background: rgba(79,142,247,0.15);  color: var(--blue);  padding: 0.1rem 0.5rem; border-radius: 4px; font-size: 0.68rem; font-weight: 700; }

/* -------- Forms -------- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; box-shadow: 0 10px 30px rgba(2,6,23,0.45); }
.form-section-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--blue); font-weight: 700; margin: 1.25rem 0 0.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }
.form-section-title:first-child { margin-top: 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.form-input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.6rem 0.875rem;
  transition: var(--transition);
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }
.form-input::placeholder { color: rgba(228,232,245,0.45); }
.form-input[readonly], .form-input[disabled] { opacity: 0.6; cursor: not-allowed; }
textarea.form-input { resize: vertical; min-height: 80px; }
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-3) inset;
  box-shadow: 0 0 0 1000px var(--bg-3) inset;
  caret-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
}
.form-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* Autocomplete */
.autocomplete-wrap { position: relative; }
.required-star { color: #dc2626 !important; font-weight: 800; margin-left: 2px; }
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 200;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.autocomplete-dropdown.open { display: block; }
.ac-item { padding: 0.5rem 0.875rem; cursor: pointer; font-size: 0.82rem; }
.ac-item:hover { background: var(--blue-dim); color: var(--blue); }

/* Tag input (multi-add auditor / auditee) */
.tag-input-row { display: flex; align-items: stretch; gap: 0.5rem; }
.tag-input-row .tag-input-box { flex: 1; min-width: 0; }
.tag-input-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
}
.tag-input-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }
.tag-input-box.disabled {
  opacity: 0.75;
  background-color: var(--surface-2);
  cursor: not-allowed;
}
.tag-input-box.disabled .tag-remove {
  display: none !important;
}
.tag-chip { display: inline-flex; align-items: center; gap: 0.3rem; background: var(--blue-dim); color: var(--blue); border-radius: 100px; padding: 0.2rem 0.3rem 0.2rem 0.6rem; font-size: 0.78rem; font-weight: 600; }
.tag-chip-email { background: var(--green-dim); color: var(--green); }
.tag-remove { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 0.95rem; line-height: 1; padding: 0 0.2rem; }
.tag-remove:hover { color: var(--red); }
.tag-input-field { flex: 1; min-width: 120px; border: none; background: transparent; color: var(--text); padding: 0.2rem; outline: none; }
.tag-input-field::placeholder { color: rgba(228,232,245,0.45); }
.tag-input-field:-webkit-autofill,
.tag-input-field:-webkit-autofill:hover,
.tag-input-field:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-3) inset;
  box-shadow: 0 0 0 1000px var(--bg-3) inset;
  caret-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary { background: linear-gradient(90deg, var(--blue), var(--purple)); color: #fff; box-shadow: 0 8px 22px rgba(75,140,247,0.28), 0 1px 0 rgba(255,255,255,0.18) inset; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(75,140,247,0.32), 0 1px 0 rgba(255,255,255,0.18) inset; }
.btn-danger { background: var(--red); color: #fff; box-shadow: 0 8px 20px rgba(242,99,122,0.22); }
.btn-danger:hover { background: #e0546b; transform: translateY(-2px); }
.btn-success { background: linear-gradient(90deg, var(--green), #34d7b0); color: #062022; box-shadow: 0 8px 20px rgba(45,212,191,0.2); }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(45,212,191,0.24); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-3); color: var(--text); border-color: var(--text-faint); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }
.btn-edit,
.btn.btn-edit,
.btn.btn-edit:visited,
.btn.btn-edit:focus,
.excel-action-btn.btn-edit { background: #2563eb !important; color: #ffffff !important; border: 1px solid #2563eb !important; }
.btn-edit:hover,
.btn.btn-edit:hover,
.excel-action-btn.btn-edit:hover { background: #1d4ed8 !important; color: #ffffff !important; border-color: #1d4ed8 !important; transform: translateY(-1px); }
.plan-confirmation { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin: 0 1.25rem 1.25rem; padding: 0.9rem 1rem; background: var(--blue-dim); border: 1px solid rgba(75,140,247,0.4); border-radius: var(--radius-sm); }
.plan-confirmation span { color: var(--text-muted); font-size: 0.82rem; }
.plan-confirmation .form-actions { margin-left: auto; padding: 0; }

/* Inline "Add" button beside a tag-input box (Auditor/Auditee fields) */
.btn-tag-add {
  flex-shrink: 0;
  align-self: stretch;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(75,140,247,0.35);
  white-space: nowrap;
}
.btn-tag-add svg { width: 13px; height: 13px; }
.btn-tag-add:hover { background: var(--blue); color: #fff; border-color: var(--blue); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(75,140,247,0.28); }
.btn-tag-add:active { transform: translateY(0) scale(0.97); }
.btn-amber { background: var(--amber); color: #1a1206; box-shadow: 0 8px 20px rgba(246,173,77,0.22); }
.btn-amber:hover { background: #f8bd6b; transform: translateY(-2px); }

/* -------- Checklist -------- */
.checklist-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.checklist-domain-header { background: var(--bg-3); padding: 0.75rem 1.25rem; display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
.domain-icon { width: 26px; height: 26px; border-radius: 6px; background: var(--blue-dim); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 800; flex-shrink: 0; }
.checklist-item { padding: 1rem 1.25rem; border-bottom: 1px solid var(--divider); }
.checklist-item:last-child { border-bottom: none; }
.clause-header { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; }
.clause-id { background: var(--surface-2); color: var(--blue); border-radius: 4px; padding: 0.1rem 0.4rem; font-size: 0.68rem; font-weight: 700; white-space: nowrap; flex-shrink: 0; margin-top: 0.1rem; }
.clause-title { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.clause-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }
.clause-controls { display: block; width: 100%; margin-top: 0.5rem; }
.finding-type-group { display: none; }
.checklist-finding-inputs { display: flex; gap: 0.75rem; align-items: flex-start; max-width: 650px; }
.checklist-finding-inputs .finding-remark-area { flex: 1; min-width: 240px; width: auto; max-width: none; }
.finding-remark-area { display: block; width: 25%; min-width: 260px; max-width: 420px; }
.finding-remark-area textarea.form-input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.55);
  background: rgba(239, 246, 255, 0.35);
  color: var(--text);
  font-size: 0.82rem;
  padding: 0.55rem 0.85rem;
  resize: vertical;
  min-height: 48px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.finding-remark-area textarea.form-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  background: var(--surface);
}
.type-note { background: var(--green-dim); color: var(--green); padding: 0.1rem 0.5rem; border-radius: 4px; font-size: 0.68rem; font-weight: 700; }
.stage-badge { display: inline-flex; align-items: center; padding: 0.15rem 0.55rem; border-radius: 100px; font-size: 0.66rem; font-weight: 700; background: var(--surface-2); color: var(--text-muted); }

/* Additional (ad hoc) finding rows */
.addl-finding-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 3fr auto;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--divider);
}
.addl-finding-row:last-child {
  border-bottom: none;
}
.addl-finding-row .addl-col {
  display: flex;
  flex-direction: column;
}
.addl-finding-row label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}
.addl-finding-row .addl-label-spacer {
  visibility: hidden;
  user-select: none;
}
.addl-finding-row select.form-input {
  height: 42px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.4;
}
.addl-finding-row textarea.addl-desc {
  min-height: 42px;
  height: 42px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.4;
  resize: vertical;
}
.addl-finding-row textarea.addl-desc:focus {
  min-height: 72px;
}
.addl-finding-row .addl-remove-btn {
  height: 42px;
  padding: 0 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Alerts (findings/CAP guidance) */
.alert { padding: 1rem 1.1rem; margin-bottom: 1.25rem; border-radius: 8px; border-left: 4px solid; font-size: 0.82rem; line-height: 1.6; }
.alert-info { background: var(--blue-dim); border-left-color: var(--blue); color: var(--text); }
.alert-warning { background: var(--amber-dim); border-left-color: var(--amber); color: var(--text); }

/* Evidence upload card (Action Items) */
.evidence-upload-card { background: var(--surface); border: 1px solid rgba(245,158,11,0.3); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.evidence-countdown { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 100px; }
.evidence-countdown.ok { background: var(--green-dim); color: var(--green); }
.evidence-countdown.warn { background: var(--red-dim); color: var(--red); }
.evidence-dropzone { border: 2px dashed rgba(79, 142, 247, 0.4); background: rgba(79, 142, 247, 0.04); border-radius: var(--radius); padding: 1.25rem 1rem; text-align: center; cursor: pointer; transition: all 0.2s ease; }
.evidence-dropzone:hover, .evidence-dropzone.dragover { border-color: var(--blue); background: rgba(79, 142, 247, 0.1); }
.evidence-file-chip { display: flex; align-items: center; justify-content: space-between; background: var(--bg-3); border: 1px solid var(--border); border-radius: 6px; padding: 0.65rem 0.85rem; margin-top: 0.6rem; }

/* Audit Meta Banner */
.audit-meta-banner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; background: var(--blue-dim); border: 1px solid rgba(79,142,247,0.3); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.meta-item span { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--blue); margin-bottom: 0.2rem; }
.meta-item strong { font-size: 0.82rem; color: var(--text); }

/* -------- Action Items -------- */
.action-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; transition: var(--transition); }
.action-card:hover { transform: translateY(-6px); box-shadow: 0 18px 36px rgba(3,10,35,0.45); }
.action-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.875rem; }
.action-id-block { display: flex; align-items: center; gap: 0.5rem; }
.finding-id-tag { font-size: 0.7rem; font-weight: 700; background: var(--bg-3); padding: 0.2rem 0.5rem; border-radius: 4px; color: var(--text-muted); }
.action-clause { font-size: 0.8rem; font-weight: 600; }
.action-meta { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.625rem; }
.action-desc { font-size: 0.82rem; color: var(--text); background: var(--bg-3); border-radius: 6px; padding: 0.625rem 0.875rem; margin-bottom: 0.875rem; }
.action-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* -------- Verification -------- */
.verify-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.verify-col {}
.col-heading { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text); margin-bottom: 1rem; }
.col-heading.warn { color: var(--amber); }
.verify-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; transition: var(--transition); }
.verify-card:hover { transform: translateY(-6px); box-shadow: 0 18px 36px rgba(3,10,35,0.45); }
.verify-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.finding-detail-row { display: flex; gap: 1.5rem; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.625rem; flex-wrap: wrap; }
.evidence-preview { background: var(--green-dim); border: 1px solid rgba(62,207,142,0.25); border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.75rem; color: var(--green); margin-bottom: 0.75rem; }
.verify-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 0.5rem; align-items: end; }
.nc-warning-card { background: var(--red-dim); border: 1px solid rgba(240,82,82,0.2); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 0.75rem; }
.nc-warning-head { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 0.5rem; }
.nc-warning-id { font-size: 0.75rem; font-weight: 700; color: var(--red); }
.nc-warning-clause { font-size: 0.8rem; font-weight: 600; }
.nc-days-badge { background: var(--red); color: #fff; padding: 0.15rem 0.5rem; border-radius: 100px; font-size: 0.68rem; font-weight: 700; margin-left: auto; }

/* -------- Email Mock -------- */
.email-mock { background: var(--bg-3); border-radius: var(--radius-sm); padding: 1.25rem; font-size: 0.8rem; line-height: 1.7; }

/* -------- Notification Drawer -------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 300; display: none; }
.drawer-overlay.open { display: block; }
.notif-drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 380px; background: var(--bg-2); border-left: 1px solid var(--border); z-index: 301; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s ease; }
.notif-drawer.open { transform: translateX(0); }
.drawer-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.drawer-head h3 { font-size: 0.95rem; }
.drawer-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.5rem; line-height: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.625rem; }
.notif-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.875rem; cursor: pointer; transition: var(--transition); }
.notif-item:hover { border-color: var(--blue); }
.notif-item.unread { border-left: 3px solid var(--blue); }
.notif-subject { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; }
.notif-date { font-size: 0.68rem; color: var(--text-muted); }

/* -------- Modal -------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1200; display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.open,
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] { display: flex !important; }
.modal-box { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; width: 580px; max-width: 95vw; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal-head { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 0.95rem; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.5rem; line-height: 1; }
.modal-body { padding: 1.5rem; flex: 1; overflow-y: auto; }
.email-meta-row { display: flex; gap: 1rem; align-items: baseline; padding: 0.4rem 0; border-bottom: 1px solid var(--divider); font-size: 0.8rem; }
.email-meta-row span:first-child { min-width: 60px; color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; }
.email-body-content { margin-top: 1rem; font-size: 0.83rem; line-height: 1.8; color: var(--text); }
.modal-foot { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

/* -------- Toast -------- */
#toastContainer { position: fixed; bottom: 1.5rem; right: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 500; }
.toast { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem 1.1rem; font-size: 0.82rem; min-width: 260px; display: flex; align-items: center; gap: 0.625rem; box-shadow: var(--shadow); animation: slideIn 0.25s ease; }
.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-error   { border-left: 3px solid var(--red); }
.toast.toast-warning { border-left: 3px solid var(--amber); }
.toast.toast-info    { border-left: 3px solid var(--blue); }
.toast.hide { animation: slideOut 0.3s ease forwards; }
@keyframes slideIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* -------- Misc -------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); font-size: 0.85rem; }
.empty-state svg { width: 40px; height: 40px; opacity: 0.4; margin-bottom: 0.75rem; display: block; margin-inline: auto; }

/* -------- Google Calendar Timing Widget -------- */
.gcal-timing-widget {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 0.5rem 0.25rem;
  margin-bottom: 0.5rem;
}
.gcal-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gcal-field-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.gcal-pills-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gcal-icon-col {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-top: 0.5rem;
  flex-shrink: 0;
}
.gcal-icon-col svg {
  width: 18px;
  height: 18px;
}
.gcal-fields-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.gcal-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.gcal-pill-container {
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  overflow: hidden;
}
.gcal-pill-container:hover {
  border-color: var(--blue);
  background: var(--bg-3);
}
.gcal-pill-display {
  padding: 0.5rem 0.875rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  display: inline-block;
  pointer-events: none;
}
.gcal-hidden-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.gcal-dash {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0 0.125rem;
}
.gcal-tz-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1rem;
}
.gcal-tz-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: var(--transition);
}
.gcal-tz-btn:hover {
  background: var(--blue-dim);
}
.gcal-tz-display {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.gcal-tz-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 150;
  display: none;
  flex-direction: column;
  min-width: 260px;
  padding: 0.25rem 0;
}
.gcal-tz-dropdown.open {
  display: flex;
}
.gcal-tz-option {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}
.gcal-tz-option:hover {
  background: var(--blue-dim);
  color: var(--blue);
}
/* Responsive */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .verify-split { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { width: 240px; transform: translateX(0); }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .audit-meta-banner { grid-template-columns: 1fr 1fr; }
}

/* =============================================
   STL DIGITAL INTERNAL AUDIT SCHEDULE SHEET
   ============================================= */
.gcal-excel-sheet {
  background: #ffffff;
  color: #1f2937;
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  overflow-x: auto;
  border: 1px solid #d1d5db;
  margin-top: 1rem;
}

.excel-grid {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', -apple-system, sans-serif;
  color: #111827;
  border: 2px solid #000000;
  background-color: #ffffff;
}

.excel-cell {
  border: 1px solid #4b5563;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  vertical-align: middle;
}

.excel-logo-cell {
  background-color: #ffffff;
  border-bottom: 2px solid #000000;
  vertical-align: middle;
}

.excel-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.stl-logo-stl {
  color: #0c4a6e; /* Deep Navy */
}

.stl-logo-digital {
  color: #0284c7; /* Vibrant Blue */
}

.excel-title-cell {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #000000;
  border-bottom: 2px solid #000000;
}

.excel-bg-dim {
  background-color: #f3f4f6; /* Dim gray background typical of Excel */
}

.excel-label-cell {
  background-color: #f3f4f6;
  font-weight: 700;
  width: 180px;
  border: 1px solid #4b5563;
}

.excel-val-cell {
  background-color: #ffffff;
  border: 1px solid #4b5563;
}

.excel-sub-header {
  background-color: #f3f4f6;
}

.excel-sub-header td {
  border: 1px solid #4b5563;
  padding: 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #374151;
  text-align: center;
}

/* Row Session Row Cell styles */
.excel-row-cell {
  border: 1px solid #4b5563;
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
}

.excel-row-sl {
  text-align: center;
  font-weight: bold;
}

.excel-row-dept {
  font-weight: 600;
  color: #111827;
}

.excel-row-date, .excel-row-time {
  text-align: center;
}

.excel-row-refs {
  font-size: 0.78rem;
  color: #4b5563;
  font-family: monospace;
}

/* Action block inside cell */
.excel-actions-wrap {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.excel-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  width: 26px;
  height: 26px;
  cursor: pointer;
  transition: var(--transition);
}

.excel-action-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
}

.excel-action-btn.btn-sync {
  width: auto;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  gap: 2px;
}

.excel-action-btn.btn-sync:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
}

.excel-action-btn.btn-synced {
  border-color: var(--green);
  color: #ffffff;
  background: var(--green);
  pointer-events: none;
  width: auto;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Utils */
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-xs { font-size: 0.75rem; }

/* Print Mode Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .sidebar, .topbar, .page-header, .schedule-actions, .hide-print, .drawer-overlay, .notif-drawer, .modal-overlay, #toastContainer {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
  .content-area {
    padding: 0 !important;
    margin: 0 !important;
  }
  .gcal-excel-sheet {
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    overflow-x: visible !important;
  }
  .excel-grid {
    border: 2px solid #000000 !important;
  }
  .excel-cell, .excel-sub-header td, .excel-row-cell {
    border: 1px solid #000000 !important;
    color: #000000 !important;
  }
  .excel-bg-dim, .excel-sub-header, .excel-label-cell {
    background-color: #f3f4f6 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .excel-actions-wrap {
    display: none !important;
  }
}

/* ===== LOGIN GATE ===== */
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 500px at 50% 0%, rgba(75,140,247,0.16), transparent 60%),
    radial-gradient(700px 500px at 90% 100%, rgba(155,109,250,0.12), transparent 55%),
    var(--bg);
}
body.authenticated .login-gate { display: none; }
body:not(.authenticated) .sidebar,
body:not(.authenticated) .main-wrapper { display: none; }
.login-gate-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent), var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2.75rem 2.25rem;
  width: 340px;
  text-align: center;
  box-shadow: var(--shadow-glow);
  animation: gateIn 0.4s cubic-bezier(.2,.9,.2,1);
}
@keyframes gateIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-gate-card .brand-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin: 0 auto 1.25rem;
  box-shadow: 0 8px 28px rgba(75,140,247,0.4), 0 1px 0 rgba(255,255,255,0.25) inset;
}
.login-gate-card .brand-icon svg { width: 30px; height: 30px; }
.login-gate-card h2 { font-family: 'Outfit', sans-serif; font-size: 1.4rem; letter-spacing: -0.01em; }
.login-gate-error {
  color: var(--red);
  font-size: 0.8rem;
  margin: 1rem 0 0;
}

/* ===== DRAFT CONFIRMATION & PREVIEW STYLES ===== */
.draft-summary-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

.draft-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.draft-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.draft-summary-item span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.draft-summary-item strong {
  font-size: 0.88rem;
  color: var(--text);
}

.email-schedule-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.82rem;
  border: 1px solid var(--border);
}

.email-schedule-table th,
.email-schedule-table td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
}

.email-schedule-table th {
  background: var(--surface-2);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.email-schedule-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* Master Data UI */
.master-dept-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease;
}

.master-dept-row:hover {
  border-color: var(--border-hover);
}

.master-vert-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.master-vert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.master-proj-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: var(--bg-2);
  border-radius: 4px;
  font-size: 0.82rem;
}

.badge-lifecycle {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-lifecycle-na {
  background: rgba(107, 114, 128, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(107, 114, 128, 0.25);
}

/* Schedule Email Status Indicators (Non-clickable Badges) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  user-select: none;
  cursor: default;
}

.status-pill-unsent {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-pill-sent {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.btn-reschedule {
  background: var(--blue, #2563eb) !important;
  color: #fff !important;
  border: 1px solid rgba(37, 99, 235, 0.5) !important;
}

.btn-notified-done {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  cursor: not-allowed !important;
  opacity: 0.85;
}

.form-input:disabled,
select.form-input:disabled,
input:disabled {
  background-color: var(--bg-3, #f3f4f6) !important;
  color: var(--text-muted, #6b7280) !important;
  cursor: not-allowed !important;
  border-color: var(--border, #e5e7eb) !important;
  opacity: 0.9;
}



