:root {
  --bg: #05070f; --side: #080b17; --panel: #0d1222; --panel-2: #121930;
  --line: rgba(255, 255, 255, 0.09); --line-strong: rgba(255, 255, 255, 0.18);
  --text: #eef1fb; --muted: #9aa3bd; --accent: #5674ff; --accent-2: #86d3ff;
  --ok: #4fd18b; --warn: #f2b84b; --bad: #ff7676;
  --display: "Sora", "Segoe UI", system-ui, sans-serif; --body: "Inter", "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.55rem; } h2 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--accent-2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.loading { padding: 80px 24px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 0.85rem; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.04); font-weight: 600; font-size: 0.9rem; cursor: pointer; text-decoration: none; color: var(--text); transition: background 0.2s, border-color 0.2s; }
.btn:hover { border-color: var(--accent); background: rgba(86, 116, 255, 0.14); }
.btn.primary { background: linear-gradient(135deg, #5674ff, #3447d6); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.danger:hover { border-color: var(--bad); background: rgba(255, 118, 118, 0.12); }
.btn.sm { padding: 6px 12px; min-height: 32px; font-size: 0.82rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
label { display: grid; gap: 6px; font-size: 0.82rem; font-weight: 500; color: #c6cde3; }
input, select, textarea { width: 100%; background: rgba(5, 7, 15, 0.7); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; font-size: 0.95rem; color: var(--text); }
select option { background: #0d1222; }
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(86, 116, 255, 0.22); }
input[type="date"] { color-scheme: dark; }
.fields { display: grid; gap: 14px; }
.fields .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.error { color: var(--bad); font-size: 0.88rem; min-height: 1.3em; }

/* Auth screen */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(800px 500px at 80% -10%, rgba(86, 116, 255, 0.2), transparent 60%), radial-gradient(600px 400px at 0% 110%, rgba(134, 211, 255, 0.08), transparent 60%); }
.auth-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 36px 32px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8); }
.auth-card img { height: 64px; width: auto; margin: 0 auto 22px; display: block; }
.auth-card h1 { text-align: center; margin-bottom: 6px; }
.auth-card .muted { text-align: center; margin-bottom: 24px; }
.auth-card .btn { width: 100%; min-height: 46px; }
.auth-back { display: block; text-align: center; margin-top: 18px; font-size: 0.86rem; color: var(--muted); }

/* Shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.side .logo img { height: 46px; width: auto; margin: 0 8px 20px; }
.side button.tab { text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.side button.tab:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.side button.tab.active { background: rgba(86, 116, 255, 0.16); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: 0.72rem; padding: 1px 8px; font-weight: 600; }
.side .me { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid var(--line); }
.side .me strong { display: block; overflow-wrap: anywhere; }
.side .me .btn { margin-top: 12px; width: 100%; }
.main { padding: 30px clamp(18px, 3vw, 40px) 60px; min-width: 0; }
.head { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.head input[type="date"], .head select { width: auto; }

/* Cards, stats, tables */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.card + .card, .stats + .card, .cols + .card { margin-top: 18px; }
.card > h2 { margin-bottom: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.stat b { display: block; font: 700 1.9rem var(--display); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.84rem; }
.stat.alert b { color: var(--bad); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols .card + .card { margin-top: 0; }
.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 22px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 22px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.wrap { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 240px; }
td.nowrap, .nowrap { white-space: nowrap; }
td.right { text-align: right; }
.empty { padding: 30px 0 8px; text-align: center; color: var(--muted); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(79, 209, 139, 0.4); }
.pill.warn { color: var(--warn); border-color: rgba(242, 184, 75, 0.4); }
.pill.bad { color: var(--bad); border-color: rgba(255, 118, 118, 0.4); }
.pill.info { color: var(--accent-2); border-color: rgba(134, 211, 255, 0.4); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.task-title { font-weight: 600; }
.task-desc { color: var(--muted); font-size: 0.85rem; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
td select { padding: 6px 8px; font-size: 0.85rem; min-width: 120px; }
.clockbox { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.clockbox .times { display: flex; gap: 28px; }
.clockbox b { display: block; font: 700 1.5rem var(--display); font-variant-numeric: tabular-nums; }

/* Modal & toast */
dialog { border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel-2); color: var(--text); padding: 26px; width: min(520px, calc(100% - 28px)); max-height: calc(100vh - 40px); }
dialog::backdrop { background: rgba(2, 3, 8, 0.7); backdrop-filter: blur(4px); }
dialog h2 { margin-bottom: 18px; font-size: 1.2rem; }
dialog .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
#toast { position: fixed; bottom: 22px; left: 50%; translate: -50% 20px; background: #1a2340; border: 1px solid var(--line-strong); padding: 11px 20px; border-radius: 12px; font-size: 0.9rem; opacity: 0; pointer-events: none; transition: opacity 0.25s, translate 0.25s; z-index: 50; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; translate: -50% 0; }
#toast.bad { border-color: var(--bad); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .logo { width: 100%; } .side .logo img { height: 36px; margin: 0 4px 6px; }
  .side button.tab { padding: 8px 12px; gap: 8px; }
  .side button.tab.active { box-shadow: none; }
  .side .me { margin: 6px 0 0; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px 2px; }
  .side .me .btn { width: auto; margin: 0; }
  .cols, .fields .two { grid-template-columns: 1fr; }
}

/* Brand, division sign-up and client request threads */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.92rem; letter-spacing: 0.2em; text-transform: uppercase; color: #fff; text-decoration: none; }
.brand img { width: 30px; height: 30px; margin: 0; }
.brand-img { height: 58px; width: auto; }
.side .logo { display: block; margin: 0 8px 22px; text-decoration: none; }
.side .logo img.brand-img { height: 52px; margin: 0; }
.side .logo .brand img { height: 30px; margin: 0; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-card .auth-brand img { margin: 0; }
.auth-card .brand img { height: 34px; width: 34px; }
.center { text-align: center; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }
.seg button { border: 0; background: none; padding: 8px 6px; border-radius: 9px; cursor: pointer; font-size: 0.84rem; font-weight: 600; color: var(--muted); }
.seg button.on { background: rgba(255, 255, 255, 0.14); color: #fff; }
.thread { display: grid; gap: 14px; }
.msg { max-width: min(640px, 92%); padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.msg.from-team { justify-self: end; background: rgba(86, 116, 255, 0.12); border-color: rgba(86, 116, 255, 0.35); }
.msg-head { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; margin-bottom: 6px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.head label.small { display: flex; align-items: center; gap: 8px; }
@media (max-width: 860px) { .side .logo { margin: 0 4px 6px; width: 100%; } }

/* Original Stenkepler logo in the portal */
.brand-img.corp { height: 46px; }
.auth-card .brand-img { height: 64px; }

/* Hiring, sales desk and AI manager */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; color: var(--muted); cursor: pointer; font-size: 0.84rem; font-weight: 500; }
.chip.on { background: rgba(86, 116, 255, 0.18); color: #fff; border-color: var(--accent); }
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #5674ff, #86d3ff); }
.bar.big { height: 14px; margin-top: 10px; }
.dim-h { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 0.9rem; }
.dims { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 16px 0; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li { padding: 10px 12px 10px 38px; border: 1px solid var(--line); border-radius: 10px; position: relative; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check-list li::before { content: ""; position: absolute; left: 12px; top: 13px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); }
.check-list li.ok { border-color: rgba(79, 209, 139, 0.4); }
.check-list li.ok::before { background: var(--ok); border-color: var(--ok); }
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
.pipeline div { padding: 10px; border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.pipeline b { display: block; font: 700 1.3rem var(--display); } .pipeline span { font-size: 0.74rem; color: var(--muted); }
.msg.unread { box-shadow: 0 0 0 2px rgba(86, 116, 255, 0.5); }
.brand-img.corp { height: 46px; }


/* ---------- Phone and tablet ---------- */
.tabs { display: flex; flex-direction: column; gap: 6px; }
button, .btn, select, input, textarea { touch-action: manipulation; }
@media (pointer: coarse) { .btn.sm, .chip { min-height: 40px; } .btn { min-height: 44px; } }
@media (max-width: 860px) {
  .side { position: sticky; top: 0; z-index: 15; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "logo me" "tabs tabs"; align-items: center; gap: 0 12px; padding: 8px 14px 0; background: rgba(8, 11, 23, 0.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .side .logo { grid-area: logo; width: auto; margin: 0; display: flex; align-items: center; min-height: 48px; }
  .side .logo img.brand-img, .side .logo .brand-img { height: 36px; margin: 0; }
  .side .me { grid-area: me; margin: 0; width: auto; padding: 0; border: 0; display: flex; align-items: center; gap: 10px; }
  .side .me div span { display: none; }
  .side .me strong { font-size: 0.82rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side .me .btn { min-height: 40px; }
  .tabs { grid-area: tabs; flex-direction: row; gap: 2px; overflow-x: auto; margin: 0 -14px; padding: 0 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line); }
  .tabs::-webkit-scrollbar { display: none; }
  .side button.tab { flex: none; white-space: nowrap; min-height: 46px; padding: 0 14px; border-radius: 0; gap: 8px; box-shadow: none; border-bottom: 3px solid transparent; }
  .side button.tab.active { background: none; border-bottom-color: var(--accent); box-shadow: none; }
  .main { padding: 20px 16px 48px; }
  h1 { font-size: 1.35rem; }
  .head { gap: 10px; }
  .head .actions { width: 100%; }
  .head .actions .btn { flex: 1 1 auto; }
  .head input[type="date"], .head select { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 14px; } .stat b { font-size: 1.5rem; }
  .card { padding: 18px 16px; }
  .cols { gap: 14px; }
  dialog { width: calc(100% - 20px); padding: 20px 16px; border-radius: 16px; }
  input, select, textarea { font-size: 16px; min-height: 46px; }
  textarea { min-height: 90px; }
  .row-actions { justify-content: flex-start; }
  .msg { max-width: 100%; }
  .auth { padding: 16px; align-items: start; padding-top: 6vh; }
  .auth-card { padding: 28px 20px; }
  #toast { bottom: 14px; width: calc(100% - 28px); text-align: center; }
}
@media (max-width: 640px) {
  /* table rows become cards */
  .table-wrap { overflow: visible; margin: 0; }
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  tbody tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; margin-bottom: 10px; background: rgba(255, 255, 255, 0.02); }
  tbody tr:last-child td { border-bottom: 0; }
  td { padding: 9px 0; border: 0; border-bottom: 1px solid var(--line); display: block; text-align: left; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  td.nowrap, .nowrap { white-space: normal; }
  td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
  td:first-child { font-size: 1rem; }
  td:first-child::before, td[data-label=""]::before, td:not([data-label])::before { display: none; }
  td.wrap { min-width: 0; white-space: pre-wrap; }
  td.right { text-align: left; }
  td select { min-width: 0; width: 100%; }
  .row-actions { justify-content: flex-start; }
  td .btn { flex: 1 1 auto; }
  .fields .two { grid-template-columns: 1fr; }
  .clockbox, .clockbox .times { gap: 14px; }
  .chat-form textarea { font-size: 16px; }
  .dims { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  dialog .foot { position: sticky; bottom: -20px; margin: 10px -16px -20px; padding: 12px 16px 16px; background: var(--panel-2); border-top: 1px solid var(--line); }
  dialog .foot .btn { flex: 1; }
}
.pipeline span { font-size: 0.78rem; }
td::before { font-size: 0.75rem; }


/* Division picker on the sign-in screen and the division view selector */
.divpick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 6px; }
.divcard { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 12px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(255, 255, 255, 0.03); cursor: pointer; color: var(--text); transition: border-color 0.2s, background 0.2s; }
.divcard:hover:not([disabled]) { border-color: var(--accent); background: rgba(86, 116, 255, 0.1); }
.divcard.on { border-color: var(--accent); background: rgba(86, 116, 255, 0.18); box-shadow: 0 0 0 2px rgba(86, 116, 255, 0.35); }
.divcard[disabled] { opacity: 0.45; cursor: not-allowed; }
.divcard strong { font-size: 0.92rem; }
.divcard small { color: var(--muted); font-size: 0.75rem; line-height: 1.35; }
.divlogo { height: 30px; display: flex; align-items: center; margin-bottom: 4px; }
.divlogo img { max-height: 30px; max-width: 100px; width: auto; border-radius: 4px; }
.viewdiv { display: grid; gap: 4px; margin: 0 8px 10px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.viewdiv select { text-transform: none; letter-spacing: normal; font-size: 0.88rem; min-height: 38px; padding: 6px 10px; }
@media (max-width: 860px) {
  .side { grid-template-areas: "logo me" "view view" "tabs tabs"; }
  .viewdiv { grid-area: view; grid-template-columns: auto 1fr; align-items: center; margin: 0 0 8px; }
}
@media (max-width: 420px) { .divpick { grid-template-columns: 1fr; } }


/* Staff / client switch, credentials sheet */
.seg.two { grid-template-columns: 1fr 1fr; }
.cred { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; background: rgba(5, 7, 15, 0.7); border: 1px solid var(--line-strong); border-radius: 12px; padding: 14px; font: 0.84rem/1.6 ui-monospace, Consolas, "Courier New", monospace; max-height: 42vh; overflow: auto; user-select: all; }
.cred-actions { justify-content: flex-start; flex-wrap: wrap; }
.cred-actions .btn { text-decoration: none; }
.auth-back.linklike { display: block; margin: 18px auto 0; background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; }

/* ---------- Requests: list, chat screen, side panels ---------- */
.reqbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.reqbar .chips { margin: 0; }
.reqbar input[type=search] { width: min(260px, 100%); }
tr.unread-row td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.rq-top { margin-bottom: 12px; }
.rq-h1 { font-size: clamp(1.25rem, 2.6vw, 1.7rem); overflow-wrap: anywhere; }
.rq-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; margin-top: 14px; }
.chatcard { padding: 0; display: flex; flex-direction: column; overflow: hidden; margin-top: 0 !important; }
.chat-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.chat-status .grow { flex: 1; }
.statusbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.thread-scroll { padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; max-height: min(60vh, 600px); min-height: 200px; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.day { align-self: center; font-size: 0.72rem; color: var(--muted); background: rgba(255, 255, 255, 0.06); padding: 3px 12px; border-radius: 99px; }
.evt { align-self: center; font-size: 0.78rem; color: var(--muted); text-align: center; max-width: 92%; }
.bub { display: flex; gap: 10px; align-items: flex-end; max-width: min(680px, 94%); align-self: flex-start; }
.bub.me { align-self: flex-end; flex-direction: row-reverse; }
.bub .av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 0.74rem; font-weight: 700; background: rgba(255, 255, 255, 0.1); color: var(--text); }
.bub.me .av { background: rgba(86, 116, 255, 0.4); }
.bub .box { min-width: 0; border: 1px solid var(--line); border-radius: 16px; border-bottom-left-radius: 5px; padding: 10px 14px; background: rgba(255, 255, 255, 0.045); }
.bub.me .box { border-radius: 16px; border-bottom-right-radius: 5px; background: rgba(86, 116, 255, 0.2); border-color: rgba(86, 116, 255, 0.45); }
.bub.note .box { background: rgba(242, 184, 75, 0.1); border: 1px dashed rgba(242, 184, 75, 0.55); }
.bub .who { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; font-size: 0.82rem; margin-bottom: 3px; }
.bub .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.bub .txt:empty { display: none; }
.notetag { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--warn); margin-bottom: 3px; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(5, 7, 15, 0.5); color: var(--text); text-decoration: none; font-size: 0.82rem; min-height: 36px; }
.file:hover { border-color: var(--accent); }
.file .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.file .fs { color: var(--muted); font-size: 0.74rem; }
.composer { border-top: 1px solid var(--line); padding: 12px 14px 14px; background: rgba(8, 11, 23, 0.7); }
.composer.closed { text-align: center; padding: 18px; }
.composer.closed p { margin: 0; }
.composer textarea { min-height: 46px; max-height: 170px; resize: none; }
.composer.is-note textarea { border-color: rgba(242, 184, 75, 0.7); background: rgba(242, 184, 75, 0.06); }
.composer .bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 10px; }
.composer .bar-l, .composer .bar-r { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.composer select { width: auto; min-height: 36px; padding: 6px 10px; font-size: 0.85rem; }
.composer label.check.inline { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 0.84rem; margin: 0; cursor: pointer; }
.composer label.check.inline input { width: 18px; height: 18px; min-height: 0; padding: 0; }
.composer .error { margin: 8px 0 0; }
.attach { cursor: pointer; }
.pendingfiles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pendingfiles:empty { display: none; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 0.82rem; }
.file-chip button { border: 0; background: rgba(255, 255, 255, 0.1); color: var(--text); border-radius: 50%; width: 24px; height: 24px; cursor: pointer; }
.rq-side { display: grid; gap: 14px; }
.rq-side .card { margin: 0 !important; }
.rq-side h2 { font-size: 1rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 10px 0 0; font-size: 0.88rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.starline { font-size: 1.3rem; letter-spacing: 3px; color: var(--warn); margin: 6px 0; }
.starpick { display: flex; gap: 4px; margin: 8px 0 12px; }
.star { border: 0; background: none; color: var(--muted); font-size: 2rem; line-height: 1; cursor: pointer; padding: 4px 6px; min-width: 44px; min-height: 44px; }
.star.on { color: var(--warn); }
.otherreqs { display: grid; gap: 8px; margin-top: 10px; }
.other { display: flex; justify-content: space-between; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--text); cursor: pointer; min-height: 44px; }
.other:hover { border-color: var(--accent); }
.other > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 960px) { .rq-layout { grid-template-columns: 1fr; } .rq-side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 640px) {
  .thread-scroll { max-height: min(56svh, 520px); min-height: 160px; padding: 14px 10px; }
  .bub { max-width: 100%; gap: 8px; } .bub .av { width: 30px; height: 30px; font-size: 0.68rem; }
  .chat-status { padding: 10px 12px; } .statusbtns { width: 100%; } .statusbtns .btn { flex: 1 1 auto; }
  .composer { padding: 10px 10px 12px; }
  .composer textarea { font-size: 16px; }
  .composer .bar-r { width: 100%; justify-content: space-between; } .composer .bar-r .btn { min-width: 110px; }
  .composer .hint { display: none; }
  .composer select { font-size: 16px; min-height: 44px; }
  .reqbar input[type=search] { width: 100%; }
  .file .fn { max-width: 150px; }
  .rq-side { grid-template-columns: 1fr; }
}

.kv a { display: inline-block; padding: 11px 0; }
.day, .bub .av, .badge { font-size: max(0.75rem, 12px); }
.bub .av { font-size: 0.75rem; }

/* ---------- onboarding, ID card, visiting card, staff records ---------- */
.notice { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.04); margin-bottom: 16px; font-size: .92rem; }
.notice strong { display: block; margin-bottom: 2px; }
.notice.small { padding: 8px 12px; margin: 6px 0 0; }
.notice.ok { border-color: rgba(79,209,139,.45); background: rgba(79,209,139,.08); }
.notice.warn { border-color: rgba(242,184,75,.45); background: rgba(242,184,75,.08); }
.notice.bad { border-color: rgba(255,118,118,.45); background: rgba(255,118,118,.08); }
.notice.info { border-color: rgba(134,211,255,.4); background: rgba(134,211,255,.07); }
.card + .notice, .notice + .card { margin-top: 16px; }
.progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin: 4px 0 10px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; transition: width .3s; }
.sub { font-size: .95rem; margin: 22px 0 8px; }
.docs { display: grid; gap: 0; margin-top: 8px; }
.docrow { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.docmain { min-width: 0; flex: 1; }
.doctitle { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.docmain p { margin-top: 3px; overflow-wrap: anywhere; }
.docact { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.docact label.btn { cursor: pointer; display: inline-flex; }
.otherform { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.otherform input { flex: 1; min-width: 180px; }
.submitbar { display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.submitbar p { margin-top: 2px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; font-weight: 400; color: var(--text); }
label.check input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 16px; }
.chip { border: 1px solid var(--line-strong); background: none; color: var(--muted); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 500; font-size: .86rem; }
.chip span { color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip.on { background: rgba(86,116,255,.18); color: #fff; border-color: var(--accent); }
.searchbar { padding-bottom: 14px; }
.recsummary { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 20px; }
.recsummary small { display: block; color: var(--muted); font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; }
.recsummary b { font-weight: 500; overflow-wrap: anywhere; }
.recsummary .wide { grid-column: 1 / -1; }
.thumb { display: block; margin-top: 6px; width: 64px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-strong); }

/* ID card: CR80 proportions (54 x 85.6 mm), scaled with --w */
.idsheet { margin: 6px 0 16px; }
.idpair { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.idc { --w: min(270px, calc(100vw - 88px)); width: var(--w); aspect-ratio: 54 / 85.6; font-size: calc(var(--w) / 18); border-radius: 1em; overflow: hidden; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.1em 1em; box-shadow: 0 24px 50px -24px rgba(0,0,0,.9); -webkit-print-color-adjust: exact; print-color-adjust: exact; flex-shrink: 0; }
.idc small { display: block; font-size: .6em; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.idc.front { color: #fff; background: radial-gradient(120% 60% at 50% 0%, rgba(86,116,255,.55), transparent 70%), linear-gradient(170deg, #141f52, #05070f 75%); border: 1px solid rgba(255,255,255,.18); }
.idc-top { display: flex; flex-direction: column; align-items: center; gap: .35em; }
.idc-top img { height: 2.1em; width: auto; max-width: 70%; object-fit: contain; }
.idc-top span { font-size: .55em; letter-spacing: .3em; opacity: .7; }
.idc-photo { width: 6.6em; height: 8.1em; margin: .9em 0 .7em; border-radius: .7em; overflow: hidden; border: .14em solid rgba(255,255,255,.85); background: #1a2340; display: grid; place-items: center; }
.idc-photo img { width: 100%; height: 100%; object-fit: cover; }
.idc-photo b { font: 700 2.2em "Sora", sans-serif; color: #86d3ff; }
.idc-name { font: 700 1.15em/1.2 "Sora", sans-serif; overflow-wrap: anywhere; }
.idc-role { color: #86d3ff; font-size: .82em; margin-top: .15em; }
.idc-div { font-size: .68em; opacity: .75; margin-top: .15em; }
.idc-meta { margin-top: auto; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: .5em; padding-top: .7em; border-top: 1px solid rgba(255,255,255,.2); text-align: left; }
.idc-meta b { font-size: .85em; font-weight: 600; }
.idc.back { background: #f3f5fb; color: #0b1020; border: 1px solid #c9d0e6; }
.idc-qr { display: grid; justify-items: center; gap: .3em; }
.idc-qr img { width: 8em; height: 8em; background: #fff; padding: .3em; border-radius: .5em; border: 1px solid #d5dbee; }
.idc-bar { background: #fff; margin-top: .8em; padding: .5em .6em .3em; border-radius: .4em; border: 1px solid #d5dbee; width: 100%; display: grid; place-items: center; }
.idc-bar svg { width: 100%; height: 3.3em; }
.idc-info { display: flex; gap: 1em; justify-content: center; margin-top: .7em; text-align: center; }
.idc-info b { font-size: .8em; }
.idc-foot { margin-top: auto; font-size: .5em; line-height: 1.45; color: #3b4466; }
.vcols { align-items: start; }
.vcp { max-width: 300px; margin: 0 auto; text-align: center; padding: 20px 18px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, #111832, var(--panel)); display: grid; gap: 3px; justify-items: center; }
.vcp-top img { height: 26px; width: auto; margin-bottom: 10px; }
.vcp-av { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; background: #1a2340; display: grid; place-items: center; margin-bottom: 6px; border: 2px solid var(--line-strong); }
.vcp-av img { width: 100%; height: 100%; object-fit: cover; }
.vcp-av b { font: 700 1.6rem var(--display); color: var(--accent-2); }
.vcp-role { color: var(--accent-2); font-size: .9rem; }
.vcp-tag { font-style: italic; color: #c6cde3; font-size: .86rem; margin-top: 6px; }
.vcp-line { margin-top: 6px; font-size: .86rem; padding: 6px 12px; border-radius: 10px; background: rgba(255,255,255,.05); overflow-wrap: anywhere; }
.sharebox { display: flex; gap: 10px; flex-wrap: wrap; }
.sharebox input { flex: 1; min-width: 200px; }
.row-actions.share { margin-top: 12px; }
.qrshow { display: flex; gap: 16px; align-items: center; margin-top: 18px; }
.qrshow img { width: 112px; height: 112px; background: #fff; padding: 6px; border-radius: 12px; flex-shrink: 0; }

@media (max-width: 640px) {
  .docrow { flex-direction: column; gap: 10px; }
  .docact { justify-content: flex-start; }
  .idpair { justify-content: center; }
  .submitbar .btn, .sharebox .btn { width: 100%; }
  .qrshow { flex-direction: column; text-align: center; }
  .row-actions.share .btn { flex: 1 1 calc(50% - 8px); }
  .recsummary { grid-template-columns: 1fr 1fr; }
}

/* Printing: only the ID card, or only the staff record */
@media print {
  body[data-print] { background: #fff; --bg: #fff; --panel: #fff; --panel-2: #fff; --text: #111; --muted: #444; --line: #ccc; --line-strong: #bbb; color: #111; }
  body[data-print] .side, body[data-print] #toast, body[data-print] .head .actions, body[data-print] .noprint, body[data-print] .row-actions, body[data-print] .btn { display: none !important; }
  body[data-print] .shell { display: block; }
  body[data-print] .main { padding: 0; }
  body[data-print=id] .main > *:not(.idcard-card) { display: none !important; }
  body[data-print=id] .idcard-card { border: 0; padding: 0; background: none; }
  body[data-print=id] .idcard-card > *:not(.idsheet) { display: none !important; }
  body[data-print=id] .idc { --w: 54mm; box-shadow: none; break-inside: avoid; }
  body[data-print=id] .idpair { gap: 8mm; }
  body[data-print=record] .card { border: 1px solid #ccc; break-inside: avoid; }
}

/* appointment letter viewer (administrator) */
dialog.wide { width: min(760px, calc(100% - 28px)); }
.letterview .letter-doc { background: #fff; color: #111; border-radius: 12px; padding: 28px; max-height: calc(100vh - 190px); overflow: auto; font-size: .93rem; line-height: 1.55; }
.letterview .ld-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.letterview .ld-head img { height: 44px; width: auto; background: #0b1020; padding: 6px 10px; border-radius: 8px; }
.letterview .ld-head .small { text-align: right; color: #444; max-width: 320px; }
.letterview h2 { font-size: 1.3rem; margin: 6px 0; color: #111; }
.letterview h3 { font-size: 1rem; margin: 16px 0 6px; color: #111; }
.letterview p { margin: 8px 0; }
.letterview .small { color: #555; font-size: .8rem; }
.letterview ul { margin: 6px 0 6px 20px; padding: 0; }
.ld-terms { width: 100%; border-collapse: collapse; margin: 10px 0; }
.ld-terms th, .ld-terms td { text-align: left; vertical-align: top; padding: 8px 10px; border: 1px solid #d8dbe6; font-size: .88rem; letter-spacing: 0; text-transform: none; color: #111; white-space: normal; }
.ld-terms th { width: 34%; background: #f2f4fa; font-weight: 600; }
@media (max-width: 640px) { .letterview .letter-doc { padding: 18px; } .letterview .ld-head .small { text-align: left; } .ld-terms th { width: 40%; } }
@media print {
  body[data-print=letter] .shell, body[data-print=letter] #toast, body[data-print=letter] .letterview .foot { display: none !important; }
  body[data-print=letter] { background: #fff; }
  body[data-print=letter] dialog { position: static; border: 0; padding: 0; width: auto; max-height: none; background: #fff; box-shadow: none; }
  body[data-print=letter] .letterview .letter-doc { max-height: none; overflow: visible; padding: 0; }
  body[data-print=letter] .ld-head img { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Wide screens: keep content a readable width instead of stretching edge to edge */
.main > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.card > form.fields { max-width: 760px; }
.cols .card > form.fields { max-width: none; }
.letterview, .auth-card { max-width: none; }

/* ---------- quotations ---------- */
.qform .qitems { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.qhead, .qrow { display: grid; grid-template-columns: minmax(0, 3fr) 70px 110px 100px 110px 36px; gap: 8px; align-items: center; }
.qhead { color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 0 8px; }
.qrow { padding: 4px 0; }
.qrow input, .qrow select { min-width: 0; padding: 8px 10px; }
.qline { text-align: right; font-variant-numeric: tabular-nums; font-size: .9rem; }
.qsum { margin-left: auto; width: min(340px, 100%); display: grid; gap: 4px; }
.qsum > div { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.qsum .grand { border-top: 1px solid var(--line-strong); padding-top: 6px; margin-top: 2px; font-size: 1.05rem; }
.letterview .qsum { color: #111; }
.letterview .qsum .grand { border-top-color: #999; }
.qmeta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 12px 0; }
.qmeta small { display: block; color: #666; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.qtable th.r, .qtable td.r { text-align: right; white-space: nowrap; }
.qtable th { width: auto !important; background: #f2f4fa; }
.qtable td:first-child, .qtable th:first-child { width: 36px !important; }
.quote-doc { max-height: none !important; }
.qactions { margin-bottom: 14px; }
@media (max-width: 760px) {
  .qhead { display: none; }
  .qrow { grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); padding: 10px 0; }
  .qrow > input[data-f=description] { grid-column: 1 / -1; }
  .qline { text-align: left; align-self: center; }
  .qtable { font-size: .8rem; }
}
@media print {
  body[data-print=quote] .side, body[data-print=quote] #toast, body[data-print=quote] .head, body[data-print=quote] .noprint, body[data-print=quote] .qactions, body[data-print=quote] .row-actions { display: none !important; }
  body[data-print=quote] { background: #fff; }
  body[data-print=quote] .shell { display: block; }
  body[data-print=quote] .main { padding: 0; }
  body[data-print=quote] .letterview .letter-doc { padding: 0; max-height: none; overflow: visible; }
  body[data-print=quote] .ld-head img { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- inbox, payroll lines, many tabs ---------- */
.notifs { display: grid; gap: 6px; }
.notif { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; text-align: left; width: 100%; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--text); cursor: pointer; font: inherit; }
.notif:hover { border-color: var(--accent); }
.notif.unread { border-color: rgba(86,116,255,.55); background: rgba(86,116,255,.1); }
.notif .ico { font-size: 1.2rem; text-align: center; }
.notif .txt { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.notif .when { white-space: nowrap; }
.prow { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1.2fr) 36px; gap: 8px; align-items: center; padding: 3px 0; }
@media (max-width: 640px) { .notif { grid-template-columns: 28px 1fr; } .notif .when { grid-column: 2; } }
@media (min-width: 861px) { .side nav.tabs { overflow-y: auto; min-height: 0; flex: 0 1 auto; } .side .me { flex-shrink: 0; } }
