/* Flexwind HSE — palette taken from the Flexwind logo (steel blue, graphite grey, navy). */
:root {
  --bg: #f3f5f8;            /* branco gelo */
  --surface: #ffffff;       /* cards */
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --border-strong: #cfd7e2;
  --text: #1f2a37;
  --muted: #6b7480;
  --brand: #2f5f93;         /* logo blue */
  --brand-600: #264e7a;
  --brand-700: #1d3d61;
  --brand-50: #eaf1f8;
  --brand-100: #d5e3f1;
  --navy: #16263d;          /* dark logo background */
  --grey: #7d8187;          /* logo grey */
  --safety: #2f5f93;
  --near: #d39226;
  --accident: #c2453d;
  --accident-soft: #e9907f;
  --success: #2f8f5b;
  --success-50: #e6f4ec;
  --warning: #b7791f;
  --warning-50: #fdf3e1;
  --danger: #c2453d;
  --danger-50: #fbe9e7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 28px rgba(16, 24, 40, .12);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1320px; margin: 0 auto; height: 72px; padding: 0 24px; display: flex; align-items: center; gap: 24px; }
.brand-logo { height: 34px; display: block; }
.mainnav { display: flex; gap: 4px; margin: 0 auto; }
.mainnav a { padding: 10px 16px; border-radius: 999px; color: var(--text); font-weight: 500; font-size: 14.5px; }
.mainnav a:hover { background: var(--surface-2); text-decoration: none; }
.mainnav a.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.usermenu { position: relative; }
.usermenu > button { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--surface); padding: 5px 6px 5px 14px; border-radius: 999px; cursor: pointer; font: inherit; color: var(--text); transition: box-shadow .15s; }
.usermenu > button:hover { box-shadow: var(--shadow-lg); }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 8px; display: none; }
.usermenu.open .menu { display: block; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.burger { display: none; border: 1px solid var(--border); background: var(--surface); width: 42px; height: 42px; border-radius: 999px; cursor: pointer; }
.burger span { display: block; width: 18px; height: 2px; background: var(--text); margin: 4px auto; border-radius: 2px; }

.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--navy); color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 96px; height: 96px; font-size: 30px; }

/* ---------- Layout ---------- */
.container { max-width: 1320px; margin: 0 auto; padding: 28px 24px 64px; }
.container.narrow { max-width: 880px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack > * + * { margin-top: 20px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 22px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; flex-wrap: wrap; }
.card-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.card-head .num { font-size: 13px; color: var(--muted); }
.card-head .num b { font-size: 22px; color: var(--text); display: block; text-align: right; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.section-title .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--brand); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent; font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: #0e1a2b; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #efc4bf; }
.btn-danger:hover { background: var(--danger-50); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-icon { width: 38px; padding: 0; }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field label, .label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field .req { color: var(--danger); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field .error { font-size: 12.5px; color: var(--danger); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; height: 46px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 14px;
  font: 15px var(--font); color: var(--text); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; }
select.input { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7480' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.input[readonly], .input:disabled { background: var(--surface-2); color: var(--muted); }
.has-error .input { border-color: var(--danger); }
.input-sm { height: 38px; font-size: 14px; border-radius: 999px; padding: 0 14px; }
select.input-sm { padding-right: 34px; background-position: right 12px center; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.radio-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-cards label { flex: 1 1 160px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: center; font-weight: 500; }
.radio-cards input { accent-color: var(--brand); }
.radio-cards label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand) inset; }

/* Filters bar (Airbnb-like pill search) */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filterbar .input-sm { width: auto; min-width: 0; max-width: 220px; }
.filters-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 20px; }
.filters-panel .fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.filters-panel .fgrid label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 4px 12px; display: block; }
.filters-panel .fgrid .input { height: 40px; border-radius: 999px; font-size: 14px; }
.filters-panel .factions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.badge.open { background: var(--warning-50); color: var(--warning); }
.badge.closed { background: var(--success-50); color: var(--success); }
.badge.safety { background: var(--brand-50); color: var(--safety); }
.badge.near_miss { background: #fbf1df; color: #a86f12; }
.badge.accident { background: var(--danger-50); color: var(--accident); }
.badge.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.neutral::before { display: none; }

/* ---------- Tables / lists ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; transition: background .1s; }
.table tr.clickable:hover td { background: #f6f9fc; }
.table .desc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.table .wide-col { min-width: 170px; }
.field label.btn { display: inline-flex; margin-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.event-cards { display: none; }
.event-card { display: block; padding: 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.event-card:hover { text-decoration: none; background: var(--surface-2); }
.event-card .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.event-card .title { font-weight: 600; margin: 8px 0 4px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; color: var(--text); display: block; transition: box-shadow .15s, transform .15s; }
.tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.tile .tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tile h3 { font-size: 16px; margin-bottom: 4px; }
.tile .meta { color: var(--muted); font-size: 13.5px; }
.tile .stats { display: flex; gap: 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.tile .stats b { color: var(--text); font-size: 16px; display: block; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.kpi .k-label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.kpi .k-label .sw { width: 10px; height: 10px; border-radius: 3px; }
.kpi .k-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12.5px; color: var(--muted); }
.stat-big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* Dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dash-grid .wide { grid-column: 1 / -1; }
.dash-card .filterbar { padding: 14px 22px 0; }
.chart-box { position: relative; height: 290px; padding: 12px 18px 18px; }
.chart-box.tall { height: 340px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; pointer-events: none; }
.top5 { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.top5 > div + div { border-left: 1px solid var(--border); }
.rank { list-style: none; margin: 0; padding: 4px 22px 22px; }
.rank li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.rank li:last-child { border-bottom: 0; }
.rank .pos { width: 26px; height: 26px; border-radius: 99px; background: var(--brand-50); color: var(--brand-700); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.rank .bar { height: 6px; border-radius: 99px; background: var(--brand-100); margin-top: 6px; overflow: hidden; }
.rank .bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.rank.near .pos { background: #fbf1df; color: #a86f12; }
.rank.near .bar { background: #f6e3c0; }
.rank.near .bar i { background: var(--near); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); padding: 0 22px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.footnote { font-size: 12px; color: var(--muted); padding: 0 22px 18px; }

/* ---------- Details ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.sticky-side { position: sticky; top: 92px; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13.5px; }
.dl dd { margin: 0; font-weight: 500; }
.prose { white-space: pre-wrap; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gallery .thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); padding: 0; }
.gallery .thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumb form { position: absolute; top: 6px; right: 6px; }
.gallery .thumb .x { width: 26px; height: 26px; border-radius: 99px; border: 0; background: rgba(22, 38, 61, .75); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.file-doc { padding: 10px; word-break: break-all; }
.file-doc svg { width: 28px; height: 28px; color: var(--brand); display: block; margin: 0 auto 6px; }

.timeline { border-left: 2px solid var(--border); margin-left: 6px; padding-left: 16px; }
.timeline .item { position: relative; padding-bottom: 14px; }
.timeline .item::before { content: ''; position: absolute; left: -23px; top: 5px; width: 12px; height: 12px; border-radius: 99px; background: var(--surface); border: 2px solid var(--brand); }
.timeline .item.done::before { background: var(--success); border-color: var(--success); }

/* Corrective actions */
.action-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px auto auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.action-row + .action-row { margin-top: 10px; }
.toggle-done { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--muted); user-select: none; white-space: nowrap; }
.toggle-done input { display: none; }
.toggle-done:has(input:checked) { background: var(--success-50); border-color: var(--success); color: var(--success); }
.toggle-done .ico::before { content: '○'; }
.toggle-done:has(input:checked) .ico::before { content: '✓'; }
.add-row { width: 46px; height: 46px; border-radius: 999px; border: 1px dashed var(--brand); background: var(--brand-50); color: var(--brand); font-size: 22px; cursor: pointer; }
.remove-row { width: 38px; height: 38px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.remove-row:hover { background: var(--danger-50); color: var(--danger); }

.why-list { counter-reset: why; }
.why-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.why-item .n { width: 30px; height: 30px; border-radius: 99px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.fishbone { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fishbone .field textarea { min-height: 84px; }
.fish-effect { margin-top: 14px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--navy); color: #fff; border-radius: 12px; }
.fish-effect .arrow { flex: 1; height: 2px; background: rgba(255, 255, 255, .5); position: relative; }
.fish-effect .arrow::after { content: ''; position: absolute; right: -2px; top: -5px; border: 6px solid transparent; border-left-color: rgba(255, 255, 255, .5); }

/* Status panel */
.status-panel { padding: 20px; }
.status-panel .switch { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--border); padding: 4px; border-radius: 999px; margin: 12px 0 14px; }
.status-panel .switch label { text-align: center; padding: 9px 10px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.status-panel .switch input { display: none; }
.status-panel .switch label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.status-panel .switch label.c:has(input:checked) { color: var(--success); }
.status-panel .switch label.o:has(input:checked) { color: var(--warning); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--success-50); color: #1f6b43; border: 1px solid #c3e4d1; }
.alert-error { background: var(--danger-50); color: #9b2f28; border: 1px solid #f1c7c2; }
.alert-info { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }

/* Modal */
dialog.modal { border: 0; border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(16, 24, 40, .25); color: var(--text); }
dialog.modal::backdrop { background: rgba(22, 38, 61, .45); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head .close { width: 34px; height: 34px; border-radius: 99px; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--text); }
.modal-head .close:hover { background: var(--surface-2); }
.modal-body { padding: 22px; display: grid; gap: 16px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Pagination */
.pager { display: flex; gap: 6px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 999px; display: grid; place-items: center; font-size: 14px; color: var(--text); border: 1px solid transparent; }
.pager a:hover { border-color: var(--border-strong); text-decoration: none; }
.pager .current { background: var(--navy); color: #fff; }

/* Empty state */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ico { width: 56px; height: 56px; border-radius: 99px; background: var(--brand-50); display: grid; place-items: center; margin: 0 auto 12px; color: var(--brand); font-size: 24px; }

/* ---------- Public / auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero { background: linear-gradient(160deg, var(--navy) 0%, #1f3a5f 55%, var(--brand) 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero::after { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .05); right: -180px; bottom: -180px; }
.auth-hero h2 { font-size: 34px; font-weight: 700; max-width: 440px; letter-spacing: -.02em; }
.auth-hero p { color: rgba(255, 255, 255, .78); max-width: 420px; }
.auth-hero .logo-w { height: 38px; filter: brightness(0) invert(1); }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .field { margin-top: 16px; }
.auth-card .btn-block { margin-top: 22px; height: 48px; font-size: 15px; }
.lang-switch { display: flex; gap: 6px; }
.lang-switch a { font-size: 12.5px; padding: 6px 10px; border-radius: 999px; color: inherit; opacity: .75; border: 1px solid transparent; }
.lang-switch a.active { opacity: 1; border-color: currentColor; }
.lang-switch a:hover { text-decoration: none; opacity: 1; }
.report-cta { margin-top: 26px; padding: 16px; border-radius: 14px; border: 1px dashed var(--border-strong); display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }

.public-top { background: var(--surface); border-bottom: 1px solid var(--border); }
.public-top .topbar-inner { justify-content: flex-start; gap: 16px; }

.report-hero { background: linear-gradient(135deg, var(--navy), var(--brand)); color: #fff; border-radius: 22px; padding: 28px; margin-bottom: 22px; position: relative; overflow: hidden; }
.report-hero h1 { color: #fff; }
.report-hero p { color: rgba(255, 255, 255, .8); margin: 8px 0 0; max-width: 620px; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 14px; padding: 22px; text-align: center; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-50); }
.dropzone input { display: none; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; margin-top: 12px; }
.previews .pv { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); display: grid; place-items: center; font-size: 11px; color: var(--muted); padding: 4px; text-align: center; word-break: break-all; }
.previews .pv img { width: 100%; height: 100%; object-fit: cover; }
.previews .pv button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 99px; border: 0; background: rgba(22, 38, 61, .75); color: #fff; cursor: pointer; font-size: 12px; }

.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.photo-edit { position: relative; }
.photo-edit label { position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border-strong); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.photo-edit input { display: none; }

footer.site { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 16px 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .sticky-side { position: static; }
}
@media (max-width: 960px) {
  .burger { display: block; }
  .topbar-inner { gap: 12px; }
  .mainnav { display: none; position: absolute; left: 0; right: 0; top: 72px; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; padding: 10px 16px 16px; box-shadow: var(--shadow-lg); }
  .mainnav.open { display: flex; }
  .mainnav a { padding: 12px 14px; border-radius: 12px; }
  .usermenu { margin-left: auto; }
  .dash-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 24px; min-height: 220px; }
  .auth-hero h2 { font-size: 24px; }
  .fishbone { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .container { padding: 20px 16px 48px; }
  .topbar-inner { padding: 0 16px; height: 64px; }
  .mainnav { top: 64px; }
  .brand-logo { height: 28px; }
  .usermenu .uname { display: none; }
  .usermenu > button { padding: 4px; }
  h1 { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .k-value { font-size: 22px; }
  .top5 { grid-template-columns: 1fr; }
  .top5 > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .chart-box { height: 240px; padding: 8px 10px 14px; }
  .table-desktop { display: none; }
  .event-cards { display: block; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 10px; }
  .action-row { grid-template-columns: 1fr auto; }
  .action-row .resp { grid-column: 1 / -1; grid-row: 2; }
  .fishbone { grid-template-columns: 1fr; }
  .filterbar .input-sm { max-width: none; flex: 1 1 140px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .report-hero { padding: 22px; }
  .card-body { padding: 18px; }
  .card-head { padding: 18px 18px 0; }
  .dash-card .filterbar { padding: 12px 18px 0; }
  .modal-foot .btn { flex: 1; }
}

@media print {
  .topbar, .actions, .filters-panel, .status-panel form { display: none !important; }
  body { background: #fff; }
}

/* Small "i" popover (rate formulas) */
.info-pop { position: relative; }
.info-pop summary { list-style: none; width: 28px; height: 28px; border-radius: 99px; border: 1px solid var(--border-strong); display: grid; place-items: center; cursor: pointer; font: italic 700 13px Georgia, serif; color: var(--muted); }
.info-pop summary::-webkit-details-marker { display: none; }
.info-pop[open] summary, .info-pop summary:hover { color: var(--brand); border-color: var(--brand); }
.info-pop-body { position: absolute; right: 0; top: 36px; z-index: 30; width: min(440px, calc(100vw - 48px)); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 14px 16px; font-size: 13px; line-height: 1.55; color: var(--text); }
