/* Onyx Aero Ltd. — CRM (onyxaeroltd.com). Same tokens as the landing (MEDIA/BRAND_GUIDE.md): lime accent ≤10 %, graphite surfaces,
   Montserrat headings / Inter text, side accent stripes (never on top), one line for repeated labels, mobile ≤1080 / ≤760 rules. */
:root {
  --oa-lime: #B4D031; --oa-lime-dark: #96B020; --oa-lime-text: #5F7C10; --oa-lime-light: #E9F2C0; --oa-lime-tint: #F6FAE6;
  --oa-charcoal: #403F3F; --oa-charcoal-dark: #2B2B2B; --oa-grey: #999D9F; --oa-grey-mid: #C9CCCE; --oa-grey-light: #EDEEEF;
  --oa-text-secondary: #6B6F71; --oa-bg: #F8F9F9; --oa-white: #fff; --oa-danger: #B3261E; --oa-warn: #B7791F; --oa-info: #2F6FB3;
  --font-head: "Montserrat", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --radius: 12px; --shadow: 0 4px 20px rgba(64,63,63,.08); --side-w: 236px; --top-h: 64px;
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: .95rem; line-height: 1.5; color: var(--oa-charcoal); background: var(--oa-bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; margin: 0; letter-spacing: .02em; }
a { color: var(--oa-lime-text); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--oa-text-secondary); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--oa-charcoal); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 999; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--oa-lime); outline-offset: 2px; }

/* buttons — one line, centred text (site rule) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; font-family: var(--font-head); font-weight: 600; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; line-height: 1; padding: .95em 1.4em; border-radius: 999px; border: 2px solid var(--oa-charcoal); background: var(--oa-charcoal); color: #fff; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--oa-charcoal-dark); border-color: var(--oa-charcoal-dark); }
.btn-lime { background: var(--oa-lime); border-color: var(--oa-lime); color: var(--oa-charcoal-dark); }
.btn-lime:hover { background: var(--oa-lime-dark); border-color: var(--oa-lime-dark); }
.btn-ghost { background: transparent; color: var(--oa-charcoal); border-color: var(--oa-grey-mid); }
.btn-ghost:hover { border-color: var(--oa-charcoal); background: #fff; }
.btn-danger { background: var(--oa-danger); border-color: var(--oa-danger); color: #fff; }
.btn-danger:hover { background: #8f1d17; border-color: #8f1d17; }
.btn-sm { font-size: .72rem; padding: .75em 1.1em; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-family: var(--font-head); font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--oa-text-secondary); white-space: nowrap; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; padding: 12px 14px; border: 1.5px solid var(--oa-grey-mid); border-radius: 10px; background: #fff; min-height: 46px; font-size: 1rem; }
/* placeholders never get clipped: they shrink to the field width instead of running off the edge */
.field input::placeholder { font-size: .9em; color: var(--oa-grey); overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) { .field input::placeholder { font-size: .8em; } }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--oa-lime-dark); outline: none; box-shadow: 0 0 0 3px var(--oa-lime-light); }
.field.is-err input { border-color: var(--oa-danger); }
.check { display: flex; align-items: center; gap: 10px; margin: 10px 0 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--oa-lime-dark); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.err { color: var(--oa-danger); font-size: .9rem; margin: 4px 0 10px; }

/* login */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, var(--oa-charcoal-dark), var(--oa-charcoal) 70%); }
.login-card { width: min(100%, 440px); background: #fff; border-radius: 18px; padding: 36px 34px 26px; box-shadow: 0 30px 80px rgba(0,0,0,.35); border-inline-start: 6px solid var(--oa-lime); }
.login-logo { height: 44px; margin-bottom: 22px; }
.login h1 { font-size: 1.3rem; margin-bottom: 6px; }
.login .muted { margin: 0 0 20px; font-size: .92rem; }
.login .actions { display: grid; }
.login-foot { margin: 18px 0 0; text-align: center; font-size: .82rem; }

/* shell */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; min-height: 100dvh; }
.side { background: var(--oa-charcoal-dark); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; }
.side-logo { display: block; padding: 20px 22px 14px; }
.side-logo img { height: 36px; display: block; }
.nav { display: grid; gap: 2px; padding: 8px 12px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 10px; color: #E6E7E8; text-decoration: none; font-family: var(--font-head); font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; border-inline-start: 3px solid transparent; }
.nav a:hover { background: rgba(255,255,255,.06); }
.nav a.is-on { background: rgba(180,208,49,.14); border-inline-start-color: var(--oa-lime); color: #fff; }
.nav svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .badge { margin-inline-start: auto; background: var(--oa-lime); color: var(--oa-charcoal-dark); border-radius: 999px; font-size: .7rem; padding: 2px 8px; }
.side-foot { margin-top: auto; padding: 14px 20px 20px; }
.lang { display: inline-flex; border: 1.5px solid rgba(255,255,255,.25); border-radius: 999px; overflow: hidden; }
.lang button { background: none; border: 0; color: #E6E7E8; padding: 6px 12px; font-family: var(--font-head); font-size: .72rem; font-weight: 600; cursor: pointer; }
.lang button.is-on { background: var(--oa-lime); color: var(--oa-charcoal-dark); }
.lang-top { display: none; border-color: var(--oa-grey-mid); }
.lang-top button { color: var(--oa-charcoal); }
.body { min-width: 0; display: flex; flex-direction: column; }
.top { height: var(--top-h); display: flex; align-items: center; gap: 16px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--oa-grey-light); position: sticky; top: 0; z-index: 5; }
.top-title { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .1em; }
.top-user { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-chip { font-size: .85rem; color: var(--oa-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.user-chip b { color: var(--oa-charcoal); }
.main { padding: 24px 28px 40px; }

/* cards & KPI */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; border-inline-start: 4px solid var(--oa-lime); min-width: 0; }
.card h3 { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--oa-lime-text); margin-bottom: 12px; white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; border-inline-start: 4px solid var(--oa-grey-mid); min-width: 0; }
.kpi.is-hot { border-inline-start-color: var(--oa-lime); }
.kpi .v { font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.kpi .l { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--oa-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stack { display: grid; gap: 16px; }

/* toolbar, tables */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 260px; min-width: 0; }
.toolbar input[type="search"] { width: 100%; padding: 11px 14px; border: 1.5px solid var(--oa-grey-mid); border-radius: 999px; background: #fff; min-height: 44px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--oa-grey-mid); background: #fff; border-radius: 999px; padding: 7px 12px; font-size: .78rem; cursor: pointer; white-space: nowrap; }
.chip.is-on { background: var(--oa-charcoal); border-color: var(--oa-charcoal); color: #fff; }
.tbl-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: start; font-family: var(--font-head); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--oa-text-secondary); padding: 12px 14px; border-bottom: 1px solid var(--oa-grey-light); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--oa-grey-light); vertical-align: middle; white-space: nowrap; }
tr.row { cursor: pointer; }
tr.row:hover td { background: var(--oa-lime-tint); }
td.num { text-align: end; font-variant-numeric: tabular-nums; }
.empty { padding: 28px; text-align: center; color: var(--oa-text-secondary); }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .85em; }

/* status pills — one line each */
.st { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; background: var(--oa-grey-light); color: var(--oa-charcoal); }
.st-sent { background: var(--oa-lime-light); color: var(--oa-lime-text); }
.st-confirmed { background: #DDEBFA; color: var(--oa-info); }
.st-completed { background: var(--oa-grey-light); color: var(--oa-text-secondary); }
.st-cancel_requested, .st-reschedule_requested { background: #FBEBD0; color: var(--oa-warn); }
.st-cancelled, .st-deleted { background: #F7DBD9; color: var(--oa-danger); }
.dot-review { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--oa-warn); margin-inline-start: 6px; vertical-align: middle; }

/* list rows (dashboard, day list) */
.list { display: grid; gap: 8px; }
.li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--oa-bg); cursor: pointer; min-width: 0; }
.li:hover { background: var(--oa-lime-tint); }
.li .d { font-family: var(--font-head); font-weight: 700; white-space: nowrap; }
.li .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .t small { color: var(--oa-text-secondary); }
.li.ev { border-inline-start: 3px solid var(--oa-grey-mid); cursor: pointer; }
.li.ev-maintenance { border-inline-start-color: var(--oa-warn); } .li.ev-leave { border-inline-start-color: var(--oa-grey); } .li.ev-block { border-inline-start-color: var(--oa-danger); } .li.ev-training { border-inline-start-color: var(--oa-info); }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-head h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .08em; min-width: 12ch; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-family: var(--font-head); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--oa-text-secondary); text-align: center; padding: 4px 0; }
.day { background: #fff; border-radius: 10px; box-shadow: var(--shadow); min-height: 104px; padding: 6px; cursor: pointer; border: 1.5px solid transparent; min-width: 0; }
.day.is-out { opacity: .45; }
.day.is-today { border-color: var(--oa-lime); }
.day.is-sel { background: var(--oa-lime-tint); }
.day .n { font-family: var(--font-head); font-size: .8rem; font-weight: 700; margin-bottom: 4px; }
.pill { display: block; font-size: .7rem; padding: 2px 6px; border-radius: 6px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--oa-lime-light); color: var(--oa-lime-text); }
.pill.p-confirmed { background: #DDEBFA; color: var(--oa-info); } .pill.p-cancel_requested, .pill.p-reschedule_requested { background: #FBEBD0; color: var(--oa-warn); } .pill.p-completed { background: var(--oa-grey-light); color: var(--oa-text-secondary); }
.pill.p-ev { background: var(--oa-grey-light); color: var(--oa-charcoal); } .pill.p-ev-maintenance { background: #FBEBD0; color: var(--oa-warn); } .pill.p-ev-block { background: #F7DBD9; color: var(--oa-danger); }
.day-panel { margin-top: 16px; }

/* side panel */
.panel { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; }
.panel-backdrop { position: absolute; inset: 0; background: rgba(43,43,43,.55); backdrop-filter: blur(2px); touch-action: none; }
.panel-dialog { position: relative; width: min(100%, 640px); height: 100%; background: var(--oa-bg); box-shadow: -20px 0 60px rgba(0,0,0,.25); display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; background: #fff; border-bottom: 1px solid var(--oa-grey-light); flex: none; }
.panel-head h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x { margin-inline-start: auto; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--oa-grey-mid); background: #fff; cursor: pointer; position: relative; flex: none; }
.x span::before, .x span::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 2px; background: var(--oa-charcoal); transform: translate(-50%,-50%) rotate(45deg); }
.x span::after { transform: translate(-50%,-50%) rotate(-45deg); }
.panel-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px 24px 40px; -webkit-overflow-scrolling: touch; }
.sec { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 14px; border-inline-start: 4px solid var(--oa-lime); }
.sec h3 { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--oa-lime-text); margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--oa-text-secondary); white-space: nowrap; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pax { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 14px; align-items: center; font-size: .92rem; }
.pax .h { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--oa-text-secondary); }
.hist { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.hist li { display: grid; grid-template-columns: max-content 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--oa-grey-light); }
.hist time { color: var(--oa-text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.big { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; white-space: nowrap; }
.warn { background: #FBEBD0; color: var(--oa-warn); border-inline-start: 4px solid var(--oa-warn); border-radius: 10px; padding: 10px 14px; font-size: .9rem; margin-bottom: 14px; }
.ok { background: var(--oa-lime-tint); color: var(--oa-lime-text); border-inline-start: 4px solid var(--oa-lime); border-radius: 10px; padding: 10px 14px; font-size: .9rem; margin-bottom: 14px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--oa-charcoal-dark); color: #fff; padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow); z-index: 90; font-size: .9rem; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.toast.is-err { background: var(--oa-danger); }

/* -------- tablets / phones (rule 14.09.2026): ≤1080 bottom navigation, ≤760 one column + card tables -------- */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; flex-direction: row; align-items: center; padding: 0 6px env(safe-area-inset-bottom); z-index: 20; border-top: 1px solid rgba(255,255,255,.08); }
  .side-logo, .side-foot { display: none; }
  .nav { display: flex; width: 100%; padding: 4px 0; gap: 0; }
  .nav a { flex: 1 1 0; flex-direction: column; gap: 3px; padding: 8px 2px; font-size: .58rem; letter-spacing: .04em; border-inline-start: 0; border-top: 3px solid transparent; border-radius: 0; min-width: 0; }
  .nav a.is-on { border-top-color: var(--oa-lime); background: none; }
  .nav .badge { position: absolute; margin: 0; transform: translate(14px, -6px); }
  .nav a { position: relative; }
  .top .lang-top { display: inline-flex; }
  .body { padding-bottom: 72px; }
  .main { padding: 18px 16px 40px; }
  .top { padding: 0 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: 1fr; }
  .panel-dialog { width: 100%; }
  .day { min-height: 74px; }
  .pill { font-size: .62rem; }
}
@media (max-width: 760px) {
  html, body { overflow-x: clip; }
  .top-title { font-size: .9rem; }
  .user-chip { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .kpi .v { font-size: 1.35rem; }
  /* tables become cards: each cell shows its header on the left */
  .tbl-wrap { background: none; box-shadow: none; overflow: visible; }
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tr.row, tr { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; padding: 8px 14px; border-inline-start: 4px solid var(--oa-lime); }
  td { display: grid; grid-template-columns: 38% 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--oa-grey-light); white-space: normal; text-align: start; }
  td:last-child { border-bottom: 0; }
  td::before { content: attr(data-l); font-family: var(--font-head); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--oa-text-secondary); white-space: nowrap; align-self: center; }
  td.num { text-align: start; }
  .day { min-height: 54px; padding: 4px; }
  .day .pill { display: none; }
  .day .cnt { display: inline-block; font-size: .66rem; background: var(--oa-lime-light); color: var(--oa-lime-text); border-radius: 999px; padding: 1px 6px; }
  .cal-head h2 { font-size: .9rem; }
  .btn-row .btn { flex: 1 1 auto; }
}
@media (min-width: 761px) { .day .cnt { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
