/* Trendy ERP — steel-navy command sidebar, light working canvas */
/* fonts bundled locally so the app works without internet */
@font-face { font-family: 'Oswald'; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/oswald-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Oswald'; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/oswald-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Oswald'; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/oswald-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); }

:root {
  --bg: #EEF1F4; --surface: #FBFCFD; --surface-2: #F3F5F8; --ink: #0F1B2D; --ink-2: #44525F; --muted: #66748A; --line: #D9DFE6;
  --accent: #2F5D8A; --accent-ink: #FBFCFD; --accent-soft: #E2EBF4;
  --bar: #13203A; --bar-2: #1C2C47; --bar-ink: #E9EEF3; --bar-muted: #9FB0C2; --steel: #8FB3D9;
  --brand-red: #D92D20;
  --ok: #1F6B4B; --ok-bg: #DFF1E7; --warn: #9A4A12; --warn-bg: #FBEBDC; --bad: #A8271E; --bad-bg: #FBE3E0; --info: #2F5D8A; --info-bg: #E2EBF4;
  --display: 'Oswald', 'Arial Narrow', Arial, sans-serif; --body: 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
  --r: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14.5px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; letter-spacing: .01em; text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.r { text-align: right; }

/* ---------- login ---------- */
.login { min-height: 100vh; background: radial-gradient(1200px 600px at 50% -10%, #24375A 0%, #13203A 55%, #0C1626 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 40px 16px; position: relative; }
.login::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, #5B6B7C, var(--steel), #C5CED8); }
.login-col { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.login-card { background: var(--surface); border-radius: 18px; padding: 26px 28px 28px; box-shadow: 0 30px 70px rgba(0, 0, 0, .4); display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
.login-logo { display: flex; justify-content: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.login-logo img { height: 74px; display: block; }
.login-ring { width: 124px; height: 124px; border-radius: 50%; margin: 2px auto 0; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: #A9B6C4; border: 3px solid var(--line); overflow: hidden; transition: border-color .4s, box-shadow .4s, transform .4s; }
.login-ring svg { width: 64px; height: 64px; }
.login-ring img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-ring.on { border-color: var(--accent); box-shadow: 0 0 0 6px rgba(47, 93, 138, .15); }
.login-initials { font-family: var(--display); font-size: 44px; font-weight: 500; color: #fff; background: var(--accent); width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
@media (prefers-reduced-motion: no-preference) { .login-ring.on { animation: pop .5s ease-out; } @keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } } }
.login-hello { text-align: center; }
.login-hello h2 { font-size: 26px; }
.login-opening { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo-box { border: 1px solid #2B3D59; border-radius: 14px; padding: 12px 14px; background: rgba(255, 255, 255, .04); }
.demo-box .lbl { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--bar-muted); font-weight: 600; }
.demo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.demo-list button { text-align: left; border: 1px solid #2B3D59; background: rgba(255, 255, 255, .05); color: var(--bar-ink); border-radius: 8px; padding: 6px 10px; cursor: pointer; line-height: 1.3; }
.demo-list button:hover { border-color: var(--steel); }
.demo-list b { display: block; font-size: 13px; font-weight: 600; }
.demo-list span { font-size: 12px; color: var(--bar-muted); }
.login-credit { text-align: center; font-size: 12.5px; color: var(--bar-muted); line-height: 1.6; }
.login-credit a { color: var(--steel); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--bar); color: var(--bar-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid #22324D; }
.side-brand .plate { background: #fff; border-radius: 8px; padding: 6px 10px; width: fit-content; }
.side-brand img { height: 38px; display: block; }
.side-brand strong { font-family: var(--display); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; font-size: 15px; color: var(--steel); }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; flex: 1; overflow: auto; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--bar-muted); text-decoration: none; font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--bar-2); color: var(--bar-ink); }
.nav a.active { background: var(--bar-2); color: #fff; box-shadow: inset 3px 0 0 var(--steel); }
.side-foot { padding: 14px 18px; border-top: 1px solid #22324D; font-size: 12px; color: var(--bar-muted); line-height: 1.45; }
.side-foot a { color: var(--steel); }
.main { display: flex; flex-direction: column; min-width: 0; }
.top { position: sticky; top: 0; z-index: 10; background: rgba(238, 241, 244, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 28px; }
.top h1 { font-size: 22px; }
.top-right { display: flex; align-items: center; gap: 10px; position: relative; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--brand-red); color: #fff; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.me-btn { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 14px 4px 5px; cursor: pointer; }
.me-btn:hover { border-color: var(--accent); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--steel); }
.avatar.xl { width: 56px; height: 56px; font-size: 19px; }
.avatar.xxl { width: 96px; height: 96px; font-size: 32px; }
.me-btn .who { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.me-btn .who b { font-size: 13.5px; font-weight: 500; }
.me-btn .who span { font-size: 12px; color: var(--muted); }
.pop { position: absolute; top: calc(100% + 8px); right: 0; width: 360px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 44px rgba(15, 27, 45, .18); z-index: 30; overflow: hidden; }
.pop-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.pop-head b { font-family: var(--display); font-weight: 500; font-size: 16px; }
.pop-list { max-height: 420px; overflow: auto; }
.pop-item { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pop-item:hover { background: var(--surface-2); }
.pop-item .dot { margin-top: 7px; }
.pop-item.unread { background: #F2F7FC; }
.pop-item small { display: block; color: var(--muted); font-size: 12px; }
.menu-list { display: flex; flex-direction: column; padding: 6px; }
.menu-list button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.menu-list button:hover { background: var(--surface-2); }
.page { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1360px; width: 100%; }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; }
  .side-brand { flex-direction: row; align-items: center; justify-content: space-between; }
  .nav { flex-direction: row; overflow-x: auto; padding: 8px; }
  .nav a { white-space: nowrap; }
  .side-foot { display: none; }
  .top { padding: 10px 16px; }
  .page { padding: 18px 16px 40px; }
  .me-btn .who { display: none; }
}

/* ---------- building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { font-size: 18px; }
.card-body { padding: 16px 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.cols-3-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 1100px) { .cols-2, .cols-3-1 { grid-template-columns: 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.kpi { padding: 14px 18px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; text-decoration: none; color: inherit; }
.kpi:first-child { border-left: 0; }
.kpi .lbl { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi .val { font-family: var(--display); font-size: 30px; font-weight: 500; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal .kpi .val { font-size: 22px; }
.kpi .sub { font-size: 12.5px; color: var(--ink-2); }
.kpi.ok .val { color: var(--ok); } .kpi.warn .val { color: var(--warn); } .kpi.bad .val { color: var(--bad); } .kpi.info .val { color: var(--accent); }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi:nth-child(3) { border-left: 0; } .kpi:nth-child(n+3) { border-top: 1px solid var(--line); } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: #E4B7B2; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 1px 10px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); } .pill.neutral { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; display: inline-block; }
.dot.ok { color: var(--ok); } .dot.warn { color: var(--warn); } .dot.bad { color: var(--bad); } .dot.info { color: var(--accent); }
.chip { display: inline-block; font-size: 12px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; padding: 0 7px; margin: 1px 3px 1px 0; }
.progress { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar { flex: 1; height: 7px; border-radius: 4px; background: #E3E8EE; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar.done i { background: var(--ok); }
.progress span { font-size: 12.5px; font-weight: 600; width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 9px 14px 11px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters > * { flex: 0 1 auto; }
.filters .grow { flex: 1 1 240px; }
.empty { padding: 36px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-2); }
.empty h3 { font-size: 18px; color: var(--ink); }
.empty p { margin: 0; max-width: 48ch; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--info-bg); flex-wrap: wrap; }
.banner.warn { background: var(--warn-bg); border-color: #EBCBAE; }
.banner.bad { background: var(--bad-bg); border-color: #E9BDB8; }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #F7F9FB; }
.t tr.click { cursor: pointer; }
.t th.r, .t td.r { text-align: right; }
.t td.r { white-space: nowrap; }
.t .strong { font-weight: 500; }
.t .sub { font-size: 12.5px; color: var(--muted); }
.loc { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; font-size: 12.5px; white-space: nowrap; }
.loc span { padding: 1px 7px; }
.loc span + span { border-left: 1px solid var(--line); }
.loc span:first-child { background: var(--surface-2); font-weight: 500; }
.month-nav { display: flex; align-items: center; gap: 10px; }
.month-nav h2 { font-size: 24px; min-width: 9ch; }

/* lists */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: flex-start; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.li:last-child { border-bottom: 0; }
a.li:hover { background: var(--surface-2); }
.li .grow { flex: 1; min-width: 0; }
.li .meta { font-size: 12.5px; color: var(--muted); }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.tl { display: flex; gap: 12px; }
.tl .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.tl .ic svg { width: 15px; height: 15px; }
.tl .body { flex: 1; min-width: 0; }
.tl .body p { margin: 2px 0 0; white-space: pre-wrap; }
.msgs { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; padding: 2px; }
.msg { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; max-width: 85%; }
.msg.me { background: var(--accent-soft); border-color: #C9D9EA; align-self: flex-end; }
.msg b { font-size: 12.5px; color: var(--accent); }
.msg p { margin: 2px 0 0; white-space: pre-wrap; }
.msg small { color: var(--muted); font-size: 11.5px; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .status-grid { grid-template-columns: 1fr; } }
.flat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.flat { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.flat b { font-family: var(--display); font-weight: 500; font-size: 18px; }
.flat.available { border-color: #A9D3BD; background: #F3FAF6; }
.flat.booked { border-color: #EBCBAE; background: #FDF6EF; }
.flat.sold { border-color: var(--line); background: var(--surface-2); }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > .lbl { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .03em; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 11px; width: 100%; min-width: 0; }
.textarea { min-height: 80px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(47, 93, 138, .15); }
.input.sm, .select.sm { padding: 5px 9px; font-size: 13.5px; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.span-2 { grid-column: span 2; }
.err { color: var(--bad); font-size: 13.5px; min-height: 1.2em; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; }
.form-section { font-family: var(--display); font-size: 15px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.calc { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.calc b { font-family: var(--display); font-weight: 500; font-size: 20px; color: var(--accent); }
.pct-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.pct-btns button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-weight: 500; }
.pct-btns button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* modal */
.scrim { position: fixed; inset: 0; background: rgba(8, 14, 24, .5); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px 24px; overflow: auto; z-index: 50; }
.modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); display: flex; flex-direction: column; }
.modal.wide { max-width: 1000px; }
.modal-head { padding: 18px 22px 10px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-head h2 { font-size: 22px; }
.modal-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.modal-body { padding: 8px 22px 16px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 12px 22px 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.modal-foot .right { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--bar); color: var(--bar-ink); padding: 10px 18px; border-radius: 10px; z-index: 80; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); font-size: 14px; }
.toast.bad { background: var(--bad); color: #fff; }
.dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; }
.dl div { min-width: 0; }
.dl dt { font-size: 12px; color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 620px) { .dl { grid-template-columns: 1fr 1fr; } }

/* attachments & item tables */
.attach-box { display: flex; flex-direction: column; gap: 10px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.file-tile { position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.file-thumb { display: flex; align-items: center; justify-content: center; height: 110px; background: var(--surface-2); text-decoration: none; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-pdf { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--bad); font-weight: 600; font-size: 12px; }
.file-pdf svg { width: 34px; height: 34px; }
.file-meta { padding: 6px 9px; display: flex; flex-direction: column; min-width: 0; }
.file-meta a { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); text-decoration: none; }
.file-meta span { font-size: 11.5px; color: var(--muted); }
.file-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .92); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-2); }
.file-x svg { width: 14px; height: 14px; }
.file-x:hover { color: var(--bad); border-color: var(--bad); }
.items-t td { padding: 5px 6px; }
.items-t .input.sm { padding: 5px 8px; }

/* meetings */
.date-block { width: 46px; flex: none; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; align-items: center; overflow: hidden; line-height: 1.1; }
.date-block span { width: 100%; text-align: center; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 2px 0; }
.date-block b { font-family: var(--display); font-weight: 500; font-size: 20px; padding: 3px 0 4px; }
.date-block.emer span { background: var(--bad); }
.icon-btn.pulse { border-color: var(--bad); color: var(--bad); }
@media (prefers-reduced-motion: no-preference) { .icon-btn.pulse { animation: pulse 1.4s ease-in-out infinite; } @keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(168, 39, 30, .18); } } }
.emer-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(60, 8, 6, .62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.emer-card { width: 100%; max-width: 520px; background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.emer-top { background: #A8271E; color: #fff; font-family: var(--display); letter-spacing: .12em; font-size: 18px; padding: 14px 20px; display: flex; align-items: center; gap: 10px; }
.emer-top svg { width: 22px; height: 22px; }
@media (prefers-reduced-motion: no-preference) { .emer-card { animation: shake .5s ease-in-out; } @keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } } }
.emer-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.emer-body h2 { font-size: 26px; }
.emer-when { font-size: 18px; font-weight: 600; color: #A8271E; }
.emer-place { font-weight: 500; }
.emer-body p { margin: 0; white-space: pre-wrap; color: var(--ink-2); }

/* chat */
.chat-dock { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.chat-bubble { position: relative; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; box-shadow: 0 10px 28px rgba(15, 27, 45, .3); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.chat-bubble svg { width: 26px; height: 26px; }
.chat-bubble .badge { top: -3px; right: -3px; min-width: 22px; height: 22px; font-size: 12px; border: 2px solid #fff; }
.chat-bubble:hover { filter: brightness(1.1); }
.chat-panel { width: 360px; height: min(560px, calc(100vh - 110px)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(15, 27, 45, .28); display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chat-head > b { flex: 1; font-family: var(--display); font-weight: 500; font-size: 18px; }
.chat-head .icon-btn { width: 32px; height: 32px; border: 0; }
.chat-list { flex: 1; overflow: auto; }
.chat-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 0; background: none; text-align: left; cursor: pointer; }
.chat-row:hover { background: var(--surface-2); }
.chat-av { position: relative; flex: none; display: inline-flex; }
.online-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #2DB06B; border: 2px solid #fff; }
.chat-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-row-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-row-top b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row-top small { color: var(--muted); flex: none; }
.chat-row-last { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.unread .chat-row-last { color: var(--ink); font-weight: 600; }
.chat-unread { flex: none; min-width: 20px; height: 20px; border-radius: 10px; background: var(--brand-red); color: #fff; font-size: 11.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.chat-msgs { flex: 1; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); }
.chat-day { align-self: center; font-size: 11.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; margin: 6px 0; }
.chat-msg { max-width: 78%; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 7px 10px; display: flex; flex-direction: column; gap: 4px; }
.chat-msg.mine { align-self: flex-end; background: var(--accent); border-color: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg small { font-size: 10.5px; opacity: .7; align-self: flex-end; }
.chat-img img { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; }
.chat-file { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: inherit; }
.chat-file svg { width: 18px; height: 18px; }
.chat-compose { display: flex; align-items: flex-end; gap: 4px; padding: 8px; border-top: 1px solid var(--line); }
.chat-compose .icon-btn { width: 34px; height: 34px; border: 0; flex: none; }
.chat-compose .send { color: var(--accent); }
.chat-input { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 18px; padding: 7px 12px; max-height: 110px; min-width: 0; }
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-toast { position: fixed; right: 20px; bottom: 90px; z-index: 70; display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 10px 14px; box-shadow: 0 14px 34px rgba(15, 27, 45, .22); max-width: 320px; cursor: pointer; font-size: 13.5px; }
@media (max-width: 620px) {
  .chat-dock { right: 12px; bottom: 12px; }
  .chat-panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; }
  .chat-dock.open .chat-bubble { display: none; }
}
@media print { .chat-dock, .chat-toast, .emer-scrim { display: none !important; } }

/* about */
.credits { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: center; }
.credits img { width: 100%; max-width: 220px; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; border: 3px solid var(--line); }
.credit-lbl { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.credit-val { font-family: var(--display); font-size: 28px; font-weight: 500; line-height: 1.2; }
@media (max-width: 620px) { .credits { grid-template-columns: 1fr; } }

/* print */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; color: #111; }
  .pr-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #13203A; padding-bottom: 10px; margin-bottom: 14px; }
  .pr-head img { height: 54px; }
  .pr-head .co { text-align: right; font-size: 11px; color: #444; }
  .pr-head .co b { font-family: var(--display); font-size: 16px; color: #13203A; display: block; }
  .pr-title { font-family: var(--display); font-size: 20px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 10px; color: #13203A; }
  .pr-meta { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 12px; }
  .pr table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
  .pr th, .pr td { border: 1px solid #999; padding: 5px 8px; text-align: left; font-size: 11.5px; }
  .pr th { background: #EEF1F4; }
  .pr td.r, .pr th.r { text-align: right; }
  .pr h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 6px; color: #13203A; }
  .pr .kv td:first-child { width: 32%; background: #F6F7F9; font-weight: 600; }
  .pr .sign { display: flex; justify-content: space-between; margin-top: 48px; gap: 40px; }
  .pr .sign div { flex: 1; border-top: 1px solid #333; padding-top: 4px; text-align: center; font-size: 11px; }
  .pr .big { font-size: 16px; font-weight: 700; }
  .pr .words { font-style: italic; }
  .pr { position: relative; }
  .stamp { position: absolute; top: 4px; left: 50%; transform: translateX(-50%) rotate(-6deg); background: rgba(255,255,255,.85); border: 3px solid #1F6B4B; color: #1F6B4B; border-radius: 8px; padding: 6px 14px; text-align: center; font-family: var(--display); letter-spacing: .08em; opacity: .9; }
  .stamp b { display: block; font-size: 18px; }
  .stamp span { display: block; font-size: 10px; letter-spacing: .02em; font-family: var(--body); }
  .stamp.rejected { border-color: #A8271E; color: #A8271E; }
  .stamp.pending { border-color: #9A4A12; color: #9A4A12; }
  .pr-attach { page-break-before: always; break-before: page; }
  .pr-attach img { max-width: 100%; max-height: 235mm; display: block; margin: 0 auto; border: 1px solid #ccc; }
  .pr-foot { margin-top: 24px; font-size: 10px; color: #666; border-top: 1px solid #ccc; padding-top: 6px; }
}

.side-sub { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--bar-muted); margin-top: -8px; }

/* demo phone: shows the SMS sign-in code on screen when no real SMS gateway is set up */
.demo-phone { background: #111; color: #fff; border-radius: 22px; padding: 14px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); }
.demo-phone-top { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #9aa; text-align: center; }
.demo-sms { background: #2B2B2E; border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.demo-sms b { display: block; font-size: 11.5px; color: #8fb3d9; letter-spacing: .08em; }
.login-col .demo-phone { margin: 0 auto; }
@media print { .demo-phone { display: none !important; } }

/* licence banner and page */
.lic-banner { margin: 16px 28px 0; padding: 10px 14px; border-radius: var(--r); border: 1px solid #EBCBAE; background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.lic-banner.bad { border-color: #E9BDB8; background: var(--bad-bg); color: var(--bad); }
.lic-key { width: 100%; min-height: 110px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.lic-state { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lic-big { font-family: var(--display); font-size: 34px; line-height: 1.1; }
@media (max-width: 760px) { .lic-banner { margin: 12px 16px 0; } }

/* pop-up notifications: the "turn on" card and the line under the bell list */
.notify-card { position: fixed; right: 18px; bottom: 18px; z-index: 70; width: min(380px, calc(100vw - 32px)); display: flex; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .22); animation: notifyIn .25s ease-out; }
.notify-card .notify-ico { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--info-bg); color: var(--info); }
.notify-card .notify-ico svg { width: 20px; height: 20px; }
.notify-card .notify-txt { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.notify-card .notify-txt b { font-size: 15px; }
@keyframes notifyIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 600px) { .notify-card { left: 16px; right: 16px; bottom: 16px; width: auto; } }
.pop-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); }
