/* =====================================================================
   K Designs Studio — premium monochrome theme
   Display: Cormorant Garamond · Text: Inter · Palette: ink, paper, stone
   ===================================================================== */
@font-face { font-family: "Inter"; src: url("../fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-600.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }

:root {
  --ink: #0b0b0c;
  --ink-2: #1d1d1f;
  --ink-3: #3a3a3c;
  --muted: #7a766f;
  --line: #e8e5df;
  --line-2: #d9d5cd;
  --stone: #f3f1ec;
  --paper: #ffffff;
  --bg: #f7f6f2;
  --ok: #1c7a4a;
  --warn: #9a5b00;
  --bad: #b3261e;
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 260px;
  --shadow-1: 0 1px 2px rgba(11, 11, 12, .04);
  --shadow-2: 0 1px 2px rgba(11, 11, 12, .04), 0 12px 32px -18px rgba(11, 11, 12, .22);
  --shadow-3: 0 2px 4px rgba(11, 11, 12, .05), 0 24px 48px -20px rgba(11, 11, 12, .30);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --display: "Cormorant", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --bs-body-font-family: "Inter", "Segoe UI", "Nirmala UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-link-color-rgb: 11, 11, 12;
  --bs-link-hover-color-rgb: 0, 0, 0;
  --bs-border-radius: var(--radius-sm);
  --bs-border-color: var(--line);
  --bs-primary-rgb: 11, 11, 12;
}
html { font-size: 14.5px; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; letter-spacing: -0.005em; }
::selection { background: var(--ink); color: #fff; }
a { text-decoration: none; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
h4, h5, h6 { font-weight: 650; letter-spacing: -0.01em; }
.text-muted { color: var(--muted) !important; }
[data-lucide] { width: 18px; height: 18px; stroke-width: 1.6; flex-shrink: 0; }
.small [data-lucide], small [data-lucide] { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- buttons ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 550; padding: .5rem 1rem; transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s, color .15s, border-color .15s; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.btn-sm { padding: .3rem .65rem; border-radius: 8px; }
.btn-primary, .btn-dark { background: linear-gradient(180deg, #232325, var(--ink)); border: 1px solid var(--ink); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 1px 2px rgba(0,0,0,.2); }
.btn-primary:hover, .btn-dark:hover, .btn-primary:focus, .btn-dark:focus { background: #000; border-color: #000; color: #fff; transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(0,0,0,.5); }
.btn-primary:active, .btn-dark:active { transform: translateY(0); }
.btn-outline-dark, .btn-outline-primary { color: var(--ink); border: 1px solid var(--line-2); background: var(--paper); }
.btn-outline-dark:hover, .btn-outline-primary:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-light { background: var(--stone); border: 1px solid var(--line); color: var(--ink); }
.btn-light:hover { background: #ebe8e1; border-color: var(--line-2); }
.btn-outline-danger { border-color: #e7c4c1; color: var(--bad); background: #fff; }
.btn-outline-danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn:disabled { opacity: .55; }
.btn-link { color: var(--muted); }

/* navigation buttons (Google Maps) */
.btn-nav { background: var(--ink); color: #fff; border: 1px solid var(--ink); border-radius: 999px; padding: .5rem 1.1rem; }
.btn-nav:hover { background: #000; color: #fff; transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(0,0,0,.5); }
.map-chip { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff !important; vertical-align: middle; transition: transform .15s var(--ease); }
.map-chip [data-lucide] { width: 14px; height: 14px; }
.map-chip:hover { transform: scale(1.08); }
.maplink-help { font-size: .8rem; color: var(--muted); margin-top: .35rem; display: flex; gap: .35rem; align-items: flex-start; }
.maplink-help [data-lucide] { width: 14px; height: 14px; margin-top: 2px; }
.nav-card { background: linear-gradient(135deg, #fff, var(--stone)); }
.nav-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; flex-shrink: 0; }

/* ---------- forms ---------- */
.form-control, .form-select { border: 1px solid var(--line-2); border-radius: var(--radius-sm); background-color: var(--paper); padding: .55rem .8rem; transition: border-color .15s, box-shadow .15s; }
.form-control-sm, .form-select-sm { padding: .3rem .55rem; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(11,11,12,.07); }
.form-check-input { border-color: var(--line-2); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(11,11,12,.08); border-color: var(--ink); }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.input-group-text { background: var(--stone); border-color: var(--line-2); color: var(--ink-3); }
.form-label { font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: .35rem; }
.form-text { color: var(--muted); }
.field-validation-error, .validation-summary-errors { color: var(--bad); font-size: .85rem; }
.validation-summary-errors ul { margin: 0 0 .5rem; padding-left: 1.1rem; }
.input-validation-error { border-color: var(--bad) !important; }

/* ---------- app shell ---------- */
.app .sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); color: #cfcfcf; z-index: 1040; overflow-y: auto; padding: 22px 14px 40px;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(120% 60% at 0% 0%, #1c1c1e 0%, #0b0b0c 60%);
  border-right: 1px solid #000; transition: transform .25s var(--ease);
  scrollbar-width: thin; scrollbar-color: #333 transparent;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: #fff; padding: 6px 10px 20px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo { width: 178px; height: auto; display: block; transition: opacity .2s; }
.brand:hover .brand-logo { opacity: .85; }
.brand-sub { font-size: .58rem; letter-spacing: .26em; text-transform: uppercase; color: #8a8a8a; padding-left: 2px; }
.topbar-logo img { height: 28px; width: auto; display: block; }
.brand:hover { color: #fff; }
.brand-mark { width: 40px; height: 40px; border: 1.5px solid currentColor; display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 1.45rem; line-height: 1; position: relative; flex-shrink: 0; }
.brand-mark::after { content: ""; position: absolute; inset: 4px; border: 1px solid currentColor; opacity: .35; }
.brand-text { font-family: var(--display); font-weight: 600; letter-spacing: .14em; font-size: .98rem; line-height: 1.15; }
.brand-text small { display: block; font-family: var(--bs-body-font-family); letter-spacing: .18em; color: #8a8a8a; font-weight: 500; font-size: .6rem; margin-top: 4px; text-transform: uppercase; }
.menu a { position: relative; display: flex; align-items: center; gap: 12px; color: #c9c9c9; padding: 9px 12px; border-radius: 10px; font-size: .9rem; margin: 2px 0; transition: background .15s, color .15s, transform .15s var(--ease); }
.menu a:hover { background: rgba(255,255,255,.06); color: #fff; transform: translateX(2px); }
.menu a.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 8px 20px -10px rgba(0,0,0,.8); }
.menu a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #fff; }
.menu-label { text-transform: uppercase; letter-spacing: .2em; font-size: .6rem; color: #6f6f6f; padding: 20px 12px 6px; }
.menu .pill { margin-left: auto; background: #fff; color: #000; border-radius: 99px; font-size: .68rem; padding: 1px 7px; font-weight: 700; }
.menu a.active .pill { background: #000; color: #fff; }

.app .main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: rgba(247,246,242,.78); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-title { font-family: var(--display); font-weight: 600; font-size: 1.35rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.lang-select { width: auto; min-width: 104px; border-radius: 999px; padding-top: .35rem; padding-bottom: .35rem; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); transition: border-color .15s, transform .15s var(--ease); }
.icon-btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.icon-btn .dot { position: absolute; top: -6px; right: -7px; background: var(--ink); color: #fff; border-radius: 99px; font-size: .64rem; padding: 1px 6px; font-weight: 700; border: 2px solid var(--bg); }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; font-weight: 600; padding: 4px 6px 4px 4px; border-radius: 999px; }
.user-btn:hover { background: var(--stone); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-3); padding: 6px; }
.dropdown-item { border-radius: 8px; padding: .45rem .75rem; }
.dropdown-item:active { background: var(--ink); }
.content { padding: 28px; max-width: 1520px; width: 100%; }
.content > * { animation: rise .45s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: .03s; } .content > *:nth-child(3) { animation-delay: .06s; } .content > *:nth-child(4) { animation-delay: .09s; } .content > *:nth-child(5) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.backdrop { display: none; }
@media (max-width: 991.98px) {
  .app .sidebar { transform: translateX(-100%); box-shadow: none; }
  body.menu-open .sidebar { transform: none; box-shadow: 30px 0 60px rgba(0,0,0,.35); }
  body.menu-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); z-index: 1035; }
  .app .main { margin-left: 0; }
  .content { padding: 18px 16px; }
  .topbar { padding: 0 12px; height: 58px; }
  .topbar-title { font-size: 1.15rem; }
}

/* ---------- surfaces ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); background: var(--paper); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 650; padding: 14px 18px; font-size: .92rem; }
.card-header:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card-body { padding: 18px; }
.list-group-item { border-color: var(--line); padding: .7rem 1.1rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-head h2 { margin: 0; font-size: 2.15rem; line-height: 1.05; }
.page-head .sub { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.stat { position: relative; display: block; border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 16px; background: var(--paper); color: var(--ink); height: 100%; overflow: hidden;
  box-shadow: var(--shadow-1); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
a.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-2); color: var(--ink); }
a.stat::after { content: "↗"; position: absolute; top: 14px; right: 16px; font-size: .9rem; color: var(--muted); opacity: 0; transform: translate(-4px, 4px); transition: all .2s var(--ease); }
a.stat:hover::after { opacity: 1; transform: none; }
.stat .label { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); display: flex; align-items: center; gap: 7px; font-weight: 600; }
.stat .label [data-lucide] { width: 15px; height: 15px; }
.stat .value { font-size: 1.95rem; font-weight: 650; margin-top: 10px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .meta { color: var(--muted); font-size: .8rem; margin-top: 8px; line-height: 1.45; }
.stat.dark { color: #fff; border-color: #000;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 1px, transparent 1px 14px), radial-gradient(120% 120% at 100% 0%, #2a2a2c, #0b0b0c 60%); }
.stat.dark .label, .stat.dark .meta, a.stat.dark::after { color: #a8a8a8; }
a.stat.dark:hover { color: #fff; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: .92rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; }
.notice { border: 1px solid var(--line-2); border-left: 3px solid var(--ink); border-radius: 12px; padding: 12px 16px; background: linear-gradient(90deg, var(--stone), #fff); font-size: .9rem; }
.alert { border-radius: 12px; border: 1px solid var(--line); }
.alert-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.alert-dark .btn-close { filter: invert(1); }

/* ---------- tables ---------- */
.table { --bs-table-hover-bg: #faf9f6; margin-bottom: 0; --bs-table-bg: transparent; }
.table > thead th { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 650; background: #fbfaf8; border-bottom: 1px solid var(--line); white-space: nowrap; padding-top: .75rem; padding-bottom: .75rem; }
.table td { vertical-align: middle; border-color: #f0ede8; padding-top: .7rem; padding-bottom: .7rem; }
.table-sm td { padding-top: .45rem; padding-bottom: .45rem; }
.table tfoot td { font-weight: 700; background: #fbfaf8; border-top: 1px solid var(--line); }
.table-responsive { border-radius: var(--radius); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 36px !important; font-style: italic; }

/* ---------- badges & chips ---------- */
.badge { font-weight: 600; letter-spacing: .02em; border-radius: 999px; padding: .32em .7em; font-size: .72rem; }
.b-dark { background: var(--ink); color: #fff; }
.b-soft { background: var(--stone); color: var(--ink-3); border: 1px solid var(--line); }
.b-ok { background: #e6f3ec; color: var(--ok); }
.b-warn { background: #fbf0df; color: var(--warn); }
.b-bad { background: #fbe7e5; color: var(--bad); }
.b-outline { border: 1px solid var(--ink); color: var(--ink); background: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.filters .form-control, .filters .form-select { min-width: 150px; width: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 99px; color: var(--ink); font-size: .84rem; background: var(--paper); transition: all .15s var(--ease); cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.progress { height: 6px; background: #eceae5; border-radius: 99px; }
.progress-bar { background: var(--ink); border-radius: 99px; }

/* ---------- attendance capture ---------- */
.capture { max-width: 520px; margin: 0 auto; }
.camera { position: relative; background: #000; border-radius: 22px; overflow: hidden; aspect-ratio: 3/4; box-shadow: var(--shadow-3); }
.camera::before { content: ""; position: absolute; inset: 14% 18%; border: 2px solid rgba(255,255,255,.55); border-radius: 50% / 42%; z-index: 2; pointer-events: none; }
.camera video, .camera img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera .overlay { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; text-align: center; padding: 20px; z-index: 3; }
.status-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.status-line:last-child { border-bottom: 0; }
.status-line .s { margin-left: auto; font-weight: 600; }
.selfie-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: #fff; border-radius: var(--radius); overflow: hidden; }
.sub .cal { display: inline-grid; border: 0; background: transparent; }
.cal .h { padding: 10px; font-size: .64rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fbfaf8; font-weight: 650; }
.cal .d { min-height: 118px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .78rem; overflow: hidden; transition: background .15s; }
.cal .d:hover { background: #fcfbf9; }
.cal .d.other { background: #faf9f6; color: #b5b1aa; }
.cal .d.today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal .d .n { font-weight: 700; margin-bottom: 5px; font-family: var(--display); font-size: 1.05rem; }
.cal .e { display: block; padding: 2px 7px; border-radius: 6px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--stone); color: var(--ink); }
.cal .e.k-visit { background: var(--ink); color: #fff; }
.cal .e.k-leave { background: #fbf0df; }
.cal .e.k-holiday, .cal .e.k-shutdown { background: #e6f3ec; }
.cal .e.k-deadline { border: 1px solid var(--ink); background: #fff; }
.cal .e.k-payment { background: #fbe7e5; }
@media (max-width: 767.98px) { .cal .d { min-height: 72px; padding: 4px; } .cal .e { font-size: .62rem; } }

.timeline { border-left: 1px solid var(--line-2); padding-left: 18px; }
.timeline .t { position: relative; padding-bottom: 16px; }
.timeline .t::before { content: ""; position: absolute; left: -23px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
details summary { cursor: pointer; }
@media print { .sidebar, .topbar, .no-print, .filters { display: none !important; } .app .main { margin: 0; } .content > * { animation: none; } }

/* =====================================================================
   Guest pages & the sign-in experience
   ===================================================================== */
.guest-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 440px; }
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand .brand-mark { margin: 0 auto 14px; width: 56px; height: 56px; font-size: 1.9rem; }
.auth-brand h1 { font-size: 1.4rem; letter-spacing: .2em; margin: 0; }
.auth-brand p { color: var(--muted); letter-spacing: .1em; font-size: .78rem; margin: 6px 0 0; text-transform: uppercase; }

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) clamp(380px, 30vw, 500px); background: var(--paper); overflow-x: hidden; }

/* ---------- left: the drafting table ---------- */
.auth-hero { position: relative; overflow: hidden; color: #fff; padding: 36px clamp(24px, 3.4vw, 56px) 30px; display: flex; flex-direction: column; gap: 22px; isolation: isolate;
  background: radial-gradient(90% 70% at 20% 0%, #232326 0%, #0b0b0c 55%, #050505 100%); }
.auth-grid { position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 120px 120px;
  mask-image: radial-gradient(85% 75% at 55% 50%, #000 35%, transparent 90%); -webkit-mask-image: radial-gradient(85% 75% at 55% 50%, #000 35%, transparent 90%); }
.auth-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-hero-top .t { font-size: .64rem; letter-spacing: .3em; text-transform: uppercase; color: #8f8f8f; }
.auth-logo { width: 210px; max-width: 55%; height: auto; display: block; animation: rise .8s var(--ease) both; }

.sheet-wrap { flex: 1; display: grid; place-items: center; perspective: 1400px; min-height: 0; }
.sheet { --rx: 0deg; --ry: 0deg; position: relative; width: 100%; max-width: min(980px, calc((100vh - 300px) * 1.55)); border-radius: 14px; padding: 10px 10px 0;
  background: linear-gradient(160deg, rgba(255,255,255,.055), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform .35s var(--ease);
  animation: rise .9s var(--ease) .1s both; }
.sheet::before { content: ""; position: absolute; inset: -1px; border-radius: 14px; pointer-events: none;
  background: radial-gradient(60% 40% at 30% 0%, rgba(255,255,255,.12), transparent 70%); }
.plan { display: block; width: 100%; height: auto; overflow: visible; }

/* base strokes */
.plan .frame { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 1; }
.plan .frame.thin { stroke: rgba(255,255,255,.1); }
.plan .gridline { fill: none; stroke: rgba(255,255,255,.16); stroke-width: .8; stroke-dasharray: 10 4 2 4; }
.plan .bubble circle { fill: #0d0d0e; stroke: rgba(255,255,255,.45); stroke-width: 1; }
.plan .bubble text { fill: rgba(255,255,255,.75); font: 600 9px "Inter", sans-serif; text-anchor: middle; }
.plan .wall { fill: none; stroke: #f5f5f5; stroke-width: 4.2; stroke-linecap: square; stroke-linejoin: miter; }
.plan .wall.inner { stroke-width: 2.6; stroke: rgba(255,255,255,.88); }
.plan .window rect { fill: #0f0f10; stroke: rgba(255,255,255,.7); stroke-width: 1; }
.plan .window line { stroke: rgba(255,255,255,.55); stroke-width: .8; }
.plan .door { fill: none; stroke: rgba(255,255,255,.6); stroke-width: 1.1; }
.plan .furn { fill: none; stroke: rgba(255,255,255,.5); stroke-width: 1; stroke-linejoin: round; }
.plan .ph-fix circle, .plan .ph-fix path { fill: none; stroke: rgba(255,255,255,.45); stroke-width: 1; }
.plan .dim, .plan .tick { fill: none; stroke: rgba(255,255,255,.4); stroke-width: .8; }
.plan .tick { stroke-width: 1.1; }
.plan .dimt { fill: rgba(255,255,255,.6); font: 500 8.5px "Inter", sans-serif; text-anchor: middle; letter-spacing: .06em; }
.plan .room text { fill: rgba(255,255,255,.8); font: 650 8.5px "Inter", sans-serif; letter-spacing: .18em; }
.plan .room text.area { fill: rgba(255,255,255,.45); font-weight: 500; letter-spacing: .06em; }
.plan .north circle { fill: none; stroke: rgba(255,255,255,.4); }
.plan .north path { fill: rgba(255,255,255,.85); }
.plan .north text { fill: rgba(255,255,255,.75); font: 700 10px "Inter", sans-serif; text-anchor: middle; }
.plan .scale path { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1; }
.plan .scale rect { fill: rgba(255,255,255,.6); }
.plan .scale text, .plan .notes text, .plan .tblock text { fill: rgba(255,255,255,.55); font: 500 8px "Inter", sans-serif; letter-spacing: .1em; }
.plan .notes text.h, .plan .tblock text.h { fill: rgba(255,255,255,.9); font-weight: 700; letter-spacing: .2em; }
.plan .tblock rect, .plan .tblock path { fill: none; stroke: rgba(255,255,255,.4); stroke-width: 1; }
.plan .stamp circle { fill: none; stroke: #fff; stroke-width: 1.6; }
.plan .stamp circle + circle { stroke-width: .8; stroke-dasharray: 2 3; }
.plan .stamp text { fill: #fff; font: 600 6.5px "Inter", sans-serif; text-anchor: middle; letter-spacing: .14em; }
.plan .stamp text.big { font: 800 10.5px "Inter", sans-serif; letter-spacing: .12em; }
.plan .stamp text.tiny { font-size: 5.5px; letter-spacing: .2em; opacity: .8; }
.plan .pen { fill: #fff; opacity: 0; }

/* ---------- 16 s drafting cycle: grid → walls → partitions → openings → furniture → annotation → approval → fade ---------- */
.plan .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.plan .ph-grid { animation: kFade 16s linear infinite; }
.plan .d-outer { animation: kOuter 16s linear infinite; }
.plan .d-inner { animation: kInner 16s linear infinite; }
.plan .ph-open { animation: kOpen 16s linear infinite; }
.plan .d-door { animation: kDoor 16s linear infinite; }
.plan .d-furn { animation: kFurn 16s linear infinite; }
.plan .ph-fix { animation: kFix 16s linear infinite; }
.plan .ph-dim { animation: kDim 16s linear infinite; }
.plan .ph-sheet { animation: kSheet 16s linear infinite; }
.plan .stamp-in { transform-box: fill-box; transform-origin: center; animation: kStamp 16s var(--ease) infinite; }
@keyframes kFade  { 0% { opacity: 0 } 8% { opacity: 1 } 90% { opacity: 1 } 97%, 100% { opacity: 0 } }
@keyframes kOuter { 0%, 6.25% { stroke-dashoffset: 1; opacity: 1 } 31.25% { stroke-dashoffset: 0 } 92% { stroke-dashoffset: 0; opacity: 1 } 99.9% { stroke-dashoffset: 0; opacity: .12 } 100% { stroke-dashoffset: 1; opacity: 1 } }
@keyframes kInner { 0%, 22% { stroke-dashoffset: 1; opacity: 1 } 44% { stroke-dashoffset: 0 } 90% { stroke-dashoffset: 0; opacity: 1 } 97%, 100% { stroke-dashoffset: 0; opacity: 0 } }
@keyframes kOpen  { 0%, 36% { opacity: 0 } 41% { opacity: 1 } 90% { opacity: 1 } 97%, 100% { opacity: 0 } }
@keyframes kDoor  { 0%, 38% { stroke-dashoffset: 1; opacity: 1 } 50% { stroke-dashoffset: 0 } 90% { stroke-dashoffset: 0; opacity: 1 } 97%, 100% { stroke-dashoffset: 0; opacity: 0 } }
@keyframes kFurn  { 0%, 47% { stroke-dashoffset: 1; opacity: 1 } 62% { stroke-dashoffset: 0 } 90% { stroke-dashoffset: 0; opacity: 1 } 97%, 100% { stroke-dashoffset: 0; opacity: 0 } }
@keyframes kFix   { 0%, 58% { opacity: 0 } 63% { opacity: 1 } 90% { opacity: 1 } 97%, 100% { opacity: 0 } }
@keyframes kDim   { 0%, 60% { opacity: 0 } 68% { opacity: 1 } 90% { opacity: 1 } 97%, 100% { opacity: 0 } }
@keyframes kSheet { 0%, 3% { opacity: 0 } 12% { opacity: 1 } 90% { opacity: 1 } 97%, 100% { opacity: 0 } }
@keyframes kStamp { 0%, 71.5% { opacity: 0; transform: scale(2.4) } 74% { opacity: 1; transform: scale(.94) } 75.5% { transform: scale(1) } 90% { opacity: .95; transform: scale(1) } 97%, 100% { opacity: 0; transform: scale(1) } }

/* CAD status strip */
.sheet-status { display: flex; align-items: center; gap: 10px; padding: 10px 6px 9px; font: 600 .62rem "Inter", sans-serif; letter-spacing: .2em; color: #9d9d9d; text-transform: uppercase; }
.sheet-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.6); animation: pulse 1.6s ease-out infinite; }
.sheet-status .coords { margin-left: auto; color: #6f6f6f; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.sheet-progress { height: 2px; margin: 0 -10px; background: rgba(255,255,255,.06); border-radius: 0 0 14px 14px; overflow: hidden; }
.sheet-progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, rgba(255,255,255,.2), #fff); transform-origin: left; animation: kProg 16s linear infinite; }
@keyframes kProg { 0% { transform: scaleX(0) } 74% { transform: scaleX(1) } 90% { transform: scaleX(1); opacity: 1 } 97%, 100% { transform: scaleX(1); opacity: 0 } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55) } 100% { box-shadow: 0 0 0 9px rgba(255,255,255,0) } }

.auth-hero-copy .eyebrow { font-size: .66rem; letter-spacing: .32em; text-transform: uppercase; color: #9a9a9a; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.auth-hero-copy .eyebrow::before { content: ""; width: 34px; height: 1px; background: #7a7a7a; }
.auth-hero-copy .disciplines { margin: 0; color: #c9c9c9; font-size: .92rem; letter-spacing: .03em; line-height: 1.6; }
.auth-hero-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: #7d7d7d; font-size: .74rem; letter-spacing: .08em; }
.auth-hero-foot em { font-family: var(--display); font-size: 1.15rem; color: #c6c6c6; letter-spacing: 0; }

/* ---------- right: the form ---------- */
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(24px, 3vw, 48px); position: relative; border-left: 1px solid var(--line);
  background: radial-gradient(60% 50% at 100% 0%, var(--stone), transparent 70%), var(--paper); }
.auth-panel-inner { width: 100%; max-width: 360px; margin: 0 auto; animation: rise .7s var(--ease) .1s both; }
.auth-lang { position: absolute; top: 20px; right: 20px; display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.auth-lang button { border: 0; background: transparent; border-radius: 999px; padding: 3px 10px; font-size: .72rem; color: var(--muted); }
.auth-lang button.on, .auth-lang button:hover { background: var(--ink); color: #fff; }
.auth-panel h2 { font-size: 2.35rem; margin: 0 0 4px; line-height: 1; }
.auth-panel .lead-sub { color: var(--muted); margin-bottom: 22px; font-size: .9rem; }
.fl { position: relative; margin-bottom: 12px; }
.fl .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: color .15s; z-index: 1; }
.fl input { width: 100%; height: 52px; border: 1px solid var(--line-2); border-radius: 12px; padding: 19px 44px 4px 42px; font-size: .95rem; background: #fff; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.fl label { position: absolute; left: 42px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; transition: all .18s var(--ease); z-index: 1; }
.fl input:focus, .fl input:not(:placeholder-shown) { border-color: var(--ink); }
.fl input:focus { box-shadow: 0 0 0 5px rgba(11,11,12,.06); }
.fl input:focus ~ .ic, .fl input:not(:placeholder-shown) ~ .ic { color: var(--ink); }
.fl input:focus + label, .fl input:not(:placeholder-shown) + label, .fl input:-webkit-autofill + label { top: 14px; font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 650; color: var(--ink-3); }
/* Remove the browser's blue autofill background – keep the monochrome look */
.fl input:-webkit-autofill, .fl input:-webkit-autofill:hover, .fl input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px #fff inset; box-shadow: 0 0 0 100px #fff inset; -webkit-text-fill-color: var(--ink); caret-color: var(--ink); border-color: var(--ink); transition: background-color 9999s; }
.fl input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 100px #fff inset, 0 0 0 5px rgba(11,11,12,.06); }
.fl .eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; width: 34px; height: 34px; border-radius: 10px; color: var(--muted); display: grid; place-items: center; z-index: 1; }
.fl .eye:hover { background: var(--stone); color: var(--ink); }
.caps { display: none; font-size: .8rem; color: var(--warn); margin: -8px 0 12px 4px; }
.caps.on { display: flex; align-items: center; gap: 6px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: 4px 0 18px; font-size: .85rem; }
.btn-signin { width: 100%; height: 50px; border-radius: 12px; font-size: .95rem; letter-spacing: .02em; justify-content: space-between; padding: 0 22px; }
.btn-signin .arr { transition: transform .2s var(--ease); }
.btn-signin:hover .arr { transform: translateX(4px); }
.trust { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust [data-lucide] { width: 14px; height: 14px; }
.auth .validation-summary-errors { background: #fbe7e5; border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }
.auth .alert { margin-bottom: 18px; }

@media (max-width: 991.98px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-panel { border-left: 0; }
  .sheet { max-width: 100%; }
  .auth-hero { padding: 22px 18px 20px; gap: 14px; }
  .auth-logo { width: 150px; }
  .sheet { padding: 6px 6px 0; }
  .sheet-status { font-size: .54rem; padding: 8px 4px; }
  .sheet-status .coords { display: none; }
  .auth-hero-copy .disciplines { font-size: .8rem; }
  .auth-hero-foot { display: none; }
  .auth-panel { padding: 30px 22px 44px; }
  .auth-lang { position: static; align-self: flex-end; margin-bottom: 22px; max-width: 100%; }
  .auth-panel h2 { font-size: 2.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .plan .draw { stroke-dashoffset: 0; }
  .plan .ph-grid, .plan .ph-open, .plan .ph-fix, .plan .ph-dim, .plan .ph-sheet, .plan .stamp-in { opacity: 1; transform: none; }
  .plan .pen { display: none; }
}

/* =====================================================================
   Mobile experience (phones & small tablets)
   ===================================================================== */
.bottom-nav { display: none; }
@media (max-width: 991.98px) {
  /* app-like bottom navigation */
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1032;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.92); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -20px rgba(0,0,0,.35);
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border: 0; background: none;
    color: var(--muted); font-size: .64rem; font-weight: 600; letter-spacing: .02em; border-radius: 12px; position: relative; min-height: 50px; justify-content: center;
  }
  .bottom-nav [data-lucide] { width: 22px; height: 22px; }
  .bottom-nav a.on { color: var(--ink); }
  .bottom-nav a.on::before { content: ""; position: absolute; top: -7px; width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--ink); }
  .bottom-nav .fab { color: #fff; }
  .bottom-nav .fab .fab-in { width: 54px; height: 54px; margin-top: -26px; border-radius: 18px; display: grid; place-items: center;
    background: linear-gradient(180deg, #2a2a2c, #0b0b0c); box-shadow: 0 12px 24px -10px rgba(0,0,0,.6), 0 0 0 4px var(--bg); }
  .bottom-nav .fab span.lbl { color: var(--ink); }
  .bottom-nav .badge-dot { position: absolute; top: 4px; right: calc(50% - 18px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--ink); color: #fff; font-size: .58rem; display: grid; place-items: center; }
  .app .main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

  /* top bar */
  .topbar { gap: 8px; }
  .topbar-title { display: none; }
  .topbar > .icon-btn.d-lg-none { display: none; }
  .topbar-logo { margin-right: auto; }
  .topbar-actions { gap: 6px; }
  .lang-select { min-width: 0; width: 86px; font-size: .8rem; padding-left: .6rem; }
  .icon-btn { width: 38px; height: 38px; }
  .user-btn { padding: 2px; }

  /* type & spacing */
  .page-head { margin-bottom: 16px; align-items: flex-start; }
  .page-head h2 { font-size: 1.7rem; }
  .page-head > div:last-child:not(:first-child) { width: 100%; }
  .page-head .btn, .page-head form .btn { flex: 1 1 auto; }
  .stat { padding: 14px; border-radius: 16px; }
  .stat .value { font-size: 1.5rem; }
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }
  .kv { grid-template-columns: minmax(90px, max-content) 1fr; gap: 6px 12px; font-size: .9rem; }
  .content > * { animation-duration: .3s; }

  /* touch-friendly controls; 16px inputs stop iOS from zooming on focus */
  .btn { min-height: 42px; }
  .btn-sm { min-height: 34px; }
  .form-control, .form-select, .fl input { font-size: 16px; }
  .form-control-sm, .form-select-sm { font-size: 15px; min-height: 36px; }
  .form-check-input { width: 1.2em; height: 1.2em; }
  .chip { padding: 7px 14px; }

  /* filter bars: full width, two per row */
  .filters { gap: 8px; padding: 10px; }
  .filters > * { flex: 1 1 calc(50% - 8px); min-width: 0 !important; width: auto; }
  .filters .btn { flex: 1 1 100%; }
  .filters .custom { flex-basis: 100%; }
  .filters .custom input { flex: 1; min-width: 0; }

  /* horizontal chip rows scroll instead of wrapping into tall stacks */
  .d-flex.flex-wrap:has(> .chip) { flex-wrap: nowrap !important; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .d-flex.flex-wrap:has(> .chip)::-webkit-scrollbar { display: none; }
  .d-flex.flex-wrap:has(> .chip) > .chip { flex: 0 0 auto; white-space: nowrap; }

  /* ---- tables become stacked cards (labels are added by site.js) ---- */
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tfoot, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tbody tr { border: 1px solid var(--line); border-radius: 14px; margin: 0 0 10px; padding: 8px 12px; background: var(--paper); box-shadow: var(--shadow-1); }
  .card .table.stack tbody tr { margin: 10px; width: auto; }
  .table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 6px 0 !important; text-align: right; min-height: 0; }
  .table.stack td::before { content: attr(data-label); flex: 0 0 auto; max-width: 45%; text-align: left; font-size: .64rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .table.stack td:not([data-label])::before, .table.stack td[data-label=""]::before { display: none; }
  .table.stack td:first-child { font-size: 1rem; text-align: left; justify-content: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 8px !important; margin-bottom: 2px; }
  .table.stack td:first-child::before { display: none; }
  .table.stack td.num { text-align: right; }
  .table.stack td > form, .table.stack td > .d-flex, .table.stack td > .d-inline-flex { flex-wrap: wrap; justify-content: flex-end; }
  .table.stack td:last-child:has(form, .btn) { justify-content: flex-end; flex-wrap: wrap; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px !important; margin-top: 2px; }
  .table.stack td:last-child:has(form, .btn)::before { display: none; }
  .table.stack td input.form-control, .table.stack td select.form-select { max-width: 62%; }
  .table.stack td.empty { display: block; text-align: center; }
  .table.stack tbody tr:has(> td.empty) { box-shadow: none; }
  .table.stack tfoot tr { border-radius: 14px; margin: 0 10px 10px; width: auto; background: var(--stone); padding: 8px 12px; }
  .table.stack tfoot td { background: transparent; border: 0; }
  .table.stack tfoot td:empty { display: none; }
  .table.stack tr[onclick] { cursor: pointer; }
  .table.stack tr[onclick]:active { transform: scale(.99); }
  .table-responsive:has(> .table.stack) { overflow: visible; }

  /* calendar month grid: compact */
  .cal .h { padding: 6px 2px; text-align: center; font-size: .56rem; letter-spacing: .06em; }
  .cal .d { min-height: 64px; padding: 3px; }
  .cal .d .n { font-size: .9rem; }

  /* attendance capture: full-bleed camera */
  .capture { max-width: 100%; }
  .camera { border-radius: 18px; aspect-ratio: auto; height: min(46vh, 380px); }
  .capture #act { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 5; box-shadow: 0 12px 28px -12px rgba(0,0,0,.55); }

  .dropdown-menu { min-width: 220px; }
  .alert { font-size: .9rem; }
}
@media (max-width: 575.98px) {
  .content { padding: 14px 12px; }
  .row.g-3 { --bs-gutter-x: .75rem; --bs-gutter-y: .75rem; }
  .page-head h2 { font-size: 1.5rem; }
  .stat .value { font-size: 1.35rem; }
  .topbar { padding: 0 10px; }
}

/* sharing */
.wa-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #25D366; margin-right: 6px; box-shadow: 0 0 0 3px rgba(37,211,102,.18); }
.share-menu .dropdown-item { display: flex; align-items: center; gap: 8px; }
.share-menu .dropdown-item [data-lucide] { width: 16px; height: 16px; }
.kds-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 2000;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .88rem; box-shadow: var(--shadow-3); transition: all .25s var(--ease); max-width: 90vw; text-align: center; }
.kds-toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 992px) { .kds-toast { bottom: 32px; } }

/* Login: Owner / Staff switch */
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--stone); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; }
.who button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: .88rem; transition: background .15s, color .15s, box-shadow .15s; }
.who button svg { width: 16px; height: 16px; }
.who button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(11,11,12,.1); }
.who button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.who-hint { color: var(--muted); font-size: .76rem; margin: -6px 0 12px; min-height: 1em; }
