:root {
  --ink: #17324d;
  --muted: #71869b;
  --line: #dceaf5;
  --paper: #ffffff;
  --canvas: #edf7ff;
  --navy: #1f5f99;
  --teal: #318ccc;
  --teal-dark: #176da8;
  --mint: #dff1ff;
  --green: #40a6d8;
  --orange: #e98a3a;
  --red: #d9534f;
  --yellow: #efb94e;
  --shadow: 0 12px 35px rgba(35, 105, 160, 0.09);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.login-screen {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 75% 20%, #bfe6ff 0, #75bee9 38%, #317eb7 100%);
}
.login-screen.hidden { display: none; }
.login-card { width: min(410px, 100%); padding: 38px; border-radius: 20px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.login-brand { margin-bottom: 32px; display: flex; gap: 11px; align-items: center; color: var(--navy); font: 800 20px "Manrope"; }
.login-brand .brand-mark { width: 29px; height: 29px; }
.login-card h1 { margin: 0 0 7px; font: 800 25px "Manrope"; letter-spacing: -.7px; }
.login-copy { margin: 0 0 24px; color: var(--muted); font-size: 12px; }
.login-card form { display: grid; gap: 15px; }
.login-card label { display: grid; gap: 7px; color: #536267; font-size: 10px; font-weight: 700; }
.login-button { width: 100%; margin-top: 3px; }
.login-error { min-height: 14px; margin: -5px 0; color: var(--red); font-size: 10px; }
.login-error.success { color: var(--green); }
.login-link { padding: 3px; border: 0; color: var(--teal-dark); background: transparent; font-size: 11px; font-weight: 700; }

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: currentColor; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 240px;
  padding: 30px 20px 18px;
  display: flex;
  flex-direction: column;
  color: #cddcda;
  background: var(--navy);
  transition: transform .25s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 31px;
  color: white;
  text-decoration: none;
  font: 800 20px "Manrope", sans-serif;
  letter-spacing: -.5px;
}

.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  align-items: end;
}

.brand-mark span {
  display: block;
  border-radius: 3px 3px 1px 1px;
  background: #9bdcff;
}
.brand-mark span:nth-child(1) { height: 13px; }
.brand-mark span:nth-child(2) { height: 23px; }
.brand-mark span:nth-child(3) { height: 18px; }

.main-nav { display: grid; gap: 6px; }

.nav-item {
  position: relative;
  width: 100%;
  padding: 12px 13px;
  display: flex;
  gap: 13px;
  align-items: center;
  border: 0;
  border-radius: 9px;
  color: #afc4c1;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: .18s ease;
}

.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.14); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -20px;
  width: 3px;
  height: 23px;
  border-radius: 0 4px 4px 0;
  background: #a9e2ff;
}

.nav-count {
  margin-left: auto;
  min-width: 23px;
  padding: 2px 6px;
  border-radius: 20px;
  color: #d8f2ff;
  background: rgba(169, 226, 255, .18);
  font-size: 11px;
  text-align: center;
}
.admin-only { display: none; }
body.is-admin .admin-only { display: flex; }

.sidebar-bottom { margin-top: auto; }
.quality-score {
  margin: 20px 2px;
  padding: 14px;
  display: flex;
  gap: 11px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
}
.quality-score strong { display: block; color: white; font-size: 12px; }
.quality-score small { color: #8fa9a5; font-size: 10px; }
.score-ring {
  width: 43px;
  height: 43px;
  padding: 3px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#a9e2ff 86%, rgba(255,255,255,.14) 0);
}
.score-ring::before { content: ""; position: absolute; }
.score-ring span {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--navy);
  font-size: 9px;
  font-weight: 700;
}

.user-card {
  position: relative;
  margin-top: 10px;
  padding: 17px 8px 2px;
  display: flex;
  gap: 11px;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,.09);
}
.avatar {
  width: 35px; height: 35px; display: grid; place-items: center;
  border-radius: 9px; color: #145b8d; background: #d8f2ff;
  font-size: 11px; font-weight: 800;
}
.user-card strong { display: block; color: white; font-size: 12px; }
.user-card > div:nth-child(2) { flex: 1; }
.user-role { display: block; padding-top: 2px; color: #8fa9a5; font-size: 10px; }
.logout-btn { margin-left: auto; width: 29px; height: 29px; border: 0; border-radius: 7px; color: #afc4c1; background: rgba(255,255,255,.07); font-size: 16px; }
.role-menu {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 59px;
  display: none;
  padding: 6px;
  border-radius: 9px;
  background: white;
  box-shadow: 0 10px 35px rgba(0,0,0,.22);
}
.role-menu.open { display: grid; }
.role-menu button { padding: 8px 9px; border: 0; border-radius: 6px; color: var(--ink); background: transparent; text-align: left; font-size: 11px; }
.role-menu button:hover { background: var(--canvas); }

.main { width: calc(100% - 240px); margin-left: 240px; }
.topbar {
  height: 79px;
  padding: 0 35px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
}
.page-title p { margin: 0 0 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; }
.page-title h1 { margin: 0; font: 700 20px "Manrope", sans-serif; letter-spacing: -.4px; }
.top-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.search-box {
  width: 280px;
  height: 39px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #8a979b;
  background: #f8faf9;
}
.search-box svg { width: 17px; }
.search-box input { min-width: 0; flex: 1; padding: 0 9px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-box kbd { padding: 3px 5px; border: 1px solid #dfe4e3; border-radius: 4px; color: #9aa4a7; background: white; font: 9px "DM Sans"; }
.icon-btn { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: #607075; background: white; }
.notification-btn { position: relative; }
.notification-btn span { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border: 1px solid white; border-radius: 50%; background: var(--orange); }
.menu-btn { display: none; margin-right: 12px; }
.primary-btn, .secondary-btn {
  min-height: 39px;
  padding: 0 17px;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}
.primary-btn { color: white; background: var(--teal); box-shadow: 0 6px 15px rgba(49,140,204,.22); }
.primary-btn:hover { background: var(--teal-dark); }
.primary-btn span { margin-right: 5px; font-size: 17px; font-weight: 400; }
.secondary-btn { color: var(--ink); background: #e8f3fb; }

.content { padding: 28px 35px 45px; }
.view { display: none; animation: fade .22s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.welcome-row, .section-toolbar { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: end; }
.welcome-row h2, .section-toolbar h2 { margin: 0 0 5px; font: 700 22px "Manrope"; letter-spacing: -.6px; }
.welcome-row p, .section-toolbar p { margin: 0; color: var(--muted); font-size: 13px; }
.date-filter { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 11px; }
.date-filter button, .filter-row select {
  height: 35px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: #526167; background: white; font-size: 11px;
}
.filter-row { display: flex; gap: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card {
  min-height: 119px;
  padding: 18px;
  display: grid;
  grid-template-columns: 43px 1fr auto;
  gap: 13px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.stat-card.clickable, .trend-panel.clickable, .status-panel.clickable, .attention-note.clickable { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.stat-card.clickable:hover, .trend-panel.clickable:hover, .status-panel.clickable:hover, .attention-note.clickable:hover { transform: translateY(-2px); border-color: #a9d2ee; box-shadow: 0 16px 38px rgba(35,105,160,.14); }
.stat-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 11px; }
.stat-icon.teal { color: var(--teal); background: #e1f2ff; }
.stat-icon.orange { color: var(--orange); background: #fff0e3; }
.stat-icon.red { color: var(--red); background: #fae8e7; }
.stat-icon.green { color: var(--green); background: #e2f4e9; }
.stat-label { color: var(--muted); font-size: 11px; }
.stat-value { margin-top: 2px; display: block; font: 800 25px "Manrope"; letter-spacing: -.7px; }
.stat-meta { grid-column: 2 / 4; color: var(--muted); font-size: 10px; }
.stat-meta b { color: var(--teal); }
.stat-change { padding: 4px 6px; border-radius: 5px; color: var(--green); background: #e8f5ed; font-size: 9px; font-style: normal; font-weight: 700; }
.stat-change.bad { color: var(--red); background: #faeaea; }

.analysis-grid { margin-top: 14px; display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; }
.lower-grid { margin-top: 14px; display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; }
.panel { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: start; }
.eyebrow { margin: 0 0 3px; color: #829094; font-size: 9px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; }
.panel h3 { margin: 0; font: 700 15px "Manrope"; letter-spacing: -.25px; }
.legend { display: flex; gap: 15px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.teal { background: var(--teal); }
.dot.green { background: #7bc9ed; }
.chart-summary { margin: 18px 0 5px; display: flex; align-items: baseline; gap: 7px; }
.chart-summary strong { font: 800 25px "Manrope"; }
.chart-summary span { color: var(--muted); font-size: 10px; }
.chart-summary em { padding: 3px 6px; border-radius: 5px; color: var(--green); background: #e8f5ed; font-size: 9px; font-style: normal; font-weight: 700; }
.line-chart { height: 152px; }
.line-chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-label { fill: #9aa4a7; font: 9px "DM Sans"; }
.grid-line { stroke: #edf1ef; stroke-width: 1; stroke-dasharray: 3 4; }
.raised-line { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.closed-line { fill: none; stroke: #79c8eb; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.area-fill { fill: url(#areaGradient); opacity: .28; }

.more-btn, .text-btn { border: 0; color: #8b979b; background: transparent; }
.text-btn { color: var(--teal); font-size: 11px; font-weight: 700; }
.donut-wrap { min-height: 205px; display: flex; align-items: center; justify-content: space-around; gap: 24px; }
.donut {
  width: 138px; height: 138px; display: grid; place-items: center; border-radius: 50%;
  background: conic-gradient(var(--teal) 0 25%, var(--orange) 25% 50%, var(--yellow) 50% 75%, var(--green) 75% 100%);
}
.donut::before { content: ""; position: absolute; width: 91px; height: 91px; border-radius: 50%; background: white; }
.donut div { position: relative; z-index: 1; text-align: center; }
.donut strong { display: block; font: 800 22px "Manrope"; }
.donut span { color: var(--muted); font-size: 9px; }
.status-legend { display: grid; gap: 11px; min-width: 115px; }
.status-item { width: 100%; display: grid; grid-template-columns: 8px 1fr auto; gap: 7px; align-items: center; padding: 4px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 10px; text-align: left; }
.status-item:hover { background: var(--canvas); color: var(--ink); }
.status-item i { width: 7px; height: 7px; border-radius: 2px; }
.status-item b { color: var(--ink); font-size: 11px; }

.recent-panel { padding-bottom: 8px; }
.table-wrap { margin: 13px -20px 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 660px; }
th { padding: 9px 12px; color: #8b979b; background: #f8faf9; font-size: 9px; font-weight: 700; text-align: left; letter-spacing: .5px; text-transform: uppercase; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td { padding: 12px; border-bottom: 1px solid #edf0ef; color: #56656a; font-size: 10px; vertical-align: middle; }
tbody tr { transition: .15s ease; }
tbody tr:hover { background: #fbfcfc; }
.finding-cell { max-width: 205px; }
.finding-cell strong, .machine-cell strong { display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.finding-cell span, .machine-cell span { color: #899499; font-size: 9px; }
.severity, .status-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 5px; font-size: 9px; font-weight: 700;
}
.severity::before { content: ""; width: 5px; height: 5px; border-radius: 50%; }
.severity.Critical { color: #b23b38; background: #fae8e7; }
.severity.Critical::before { background: var(--red); }
.severity.Major { color: #bc6c29; background: #fff0e3; }
.severity.Major::before { background: var(--orange); }
.severity.Minor { color: #637b73; background: #edf2ef; }
.severity.Minor::before { background: #7c968b; }
.status-pill.Open { color: #b85f23; background: #fff0e3; }
.status-pill.In-Progress { color: #176da8; background: #e1f2ff; }
.status-pill.Pending-Review { color: #7b62a3; background: #eee9f8; }
.status-pill.Closed { color: #278552; background: #e5f4eb; }
.due-over { color: var(--red); font-weight: 700; }
.row-action { border: 0; color: var(--teal); background: transparent; font-size: 16px; }

.area-bars { margin-top: 21px; display: grid; gap: 15px; }
.area-bar-item { padding: 4px; border-radius: 7px; cursor: pointer; transition: background .15s ease; }
.area-bar-item:hover { background: var(--canvas); }
.area-bar-head { margin-bottom: 6px; display: flex; justify-content: space-between; color: #526167; font-size: 10px; }
.area-bar-head b { color: var(--ink); }
.bar-track { height: 7px; overflow: hidden; border-radius: 10px; background: #edf1ef; }
.bar-fill { height: 100%; border-radius: 10px; background: var(--teal); }
.attention-note { margin-top: 21px; padding: 12px; display: flex; gap: 10px; align-items: center; border-radius: 9px; background: #fff5e8; }
.attention-note > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: white; background: var(--orange); font-weight: 800; }
.attention-note strong { display: block; color: #8a5529; font-size: 10px; }
.attention-note p { margin: 2px 0 0; color: #a17450; font-size: 9px; }
.live-badge { display: flex; gap: 5px; align-items: center; color: var(--green); font-size: 9px; font-weight: 700; }
.live-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px #e7f5ec; }

.full-table-panel { padding-bottom: 6px; }
.findings-tools { display: flex; gap: 9px; align-items: center; }
.findings-tools .secondary-btn { min-height: 36px; white-space: nowrap; }
.active-filter { margin: -10px 0 14px; padding: 10px 13px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #bcdcf1; border-radius: 9px; color: var(--teal-dark); background: #e9f6ff; font-size: 10px; }
.active-filter[hidden] { display: none; }
.active-filter button { border: 0; color: var(--teal-dark); background: transparent; font-size: 10px; font-weight: 700; }
.full-table-panel .table-wrap { margin-top: 0; }
.compliance-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.board-column { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #e7f3fb; }
.board-head { margin: 0 2px 12px; display: flex; justify-content: space-between; align-items: center; }
.board-head h3 { margin: 0; font: 700 13px "Manrope"; }
.board-head span { padding: 3px 7px; border-radius: 20px; color: var(--teal); background: white; font-size: 9px; font-weight: 700; }
.compliance-card { margin-top: 9px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 6px 18px rgba(35,105,160,.07); }
.compliance-card .card-top { display: flex; justify-content: space-between; }
.compliance-card small { color: #8c979a; font-size: 9px; }
.compliance-card h4 { margin: 10px 0 5px; font-size: 12px; line-height: 1.4; }
.compliance-card p { margin: 0 0 12px; color: var(--muted); font-size: 10px; }
.card-footer { padding-top: 10px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); }
.assignee { display: flex; gap: 6px; align-items: center; font-size: 9px; }
.mini-avatar { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: var(--teal-dark); background: #dff1ff; font-size: 8px; font-weight: 800; }
.evidence-count { color: var(--teal); font-size: 9px; font-weight: 700; }

.machine-grid, .report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.admin-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 14px; align-items: start; }
.user-table-wrap { margin-top: 14px; }
.user-table-wrap table { min-width: 610px; }
.user-line strong { display: block; color: var(--ink); font-size: 11px; }
.user-line span { color: var(--muted); font-size: 9px; }
.role-pill { padding: 4px 7px; border-radius: 5px; color: var(--teal-dark); background: #e1f2ff; font-size: 9px; font-weight: 700; }
.status-active { color: var(--green); font-weight: 700; }
.status-inactive { color: var(--red); font-weight: 700; }
.user-actions { display: flex; gap: 5px; }
.small-btn { padding: 5px 8px; border: 0; border-radius: 6px; color: var(--teal-dark); background: #e1f2ff; font-size: 9px; font-weight: 700; }
.small-btn.danger { color: var(--red); background: #fae8e7; }
.settings-copy { margin: 15px 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.settings-form { display: grid; gap: 11px; }
.settings-form > label { display: grid; gap: 6px; color: #536267; font-size: 10px; font-weight: 700; }
.toggle-label { display: flex !important; grid-template-columns: auto 1fr; flex-direction: row; align-items: center; gap: 8px !important; }
.toggle-label input { width: auto; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; }
.machine-card, .report-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.machine-card-head { display: flex; justify-content: space-between; align-items: center; }
.machine-icon { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 10px; color: var(--teal); background: #e1f2ff; }
.health { padding: 4px 7px; border-radius: 5px; color: var(--green); background: #e5f4eb; font-size: 9px; font-weight: 700; }
.health.watch { color: var(--orange); background: #fff0e3; }
.health.risk { color: var(--red); background: #fae8e7; }
.machine-card h3, .report-card h3 { margin: 14px 0 3px; font: 700 14px "Manrope"; }
.machine-card > p, .report-card > p { margin: 0; color: var(--muted); font-size: 10px; }
.machine-stats { margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.machine-stats div { padding-top: 13px; }
.machine-stats strong { display: block; font-size: 14px; }
.machine-stats span { color: var(--muted); font-size: 9px; }
.report-card { min-height: 205px; }
.report-number { margin: 22px 0 0; font: 800 33px "Manrope"; }
.report-caption { color: var(--muted); font-size: 10px; }
.mini-bars { height: 65px; margin-top: 19px; display: flex; gap: 6px; align-items: end; }
.mini-bars i { flex: 1; border-radius: 4px 4px 1px 1px; background: #a9d9f3; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 22px; display: none; place-items: center; background: rgba(11,31,31,.55); backdrop-filter: blur(3px); }
.auth-modal-backdrop { z-index: 600; }
.modal-backdrop.open { display: grid; }
.modal { width: min(680px, 100%); max-height: calc(100vh - 44px); padding: 25px; overflow-y: auto; border-radius: 18px; background: white; box-shadow: 0 25px 70px rgba(0,0,0,.25); animation: modalIn .2s ease; }
.detail-modal { width: min(730px, 100%); }
.category-modal { width: min(520px, 100%); }
.bulk-modal { width: min(650px, 100%); }
.auth-modal { width: min(470px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: scale(.97) translateY(7px); } }
.modal-head { margin-bottom: 21px; display: flex; justify-content: space-between; }
.modal-head h2 { margin: 0; font: 700 21px "Manrope"; }
.modal-intro { margin: -9px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.close-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; color: #738087; background: #f0f3f2; font-size: 21px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid label, .action-form label { display: grid; gap: 6px; color: #536267; font-size: 10px; font-weight: 700; }
.form-note { margin: 0; padding: 10px 12px; border-radius: 8px; color: var(--teal-dark); background: #edf8ff; font-size: 10px; line-height: 1.5; }
.auth-form { display: grid; gap: 13px; }
.auth-form[hidden] { display: none; }
.auth-form label { display: grid; gap: 6px; color: #536267; font-size: 10px; font-weight: 700; }
.auth-form .primary-btn, .auth-form > .secondary-btn { min-height: 40px; }
.password-hint { margin: -3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.auth-message { min-height: 14px; margin: 0; color: var(--red); font-size: 10px; }
.auth-message.success { color: var(--green); }
.span-2 { grid-column: span 2; }
input, select, textarea {
  width: 100%; padding: 10px 11px; border: 1px solid #dfe5e3; border-radius: 8px; outline: 0; color: var(--ink); background: #fbfcfc; font-size: 12px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #72b7e4; box-shadow: 0 0 0 3px rgba(49,140,204,.11); }
.modal-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 9px; }
.category-form label { display: grid; gap: 7px; color: #536267; font-size: 10px; font-weight: 700; }
.inline-field { display: flex; gap: 8px; }
.inline-field input { flex: 1; }
.inline-field .primary-btn { white-space: nowrap; }
.category-list { margin-top: 18px; display: grid; gap: 8px; }
.category-item {
  padding: 11px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafcfa;
}
.category-item div { display: flex; gap: 9px; align-items: center; }
.category-item i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.category-item strong { display: block; font-size: 11px; }
.category-item span { color: var(--muted); font-size: 9px; }
.delete-category { width: 28px; height: 28px; border: 0; border-radius: 7px; color: var(--red); background: #fae8e7; font-size: 16px; }
.template-callout { margin-bottom: 17px; padding: 14px; display: flex; justify-content: space-between; gap: 14px; align-items: center; border: 1px solid #bcdcf1; border-radius: 10px; background: #edf8ff; }
.template-callout strong, .template-callout span { display: block; }
.template-callout strong { color: var(--teal-dark); font-size: 11px; }
.template-callout span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.bulk-file { min-height: 100px; padding: 18px; display: grid; place-items: center; border: 1px dashed #86bfe3; border-radius: 10px; color: var(--teal-dark); background: #f7fcff; font-size: 11px; font-weight: 700; cursor: pointer; }
.bulk-file input { max-width: 280px; padding: 8px; background: white; }
.bulk-file-summary { margin-top: 9px; color: var(--muted); font-size: 10px; }
.bulk-results { max-height: 180px; margin-top: 14px; padding: 12px; overflow-y: auto; border-radius: 9px; background: var(--canvas); font-size: 10px; }
.bulk-results strong { display: block; margin-bottom: 7px; color: var(--ink); }
.bulk-error { margin-top: 5px; color: var(--red); }

.detail-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.meta-box { padding: 11px; border-radius: 9px; background: var(--canvas); }
.meta-box span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .5px; }
.meta-box strong { display: block; margin-top: 3px; font-size: 11px; }
.issue-block { margin-top: 16px; padding: 14px; border-left: 3px solid var(--teal); border-radius: 0 9px 9px 0; background: #edf8ff; }
.issue-block h4 { margin: 0 0 5px; font-size: 11px; }
.issue-block p { margin: 0; color: #5d6b70; font-size: 11px; line-height: 1.55; }
.timeline { margin: 18px 0; }
.timeline-item { position: relative; padding: 0 0 17px 28px; border-left: 1px solid #dce5e2; margin-left: 7px; }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-dot { position: absolute; left: -7px; top: 0; width: 13px; height: 13px; border: 3px solid white; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 1px #a8cfe8; }
.timeline-item strong { display: block; font-size: 10px; }
.timeline-item span { color: var(--muted); font-size: 9px; }
.action-form { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fafcfa; }
.action-form h3 { margin: 0 0 12px; font: 700 13px "Manrope"; }
.action-form textarea { margin-bottom: 10px; }
.file-drop { position: relative; min-height: 78px; margin-bottom: 11px; display: grid !important; place-items: center; border: 1px dashed #b8c9c5; border-radius: 8px; color: var(--muted) !important; background: white; text-align: center; }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop span { font-size: 10px; }
.evidence-preview { margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 7px; }
.evidence-chip { padding: 5px 8px; border-radius: 5px; color: var(--teal-dark); background: #e1f2ff; font-size: 9px; text-decoration: none; }
.detail-actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; min-width: 285px; padding: 13px 16px; display: flex; gap: 11px; align-items: center; border: 1px solid #bfdff2; border-radius: 11px; background: white; box-shadow: 0 15px 40px rgba(35,105,160,.18); opacity: 0; transform: translateY(20px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: none; }
.toast > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font-size: 12px; }
.toast strong { display: block; font-size: 11px; }
.toast p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.empty-state { padding: 35px; color: var(--muted); text-align: center; font-size: 12px; }

@media (max-width: 1080px) {
  .sidebar { transform: translateX(-100%); box-shadow: 12px 0 35px rgba(0,0,0,.16); }
  .sidebar.open { transform: none; }
  .main { width: 100%; margin-left: 0; }
  .menu-btn { display: grid; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .topbar { padding: 0 18px; }
  .content { padding: 22px 18px 35px; }
  .search-box { display: none; }
  .analysis-grid, .lower-grid, .compliance-board, .machine-grid, .report-grid, .admin-grid { grid-template-columns: 1fr; }
  .welcome-row, .section-toolbar { align-items: start; gap: 15px; }
  .date-filter { display: none; }
}

@media (max-width: 560px) {
  .page-title p { display: none; }
  .page-title h1 { font-size: 16px; }
  .primary-btn { padding: 0 12px; }
  .top-actions > .primary-btn { font-size: 0; }
  .top-actions > .primary-btn span { margin: 0; font-size: 19px; }
  .stat-grid { grid-template-columns: 1fr; }
  .form-grid, .detail-meta { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .welcome-row, .section-toolbar { display: block; }
  .findings-tools { margin-top: 14px; align-items: stretch; flex-direction: column; }
  .filter-row { display: grid; grid-template-columns: 1fr 1fr; }
  .template-callout { align-items: stretch; flex-direction: column; }
  .donut-wrap { flex-direction: column; padding-top: 20px; }
  .status-legend { width: 100%; grid-template-columns: 1fr 1fr; }
}
