/* Ideal Connection Hub — brand: deep blue #005893, sky #3FADD3, logo blue #53B0DA, Montserrat */
:root {
  --brand: #005893;
  --brand-700: #00446f;
  --brand-50: #e8f1f8;
  --sky: #3fadd3;
  --logo: #53b0da;
  --sky-50: #ecf7fc;
  --ink: #18242f;
  --ink-2: #44525f;
  --muted: #74828f;
  --line: #e2e8ee;
  --line-2: #eef2f6;
  --bg: #f4f7fa;
  --card: #ffffff;
  --amber: #a8640c; --amber-bg: #fdf3e2;
  --blue: #1c64a8; --blue-bg: #e9f2fb;
  --teal: #0b7f86; --teal-bg: #e3f5f5;
  --green: #18804a; --green-bg: #e5f5ec;
  --red: #c23a34; --red-bg: #fdecea;
  --grey: #63707d; --grey-bg: #eef1f4;
  --violet: #6a4bc4; --violet-bg: #f0ecfb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 40, 64, .05), 0 4px 16px rgba(16, 40, 64, .04);
  --shadow-lg: 0 10px 40px rgba(16, 40, 64, .14);
  --sidebar: 252px;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0 0 10px; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.ic-sm { width: 15px; height: 15px; vertical-align: -3px; }
.ic-lg { width: 22px; height: 22px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #fff;
  border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; }
.brand img { height: 60px; width: auto; display: block; }
.brand .tag {
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand); background: var(--sky-50); border: 1px solid #cfe9f5; padding: 3px 7px; border-radius: 999px;
}
.nav { padding: 6px 12px 16px; flex: 1; }
.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #9aa6b1; padding: 16px 10px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; font-size: 13.5px; position: relative;
}
.nav a:hover { background: var(--line-2); color: var(--ink); text-decoration: none; }
.nav a.is-active { background: var(--sky-50); color: var(--brand); font-weight: 600; }
.nav a.is-active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav a .count {
  margin-left: auto; font-size: 11px; font-weight: 700; background: var(--brand); color: #fff;
  border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.nav a .count.soft { background: var(--line); color: var(--ink-2); }
.sidebar-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sidebar-foot .role { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 62px; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 28px;
}
.topbar .menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input {
  width: 100%; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg);
  padding: 0 14px 0 38px; font: inherit; color: var(--ink);
}
.search input:focus { outline: none; border-color: var(--sky); background: #fff; box-shadow: 0 0 0 3px rgba(63,173,211,.18); }
.search .ic { position: absolute; left: 13px; top: 10px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  color: var(--ink-2); background: transparent; border: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); text-decoration: none; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; }
.avatar {
  width: 34px; height: 34px; border-radius: 999px; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--logo)); color: #fff; font-weight: 700; font-size: 12.5px; flex: none;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--line-2); }
.user-menu .who { line-height: 1.15; }
.user-menu .who b { display: block; font-size: 13px; }
.user-menu .who span { font-size: 11px; color: var(--muted); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50;
}
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: none;
  font: inherit; color: var(--ink); cursor: pointer; text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--line-2); text-decoration: none; }

.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ---------- Flash ---------- */
.flashes { display: grid; gap: 8px; margin-bottom: 18px; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; border: 1px solid; font-weight: 500; }
.flash.success { background: var(--green-bg); border-color: #bfe4cf; color: #145f38; }
.flash.error { background: var(--red-bg); border-color: #f4c7c4; color: #9b2a25; }
.flash.warning { background: var(--amber-bg); border-color: #f1d9ad; color: #7d4a07; }
.flash.info { background: var(--blue-bg); border-color: #c9ddf3; color: #18518a; }

/* ---------- Cards, grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 12px; }
.card-head .sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.card-body { padding: 4px 18px 18px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); font-size: 13px; }
.grid { display: grid; gap: 18px; }
.grid > *, .stack > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.stack { display: grid; gap: 18px; align-content: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 18px; } .mt-s { margin-top: 10px; } .mb { margin-bottom: 18px; } .mb-s { margin-bottom: 10px; }

.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi .label { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 12.5px; color: var(--muted); }
.kpi .foot a { font-weight: 600; }
.kpi.accent { background: linear-gradient(135deg, var(--brand) 0%, #0a6aa8 60%, var(--sky) 100%); color: #fff; border: 0; }
.kpi.accent .label, .kpi.accent .foot { color: rgba(255,255,255,.82); }
.kpi.accent .foot a { color: #fff; }
.kpi .ring { position: absolute; right: -26px; top: -26px; width: 110px; height: 110px; border-radius: 50%; border: 14px solid rgba(255,255,255,.12); }
.kpi.alert .value { color: var(--red); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fbfcfd; position: sticky; top: 0;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcfe; }
.table td:first-child, .table th:first-child { padding-left: 18px; }
.table td:last-child, .table th:last-child { padding-right: 18px; }
.table .title { font-weight: 600; color: var(--ink); }
.table .sub { font-size: 12px; color: var(--muted); }
.table tfoot td { font-weight: 700; background: #fbfcfd; border-top: 1px solid var(--line); }
.table.compact td { padding: 8px 12px; }
details > summary { cursor: pointer; }
tr.row-link { cursor: pointer; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty .ic { width: 28px; height: 28px; color: #b6c1cb; display: block; margin: 0 auto 8px; }

/* ---------- Pills, badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  white-space: nowrap; line-height: 1.5; background: var(--grey-bg); color: var(--grey);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.plain::before { display: none; }
.tone-amber { background: var(--amber-bg); color: var(--amber); }
.tone-blue { background: var(--blue-bg); color: var(--blue); }
.tone-teal { background: var(--teal-bg); color: var(--teal); }
.tone-green { background: var(--green-bg); color: var(--green); }
.tone-red { background: var(--red-bg); color: var(--red); }
.tone-grey { background: var(--grey-bg); color: var(--grey); }
.tone-violet { background: var(--violet-bg); color: var(--violet); }
.tone-brand { background: var(--brand-50); color: var(--brand); }
.badge { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); }
.badge.internal { background: #fff4e5; color: #9a5a07; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 9px;
  border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(63,173,211,.35); }
.btn.light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.light:hover { background: var(--line-2); color: var(--ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--sky-50); }
.btn.sky { background: var(--sky); border-color: var(--sky); }
.btn.sky:hover { background: #2c97bd; border-color: #2c97bd; }
.btn.danger { background: #fff; color: var(--red); border-color: #f0c9c6; }
.btn.danger:hover { background: var(--red-bg); }
.btn.success { background: var(--green); border-color: var(--green); }
.btn.success:hover { background: #126b3c; }
.btn.wa { background: #1fa855; border-color: #1fa855; }
.btn.wa:hover { background: #178a45; }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.inline-form { display: inline; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=month],
input[type=tel], input[type=search], input[type=url], select, textarea {
  width: 100%; height: 40px; border: 1px solid #d5dee6; border-radius: var(--radius-sm); padding: 0 12px; font: inherit;
  color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2374828f' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(63,173,211,.18); }
input.sm, select.sm { height: 33px; font-size: 13px; padding: 0 10px; }
select.sm { padding-right: 28px; background-position: right 9px center; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.filters input, .filters select { height: 34px; font-size: 13px; width: auto; min-width: 140px; }
.filters input[type=search] { min-width: 220px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { font-size: 11px; background: var(--line-2); color: var(--ink-2); border-radius: 999px; padding: 0 7px; }
.tabs a.is-active .count { background: var(--brand); color: #fff; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg a { padding: 5px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a.is-active { background: #fff; color: var(--brand); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- Stage tracker ---------- */
.stages { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 18px 10px 14px; }
.stage { position: relative; text-align: center; padding: 0 4px; }
.stage::before { content: ''; position: absolute; top: 14px; left: calc(-50% + 16px); right: calc(50% + 16px); height: 2px; background: var(--line); }
.stage:first-child::before { display: none; }
.stage.done::before, .stage.current::before, .stage.partial::before, .stage.alert::before { background: var(--brand); }
.stage .dot {
  width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; position: relative; z-index: 1;
  background: #fff; border: 2px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700;
}
.stage.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.stage.current .dot { border-color: var(--sky); color: var(--brand); box-shadow: 0 0 0 5px rgba(63,173,211,.18); }
.stage.partial .dot { border-color: #e2a33c; color: var(--amber); background: var(--amber-bg); }
.stage.alert .dot { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.stage .name { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.stage.todo .name { color: var(--muted); }
.stage .note { font-size: 11px; color: var(--muted); margin-top: 2px; min-height: 15px; }
.stage.alert .note { color: var(--red); font-weight: 600; }
.mini-stages { display: inline-flex; gap: 3px; vertical-align: middle; }
.mini-stages i { width: 14px; height: 5px; border-radius: 3px; background: var(--line); display: block; }
.mini-stages i.done { background: var(--brand); }
.mini-stages i.current { background: var(--sky); }
.mini-stages i.partial { background: #e2a33c; }
.mini-stages i.alert { background: var(--red); }

/* ---------- Definition lists ---------- */
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 9px 14px; font-size: 13.5px; }
.dl dt { color: var(--muted); font-weight: 500; }
.dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 8px 0; position: relative; }
.timeline li::before { content: ''; position: absolute; left: 10px; top: 28px; bottom: -6px; width: 2px; background: var(--line-2); }
.timeline li:last-child::before { display: none; }
.timeline .tdot { width: 22px; height: 22px; border-radius: 50%; background: var(--sky-50); color: var(--brand); display: grid; place-items: center; }
.timeline .tdot .ic { width: 12px; height: 12px; }
.timeline .tmeta { font-size: 11.5px; color: var(--muted); }

/* ---------- Checklist ---------- */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checklist li form { display: flex; }
.checklist button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff;
  font: inherit; color: var(--ink); cursor: pointer; text-align: left;
}
.checklist button:hover { border-color: #cfe1ee; background: var(--sky-50); }
.checklist .box { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #c8d3dc; display: grid; place-items: center; flex: none; color: #fff; }
.checklist li.done .box { background: var(--green); border-color: var(--green); }
.checklist li.done .lbl { color: var(--muted); text-decoration: line-through; }
.checklist .who { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.progress { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--sky)); border-radius: 99px; }

/* ---------- Bars ---------- */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 96px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar-row .track span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.bar-row .track span.red { background: linear-gradient(90deg, #e36b5c, var(--red)); }
.aging { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.aging div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.aging b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.aging span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.aging .late b { color: var(--red); }

/* ---------- Availability grid ---------- */
.avail-wrap { overflow: auto; max-height: calc(100vh - 250px); border-top: 1px solid var(--line-2); }
table.avail { border-collapse: separate; border-spacing: 0; font-size: 11.5px; }
.avail th, .avail td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); }
.avail thead th { position: sticky; top: 0; background: #fbfcfd; z-index: 2; padding: 6px 0; text-align: center; font-weight: 600; color: var(--muted); min-width: 30px; }
.avail thead th.wk { color: var(--ink-2); }
.avail thead th .dn { display: block; font-size: 9.5px; font-weight: 500; text-transform: uppercase; }
.avail th.space, .avail td.space {
  position: sticky; left: 0; z-index: 3; background: #fff; text-align: left; padding: 7px 12px; min-width: 230px; max-width: 260px;
  border-right: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.avail thead th.space { z-index: 4; background: #fbfcfd; }
.avail td.space a { font-weight: 600; color: var(--ink); }
.avail td.space .s { color: var(--muted); font-size: 11px; }
.avail td.cell { width: 30px; height: 34px; padding: 0; }
.avail td.cell a { display: block; width: 100%; height: 34px; }
.avail td.cell a:hover { background: var(--sky-50); }
.avail td.we { background: #fafbfc; }
.avail th.today { color: var(--brand); }
.avail th.today .dn { color: var(--brand); }
.avail td.today { box-shadow: inset 2px 0 0 var(--sky), inset -2px 0 0 var(--sky); }
.avail td.held { background: #fbe7c4; }
.avail td.booked { background: #b9d6ec; }
.avail td.blocked { background: repeating-linear-gradient(135deg, #e8ecf0 0 5px, #f5f7f9 5px 10px); }
.avail td.held a, .avail td.booked a, .avail td.blocked a { cursor: pointer; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); align-items: center; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -3px; margin-right: 5px; border: 1px solid var(--line); }
.legend .free { background: #fff; } .legend .held { background: #fbe7c4; } .legend .booked { background: #b9d6ec; }
.legend .blocked { background: repeating-linear-gradient(135deg, #e8ecf0 0 4px, #f5f7f9 4px 8px); }

/* ---------- Booking form lines ---------- */
.lines { display: grid; gap: 12px; }
.line-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fcfdfe; position: relative; }
.line-card .line-grid { display: grid; gap: 10px 12px; grid-template-columns: 2.4fr 1fr 1fr; }
.line-card .line-grid-2 { display: grid; gap: 10px 12px; grid-template-columns: 1fr .7fr .8fr 1fr 1fr; margin-top: 10px; }
.line-card .remove { position: absolute; top: 8px; right: 8px; }
.line-card .info { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.line-card .conflict { margin-top: 8px; font-size: 12.5px; color: var(--red); background: var(--red-bg); border-radius: 8px; padding: 7px 10px; }
.line-card .conflict.ok { color: var(--green); background: var(--green-bg); }
.totals { display: grid; gap: 6px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; gap: 10px; }
.totals .grand { font-size: 18px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 20; max-height: 300px; overflow: auto; }
.picker-list button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; font: inherit; cursor: pointer; }
.picker-list button:hover, .picker-list button.on { background: var(--sky-50); }
.picker-list .s { display: block; font-size: 12px; color: var(--muted); }
.chosen { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid #cfe1ee; background: var(--sky-50); border-radius: 9px; }
.chosen b { flex: 1; }

/* ---------- Modal ---------- */
dialog { border: 0; border-radius: 16px; padding: 0; box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); color: var(--ink); }
dialog::backdrop { background: rgba(10, 30, 50, .45); }
dialog .dhead { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 6px; }
dialog .dbody { padding: 10px 20px 20px; }

/* ---------- Copy box ---------- */
.copybox { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px dashed #c7d6e2; border-radius: 10px; padding: 8px 8px 8px 12px; }
.copybox input { border: 0; background: transparent; height: 30px; padding: 0; font-size: 12.5px; color: var(--ink-2); box-shadow: none; }
.callout { border-radius: 12px; padding: 14px 16px; background: var(--sky-50); border: 1px solid #cfe9f5; }
.callout.warn { background: var(--amber-bg); border-color: #f1d9ad; }
.callout.red { background: var(--red-bg); border-color: #f4c7c4; }

/* ---------- Space cards ---------- */
.space-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; padding: 18px; }
.space-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.space-card:hover { border-color: #c7dcec; box-shadow: var(--shadow); text-decoration: none; }
.space-card .ph { height: 128px; background: linear-gradient(135deg, var(--brand-50), var(--sky-50)); background-size: cover; background-position: center; position: relative; }
.space-card .ph .ic { position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; color: #9cc6df; }
.space-card .ph .pill { position: absolute; top: 10px; left: 10px; }
.space-card .bd { padding: 12px 14px 14px; color: var(--ink); }
.space-card .t { font-weight: 700; }
.space-card .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.space-card .p { margin-top: 8px; font-weight: 700; color: var(--brand); }

/* ---------- Auth & public pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-art {
  background: radial-gradient(circle at 78% 22%, rgba(83,176,218,.55) 0, rgba(83,176,218,0) 34%),
              radial-gradient(circle at 18% 88%, rgba(63,173,211,.35) 0, rgba(63,173,211,0) 40%),
              linear-gradient(150deg, #003a63 0%, var(--brand) 55%, #0a77b3 100%);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-art img { height: 76px; width: auto; }
.auth-art h2 { font-size: 30px; line-height: 1.2; font-weight: 700; max-width: 440px; letter-spacing: -.02em; }
.auth-art p { color: rgba(255,255,255,.8); max-width: 420px; font-size: 15px; }
.auth-art .rays { position: absolute; right: -120px; bottom: -120px; width: 420px; opacity: .14; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { font-size: 24px; margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 26px; }
.auth-box .field { margin-bottom: 14px; }
.auth-box .mobile-logo { display: none; height: 54px; margin-bottom: 20px; }

.public { min-height: 100vh; background: var(--bg); }
.public-head { background: #fff; border-bottom: 1px solid var(--line); }
.public-head .in { max-width: 980px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.public-head img { height: 48px; }
.public-main { max-width: 980px; margin: 0 auto; padding: 26px 20px 60px; }

/* ---------- Document (booking confirmation) ---------- */
.doc { background: #fff; color: #1d2430; font-size: 12.5px; line-height: 1.5; padding: 34px 38px; border-radius: 12px; border: 1px solid var(--line); }
.doc .dh { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--brand); padding-bottom: 16px; margin-bottom: 18px; }
.doc .dh img { height: 64px; }
.doc .co { text-align: right; font-size: 11.5px; color: #4a5866; }
.doc .co b { color: #1d2430; font-size: 13px; }
.doc .title { font-size: 20px; font-weight: 700; color: var(--brand); margin: 0 0 4px; }
.doc .meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--bg); border-radius: 10px; padding: 12px 14px; margin: 14px 0; }
.doc .meta span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #74828f; font-weight: 700; }
.doc h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin: 18px 0 8px; }
.doc table { width: 100%; border-collapse: collapse; }
.doc th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: #74828f; padding: 7px 8px; border-bottom: 1.5px solid #d5dee6; }
.doc td { padding: 9px 8px; border-bottom: 1px solid #edf1f4; vertical-align: top; }
.doc td.num, .doc th.num { text-align: right; }
.doc .tot { margin-left: auto; width: 280px; margin-top: 10px; }
.doc .tot div { display: flex; justify-content: space-between; padding: 4px 0; }
.doc .tot .g { font-weight: 700; font-size: 14px; border-top: 1.5px solid #1d2430; margin-top: 4px; padding-top: 7px; }
.doc .tnc { white-space: pre-line; font-size: 11px; color: #3a4652; columns: 2; column-gap: 26px; }
.doc .sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 20px; }
.doc .sigbox { border: 1px solid #d5dee6; border-radius: 10px; padding: 12px 14px; min-height: 120px; }
.doc .sigbox img { max-height: 70px; max-width: 100%; display: block; margin: 4px 0; }
.doc .pay { background: var(--sky-50); border-radius: 10px; padding: 12px 14px; margin-top: 16px; }
.doc .stamp { display: inline-block; border: 2px solid var(--green); color: var(--green); border-radius: 8px; padding: 2px 10px; font-weight: 700; transform: rotate(-4deg); }

.sign-panel { margin-top: 18px; }
.sigpad { border: 2px dashed #b9cad8; border-radius: 12px; background: #fff; touch-action: none; width: 100%; height: 190px; display: block; cursor: crosshair; }
.sigpad.has { border-style: solid; border-color: var(--sky); }

/* ---------- Misc ---------- */
.notice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sky); display: inline-block; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 18px; border-bottom: 1px solid var(--line-2); display: flex; gap: 10px; align-items: center; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .grow { flex: 1; min-width: 0; }
.list-plain .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-plain .s { font-size: 12px; color: var(--muted); }
.pager { display: flex; gap: 6px; justify-content: flex-end; padding: 12px 18px; }
.sync-chip { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sync-chip .d { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.sync-chip .d.err { background: var(--red); } .sync-chip .d.off { background: #c6cfd7; }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--line-2); padding: 1px 6px; border-radius: 5px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: var(--line-2); padding: 1px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.steps-list { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.steps-list li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.overlay { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .overlay { display: block; position: fixed; inset: 0; background: rgba(10,30,50,.4); z-index: 35; }
  .topbar { padding: 0 14px; }
  .topbar .menu-btn { display: inline-grid; }
  .user-menu .who { display: none; }
  .content { padding: 18px 14px 50px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .stages { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 16px; }
  .stage:nth-child(5)::before { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-box .mobile-logo { display: block; }
  .line-card .line-grid, .line-card .line-grid-2 { grid-template-columns: 1fr 1fr; }
  .line-card .line-grid .span2 { grid-column: 1 / -1; }
  .doc { padding: 20px 16px; }
  .doc .meta { grid-template-columns: 1fr 1fr; }
  .doc .tnc { columns: 1; }
  .doc .sigs { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .value { font-size: 21px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 110px 1fr; }
  .search { display: none; }
  .bar-row { grid-template-columns: 90px 1fr 80px; }
  .filters input, .filters select, .filters input[type=search] { min-width: 0; flex: 1 1 140px; }
  .hide-sm { display: none; }
  .page-head h1 { font-size: 19px; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; }
  .no-print, .sidebar, .topbar { display: none !important; }
  .doc { border: 0; padding: 0; border-radius: 0; }
  .print-page { padding: 0 !important; }
  @page { size: A4; margin: 14mm; }
}
