/* ==========================================================================
   ISMS Tasks — AVeS Cyber Security brand layer
   Loaded after app.css / dashboard.css. Mirrors the AVeS document style:
   white letterhead page on #EEF0F3, Poppins display + Open Sans text,
   orange (#FFAD00 / #F09909) rules and accents, charcoal (#1F2933) ink,
   steel grey (#A8B5C4) secondary, gold table headers.
   ========================================================================== */
@font-face { font-family: "Open Sans"; font-weight: 400; font-display: swap; src: url(fonts/open-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 600; font-display: swap; src: url(fonts/open-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 700; font-display: swap; src: url(fonts/open-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url(fonts/poppins-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url(fonts/poppins-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url(fonts/poppins-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url(fonts/poppins-latin-700-normal.woff2) format("woff2"); }

:root, [data-theme="light"] {
  --aves-orange: #FFAD00;
  --aves-orange-deep: #F09909;
  --aves-orange-soft: #FFF4DC;
  --aves-ink: #1F2933;
  --aves-steel: #A8B5C4;
  --aves-paper: #EEF0F3;
  --aves-gold: #FFC000;

  --bg: #EEF0F3;
  --bg2: #EEF0F3;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --card: #F6F7F9;
  --card-hover: #ffffff;
  --border: #DDE1E7;
  --text: #1F2933;
  --muted: #5E6B78;
  --accent: #F09909;
  --accent2: #C77700;
  --danger: #C8372D;
  --warn: #F09909;
  --ok: #2E8B57;
  --shadow: 0 1px 2px rgba(31, 41, 51, .06), 0 6px 18px rgba(31, 41, 51, .07);
  --input: #ffffff;
  --particle: 168, 181, 196;
  --on-accent: #1F2933;
  --head-font: "Poppins", "Open Sans", "Segoe UI", system-ui, sans-serif;

  /* dashboard series (status: to do · in progress · blocked · done) */
  --v-todo: #8C99A8; --v-prog: #F09909; --v-block: #C8372D; --v-done: #2E8B57;
  --v-created: #5E6B78; --v-completed: #2E8B57; --v-series1: #F09909;
  --st-good: #2E8B57; --st-warning: #F0A500; --st-serious: #E0702E; --st-critical: #C8372D;
  --grid: rgba(31, 41, 51, .08);
  --axis-text: #5E6B78;
}
[data-theme="dark"] {
  --bg: #161D24;
  --bg2: #161D24;
  --panel: #1F2933;
  --panel-solid: #1F2933;
  --card: #26323D;
  --card-hover: #2C3946;
  --border: #34414D;
  --text: #EEF0F3;
  --muted: #A8B5C4;
  --accent: #FFAD00;
  --accent2: #FFC24D;
  --danger: #EF6A5E;
  --warn: #FFAD00;
  --ok: #4CC38A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
  --input: #18212A;
  --particle: 168, 181, 196;
  --v-todo: #A8B5C4; --v-prog: #FFAD00; --v-block: #EF6A5E; --v-done: #4CC38A;
  --v-created: #A8B5C4; --v-completed: #4CC38A; --v-series1: #FFAD00;
  --st-good: #4CC38A; --st-warning: #FFC24D; --st-serious: #F08A50; --st-critical: #EF6A5E;
  --grid: rgba(238, 240, 243, .08);
  --axis-text: #A8B5C4;
}

/* ---------- Base typography & page ---------- */
body {
  font: 14px/1.5 "Open Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
}
h1, h2, h3, .tile-value, .hero-value, .ring-c b, .cc-stats dd, .im-tile b, .stat b, .modal-title input {
  font-family: var(--head-font);
}
code { background: var(--aves-orange-soft); color: var(--aves-ink); border-radius: 4px; }
[data-theme="dark"] code { background: rgba(255, 173, 0, .14); color: var(--text); }
a { color: var(--accent2); }
#bg-canvas { opacity: .55; }

/* Letterhead wave along the bottom of the viewport */
body.app::after, body.auth-page::after {
  content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 120px; z-index: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath d='M0 18 L430 66 L1440 20 L1440 120 L0 120 Z' fill='%23E2E6EB'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}
[data-theme="dark"] body.app::after, [data-theme="dark"] body.auth-page::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath d='M0 18 L430 66 L1440 20 L1440 120 L0 120 Z' fill='%231B242D'/%3E%3C/svg%3E");
}

/* ---------- Brand ---------- */
.brand { gap: 14px; }
.brand h1 { background: none; color: var(--text); animation: none; font-weight: 600; letter-spacing: 0; -webkit-background-clip: initial; background-clip: initial; }
.brand.small h1 { font-size: 17px; }
.brand-logo { display: block; height: 34px; width: auto; }
.brand-logo.dark, [data-theme="dark"] .brand-logo.light { display: none; }
[data-theme="dark"] .brand-logo.dark { display: block; }
.brand-text { display: grid; line-height: 1.15; padding-left: 14px; border-left: 2px solid var(--aves-orange); }
.brand-text small { font-size: 10.5px; color: var(--muted); letter-spacing: .3px; }
.auth-card .brand { flex-direction: column; align-items: flex-start; gap: 18px; }
.auth-card .brand-logo { height: 70px; }
.auth-card .brand-text { border-left: 0; padding-left: 0; }
.auth-card .brand-text h1 { font-size: 30px; color: var(--accent); font-weight: 700; }
.auth-card .brand-text small { font-size: 12px; }

/* Eyebrow labels in the style of "ENGAGEMENT AT A GLANCE" */
.eyebrow, .tile-label, .field > span, .sg-head, .im-table th, .viz-table th {
  font-family: var(--head-font); text-transform: uppercase; letter-spacing: 1.4px; font-weight: 600; font-size: 11px;
}
.tile-label, .eyebrow { color: var(--accent2); }
[data-theme="light"] .tile-label { color: #C77700; }

/* Headings with the orange document rule */
.section-head { border-bottom: 2px solid var(--aves-orange); padding-bottom: 8px; }
.section-head h2 { font-weight: 500; font-size: 20px; }
.chart-card h3, .cc-title h3, .col-title h3 { font-weight: 600; }

/* ---------- Buttons & inputs ---------- */
.btn { border-radius: 6px; background: var(--panel); box-shadow: none; }
.btn:hover { box-shadow: var(--shadow); border-color: var(--aves-steel); }
.btn.primary { background: var(--aves-orange); color: var(--on-accent); animation: none; font-weight: 600; }
.btn.primary:hover { background: var(--aves-orange-deep); }
.btn.primary::after { display: none; }
a.btn.primary { color: var(--on-accent); }
.icon-btn { border-radius: 6px; background: var(--panel); }
input, select, textarea { border-radius: 6px; }
input:focus, select:focus, textarea:focus { border-color: var(--aves-orange); box-shadow: 0 0 0 3px rgba(255, 173, 0, .25); }
.toggle input:checked + span { background: var(--aves-orange); }
.seg { border-radius: 6px; }
.seg button.on { background: var(--aves-ink); color: #fff; }
[data-theme="dark"] .seg button.on { background: var(--aves-orange); color: var(--aves-ink); }
.ripple { background: rgba(31, 41, 51, .18); }

/* ---------- Top bar = letterhead ---------- */
.topbar { background: var(--panel); border-bottom: 3px solid var(--aves-orange); box-shadow: 0 1px 0 var(--border); backdrop-filter: none; }
.mainnav { border-radius: 8px; background: var(--bg); }
.mainnav a { border-radius: 6px; font-family: var(--head-font); font-weight: 500; }
.mainnav a.active { color: var(--aves-ink); }
.nav-ink { background: var(--aves-orange); animation: none; border-radius: 6px; box-shadow: none; }
.stat { border-radius: 6px; background: var(--bg); }
.stat.warn b { color: var(--danger); }
.stat.info b { color: var(--accent2); }
.menu { border-radius: 8px; }
.menu button:hover { background: var(--aves-orange-soft); }
[data-theme="dark"] .menu button:hover { background: rgba(255, 173, 0, .14); }
.avatar-btn { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--aves-orange); }

/* ---------- Board ---------- */
.column { border-radius: 8px; backdrop-filter: none; background: var(--panel); }
.column::before { left: 0; right: 0; height: 4px; border-radius: 8px 8px 0 0; background: var(--c); box-shadow: none; }
.col-head { padding-top: 16px; }
.ring .fg { filter: none; }
.col-add { border-radius: 6px; }
.col-add:hover { color: var(--aves-ink); }
.empty-col { border-radius: 6px; }

.card { border-radius: 6px; background: var(--card); }
.card::before { top: 0; bottom: 0; border-radius: 6px 0 0 6px; box-shadow: none; }
.card::after { display: none; }
.card.p-urgent { --p: var(--danger); }
.card.p-high { --p: var(--aves-orange); }
.card.p-medium { --p: #5E6B78; }
.card.p-low { --p: var(--aves-steel); }
.card.p-urgent:not(.is-done), .card.enter.p-urgent:not(.is-done) { animation: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent); }
.card.enter.p-urgent:not(.is-done) { animation: card-pop .55s cubic-bezier(.2, .9, .3, 1.35) both; }
.card-title { font-weight: 600; }
.chip { border-radius: 4px; }
.chip.s-todo { color: var(--muted); }
[data-theme="light"] .chip.s-todo { color: #5E6B78; }
.chip.s-in_progress, [data-theme="light"] .chip.s-in_progress { color: #B36F00; border-color: rgba(240, 153, 9, .45); }
[data-theme="dark"] .chip.s-in_progress { color: var(--aves-orange); }
.chip.s-in_progress::before { background: var(--aves-orange); }
.chip.cat { background: var(--aves-ink); color: #fff; }
[data-theme="dark"] .chip.cat { background: #EEF0F3; color: var(--aves-ink); }
.chip.due.soon { color: var(--aves-ink); background: var(--aves-orange); }
.chip.tag { color: hsl(var(--h) 35% 38%); background: hsl(var(--h) 30% 50% / .08); border-color: hsl(var(--h) 25% 50% / .3); }
[data-theme="dark"] .chip.tag { color: hsl(var(--h) 40% 78%); }
.chip.tag.active { background: var(--aves-ink); color: #fff; box-shadow: none; }
[data-theme="dark"] .chip.tag.active { background: var(--aves-orange); color: var(--aves-ink); }
.hours i { background: var(--aves-orange); }
.drop-placeholder { border-radius: 6px; }
mark { background: rgba(255, 192, 0, .45); box-shadow: none; }

/* tag panel */
.tb-panel { border-radius: 8px; backdrop-filter: none; background: var(--panel); }
.tb-panel::before { left: 0; right: 0; height: 4px; border-radius: 8px 8px 0 0; background: var(--aves-ink); animation: none; }
.hash { color: var(--aves-orange-deep); }
.tag-item { border-radius: 6px; }
.tag-dot { box-shadow: none; background: hsl(var(--h) 35% 55%); }
.tag-item.on { background: var(--aves-orange-soft); border-color: var(--aves-orange); box-shadow: none; }
[data-theme="dark"] .tag-item.on { background: rgba(255, 173, 0, .12); }
.tag-item.on .tag-count, .tb-rail b { background: var(--aves-ink); color: #fff; }
.tag-bar i { background: var(--aves-orange); }
.tb-rail { border-radius: 8px; backdrop-filter: none; background: var(--panel); }
.tags-toggle.on { border-color: var(--aves-orange); box-shadow: 0 0 0 1px var(--aves-orange) inset; }
.ab-count b { color: var(--accent2); }

/* ---------- Modals ---------- */
.modal::backdrop { background: rgba(31, 41, 51, .45); backdrop-filter: blur(3px); }
.modal-card { border-radius: 10px; border-top: 4px solid var(--aves-orange); }
.modal-head h2 { font-family: var(--head-font); font-weight: 500; }
.tabs button.active { border-color: var(--aves-orange); }
.activity li::before { background: var(--aves-orange); }
.comments .bubble { border-radius: 2px 8px 8px 8px; }
.mlist li, .mform, .dropzone, .im-tile, .im-table-wrap, .toast { border-radius: 6px; }
.toast { border-left-color: var(--aves-orange); }
.im-table th { background: var(--aves-gold); color: var(--aves-ink); }
.dz-icon svg { stroke: var(--aves-orange-deep); }
.dropzone:hover, .dropzone.over { border-color: var(--aves-orange); background: var(--aves-orange-soft); }
[data-theme="dark"] .dropzone:hover, [data-theme="dark"] .dropzone.over { background: rgba(255, 173, 0, .08); }
.board-drop-hint { background: rgba(255, 173, 0, .12); }
.board-drop-hint div { border-color: var(--aves-orange); border-radius: 8px; }
.skeleton { border-radius: 8px; }

/* ---------- Auth pages ---------- */
.blob { display: none; }
.auth-page { background: var(--bg); }
.auth-card { border-radius: 10px; backdrop-filter: none; background: var(--panel); border-top: 4px solid var(--aves-orange); }
.float input:focus + span, .float input:not(:placeholder-shown) + span { color: var(--accent2); }
.auth-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); }
.auth-foot b { color: var(--text); }
.auth-foot .www { color: var(--aves-orange-deep); font-weight: 700; font-family: var(--head-font); }

/* ---------- Dashboard ---------- */
.tile, .chart-card, .face { border-radius: 8px; backdrop-filter: none; background: var(--panel); }
.tile { border-left: 4px solid var(--aves-orange); }
.tile.hero { background: var(--aves-ink); color: #fff; border-left-color: var(--aves-orange); }
.tile.hero .tile-label { color: var(--aves-orange); }
.tile.hero .tile-foot, .tile.hero .tile-delta { color: var(--aves-steel); }
.tile.hero::after { display: none; }
[data-theme="dark"] .tile.hero { background: #111820; }
.tile-value, .hero-value { font-weight: 600; }
.cf-chip { border-radius: 4px; }
.cf-chip i { box-shadow: none; border-radius: 2px; }
.cf-chip.all.on { border-color: var(--aves-ink); background: var(--aves-ink); color: #fff; }
[data-theme="dark"] .cf-chip.all.on { background: var(--aves-orange); color: var(--aves-ink); border-color: var(--aves-orange); }
.ccard::before { display: none; }
.face { border-top: 4px solid var(--c); }
.face::before, .face::after { display: none; }
.cc-dot { box-shadow: none; border-radius: 3px; }
.cc-ring .prog { filter: none; }
.cc-stats div, .cc-next li, .health { border-radius: 6px; }
.chart-card > header { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.viz-table th { background: var(--aves-gold); color: var(--aves-ink); }
.viz-tip { border-radius: 6px; border-top: 3px solid var(--aves-orange); }

/* ---------- Footer (letterhead) ---------- */
.app-foot {
  position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px;
  padding: 18px 24px 16px; font-size: 11.5px; color: var(--muted);
}
.app-foot b { color: var(--text); }
.app-foot .www { color: var(--aves-orange-deep); font-family: var(--head-font); font-weight: 700; font-size: 14px; text-decoration: none; }
.app-foot .t { color: var(--aves-orange-deep); font-weight: 700; margin-right: 4px; }
.page-kanban .app-foot { display: none; }

/* ISMS reference chip on cards (POL-001, R-12 …) */
.chip.ref { font-family: var(--head-font); font-weight: 600; color: var(--aves-ink); background: var(--aves-orange-soft); border-color: rgba(240, 153, 9, .5); }
[data-theme="dark"] .chip.ref { color: var(--aves-orange); background: rgba(255, 173, 0, .1); }
#btn-theme { font-family: "Segoe UI Symbol", "Segoe UI", system-ui, sans-serif; }

/* ---------- left navigation panel (v1.10.0) ---------- */
:root { --side-w: 272px; --side-rail: 68px; --side-cur: var(--side-w); --side-bg: var(--panel-solid, var(--panel)); }
html.nav-collapsed { --side-cur: var(--side-rail); }
body.app:has(> .sidenav) { padding-left: var(--side-cur); transition: padding-left .25s ease; }
.sidenav {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; width: var(--side-cur); display: flex; flex-direction: column; gap: 18px;
  padding: 14px 10px 12px; background: var(--side-bg); border-right: 1px solid var(--border); box-shadow: 1px 0 0 var(--border);
  overflow-x: hidden; overflow-y: auto; transition: width .25s ease, transform .25s ease;
}
.sidenav::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--aves-orange); }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 12px; border-bottom: 1px solid var(--border); min-height: 52px; }
.side-brand .brand-logo { height: 32px; flex: none; }
.side-brand .brand-text { min-width: 0; white-space: nowrap; }
.side-brand .brand-icon { display: none; height: 34px; width: 34px; flex: none; }
.side-brand .brand-text { padding-left: 10px; }
.side-brand .brand-text small { font-size: 10px; }
.side-brand .brand-text h1 { font-size: 17px; margin: 0; }
.side-brand .brand-text small { white-space: normal; line-height: 1.25; }
.sidenav .mainnav { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 0; background: none; border: 0; border-radius: 0; flex: 1; }
.nav-group { display: grid; gap: 2px; }
.nav-head { padding: 0 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.sidenav .mainnav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 7px; font-size: 14px; white-space: nowrap; color: var(--muted); }
.sidenav .mainnav a:hover { color: var(--text); background: var(--bg); }
.sidenav .mainnav a.active, .sidenav .mainnav a.active:hover { color: var(--aves-ink); background: transparent; }
.sidenav .mainnav svg { display: block; width: 18px; height: 18px; flex: none; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.sidenav .nav-ink { top: 0; left: 0; bottom: auto; height: 0; transition: transform .4s cubic-bezier(.2, .9, .3, 1.1), height .3s, width .25s; }
.nav-toggle { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 0; border-radius: 7px; background: none; color: var(--muted);
  font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; border-top: 1px solid var(--border); border-radius: 0 0 7px 7px; padding-top: 12px; }
.nav-toggle:hover { color: var(--text); }
.nav-toggle svg { width: 18px; height: 18px; flex: none; transition: transform .25s; }
.sidenav-backdrop { position: fixed; inset: 0; z-index: 59; background: rgba(15, 20, 25, .4); }
.nav-burger { display: none; }
.topbar .page-title { margin: 0; font-size: 18px; font-weight: 600; white-space: nowrap; font-family: var(--head-font); }
.topbar > .stats { margin: 0 auto 0 8px; }
body.page-leave > .sidenav { opacity: 1 !important; transform: none !important; }

/* icon rail: chosen with the collapse button, and always below 1100 px */
html.nav-collapsed .sidenav .nav-label, html.nav-collapsed .side-brand .brand-text { display: none; }
html.nav-collapsed .side-brand .brand-logo, html.nav-collapsed .side-brand .brand-text { display: none !important; }
html.nav-collapsed .side-brand .brand-icon.light { display: block; }
html.nav-collapsed[data-theme="dark"] .side-brand .brand-icon.light { display: none; }
html.nav-collapsed[data-theme="dark"] .side-brand .brand-icon.dark { display: block; }

html.nav-collapsed .nav-head { font-size: 0; padding: 0; margin: 0 10px 4px; border-top: 1px solid var(--border); }
html.nav-collapsed .sidenav .mainnav a, html.nav-collapsed .nav-toggle { justify-content: center; padding-left: 0; padding-right: 0; }
html.nav-collapsed .side-brand { justify-content: center; padding-left: 0; padding-right: 0; }
html.nav-collapsed .nav-toggle svg { transform: rotate(180deg); }
@media (max-width: 1100px) {
  :root, html.nav-collapsed { --side-cur: var(--side-rail); }
  .sidenav .nav-label, .side-brand .brand-text, .nav-toggle { display: none; }
  .nav-head { font-size: 0; padding: 0; margin: 0 10px 4px; border-top: 1px solid var(--border); }
  .sidenav .mainnav a { justify-content: center; padding-left: 0; padding-right: 0; }
  .side-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .side-brand .brand-logo { display: none !important; }
  .side-brand .brand-icon.light { display: block; }
  [data-theme="dark"] .side-brand .brand-icon.light { display: none; }
  [data-theme="dark"] .side-brand .brand-icon.dark { display: block; }
}
/* phones: drawer from the left, opened with ☰ */
@media (max-width: 760px) {
  body.app:has(> .sidenav) { padding-left: 0; }
  .sidenav { width: var(--side-w); transform: translateX(-105%); box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  html.nav-open .sidenav { transform: none; }
  html.nav-open .sidenav .nav-label, html.nav-open .side-brand .brand-text { display: block; }
  html.nav-open .nav-head { font-size: 10.5px; padding: 0 10px 4px; margin: 0; border-top: 0; }
  html.nav-open .sidenav .mainnav a { justify-content: flex-start; padding: 9px 10px; }
  html.nav-open .side-brand { justify-content: flex-start; padding: 4px 6px 12px; }
  html.nav-open .side-brand .brand-icon { display: none !important; }
  html.nav-open .side-brand .brand-logo.light { display: block !important; }
  html.nav-open[data-theme="dark"] .side-brand .brand-logo.light { display: none !important; }
  html.nav-open[data-theme="dark"] .side-brand .brand-logo.dark { display: block !important; }
  .nav-burger { display: inline-grid; }
  .topbar .page-title { font-size: 16px; }
}

/* top bar: page stats move to their own row when space runs out */
@media (max-width: 1400px) {
  .topbar { gap: 14px; }
  .topbar > .stats { order: 10; flex: 1 0 100%; justify-content: flex-start; margin: -4px 0 0; }
  .topbar > .top-actions { margin-left: auto; }
  .stat { padding: 5px 10px; }
}
