/* ==========================================================================
   Hotel Emek — Misafir uygulaması + resepsiyon paneli
   Tokens follow hotelemek.com (css/site.css): cream, bordeaux, gold, Fraunces/Inter.
   ========================================================================== */
:root {
    --bg: #faf7f2;
    --bg-alt: #f3ede4;
    --surface: #ffffff;
    --surface-2: #fbf8f3;
    --ink: #1f1a17;
    --ink-soft: #3d3530;
    --muted: #6f655d;
    --line: #e7dfd3;
    --brand: #8a1c2b;
    --brand-deep: #6a1220;
    --brand-tint: #f6e9e8;
    --gold: #b88a3e;
    --gold-tint: #f5ecdc;
    --ok: #2c7a6f;
    --ok-tint: #e3f1ee;
    --warn: #b8572f;
    --warn-tint: #fbebe3;
    --info: #2f5d8a;
    --info-tint: #e7eef6;
    --hero-a: #6a1220;
    --hero-b: #2a1418;

    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --shadow-sm: 0 1px 2px rgba(31, 26, 23, .05), 0 2px 8px rgba(31, 26, 23, .04);
    --shadow: 0 12px 30px -14px rgba(31, 26, 23, .22), 0 2px 6px rgba(31, 26, 23, .05);
    --ease: cubic-bezier(.2, .7, .2, 1);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #141116; --bg-alt: #1b171d; --surface: #201b22; --surface-2: #262028;
        --ink: #f3ede6; --ink-soft: #dcd3ca; --muted: #a59a90; --line: #352d36;
        --brand: #d9546a; --brand-deep: #b83a50; --brand-tint: #3a1c24;
        --gold: #d6aa5c; --gold-tint: #352a1a; --ok: #5cc0b0; --ok-tint: #17302c;
        --warn: #e98a60; --warn-tint: #3a2219; --info: #8db4e0; --info-tint: #1c2836;
        --hero-a: #3a1520; --hero-b: #17121a;
        --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 12px 30px -14px rgba(0,0,0,.7);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #141116; --bg-alt: #1b171d; --surface: #201b22; --surface-2: #262028;
    --ink: #f3ede6; --ink-soft: #dcd3ca; --muted: #a59a90; --line: #352d36;
    --brand: #d9546a; --brand-deep: #b83a50; --brand-tint: #3a1c24;
    --gold: #d6aa5c; --gold-tint: #352a1a; --ok: #5cc0b0; --ok-tint: #17302c;
    --warn: #e98a60; --warn-tint: #3a2219; --info: #8db4e0; --info-tint: #1c2836;
    --hero-a: #3a1520; --hero-b: #17121a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 12px 30px -14px rgba(0,0,0,.7);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font-family: var(--font-body); font-size: 16px; line-height: 1.5;
    -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 28px; height: 28px; }

/* ---------- Generic UI ---------- */
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }

.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 16px;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 52px; padding: 0 22px; border-radius: 14px; border: 1px solid transparent;
    font-weight: 600; font-size: 16px; text-decoration: none; transition: transform .15s var(--ease), background .2s, opacity .2s;
    background: var(--surface); border-color: var(--line); color: var(--ink);
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }

.field { display: block; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px 4px; }
.input, .textarea, .select {
    width: 100%; min-height: 52px; padding: 13px 16px; border-radius: 14px;
    border: 1px solid var(--line); background: var(--surface); outline: none;
    transition: border-color .2s, box-shadow .2s; font-size: 16px;
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.45; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }

.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    background: var(--bg-alt); color: var(--muted); white-space: nowrap;
}
.chip-new { background: var(--warn-tint); color: var(--warn); }
.chip-progress { background: var(--info-tint); color: var(--info); }
.chip-done { background: var(--ok-tint); color: var(--ok); }
.chip-urgent { background: var(--brand); color: #fff; }

.seg { display: flex; gap: 6px; padding: 4px; background: var(--bg-alt); border-radius: 14px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.toast {
    position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) translateY(20px);
    background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-size: 14.5px; font-weight: 500;
    opacity: 0; pointer-events: none; transition: .3s var(--ease); z-index: 100; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Top notice (panel): slides down from the top edge. */
.banner {
    position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translate(-50%, -140%);
    display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100% - 32px);
    padding: 12px 12px 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 500; line-height: 1.4;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 5px solid var(--info, var(--brand));
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18); opacity: 0; transition: transform .35s var(--ease), opacity .35s var(--ease); z-index: 120;
}
.banner.show { transform: translate(-50%, 0); opacity: 1; }
.banner-ok { border-left-color: var(--ok); }
.banner-warn { border-left-color: var(--warn); }
.banner button { border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; padding: 2px 6px; border-radius: 8px; cursor: pointer; }
.banner button:hover { color: var(--ink); }

.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty .icon { width: 40px; height: 40px; color: var(--line); margin-bottom: 10px; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Guest app
   ========================================================================== */
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.screen { padding: calc(18px + var(--safe-t)) 18px calc(110px + var(--safe-b)); animation: rise .35s var(--ease); }
.screen-plain { padding-bottom: calc(32px + var(--safe-b)); }

.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; min-height: 44px; }
.topbar h1 { font-size: 30px; flex: 1; }
.icon-btn {
    width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
    display: inline-grid; place-items: center; flex: none; text-decoration: none;
}
.lang-btn { font-weight: 700; font-size: 13px; letter-spacing: .04em; }

/* Welcome */
.welcome { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(32px + var(--safe-t)) 22px calc(32px + var(--safe-b)); animation: rise .4s var(--ease); }
.monogram {
    width: 88px; height: 88px; border-radius: 50%; border: 1.5px solid var(--gold); color: var(--gold);
    display: grid; place-items: center; margin: 0 auto 22px; font-family: var(--font-display); font-style: italic; font-size: 44px;
    background: radial-gradient(circle at 50% 35%, var(--gold-tint), transparent 70%);
}
.welcome h1 { text-align: center; font-size: 38px; }
.welcome .sub { text-align: center; color: var(--muted); margin: 6px 0 28px; }
.welcome form { display: grid; gap: 12px; }
.welcome .seg { margin-bottom: 6px; }
.form-error { color: var(--warn); font-size: 14px; text-align: center; min-height: 20px; }
.welcome .foot { text-align: center; margin-top: 22px; font-size: 13.5px; color: var(--muted); }
.welcome .foot a { color: var(--brand); font-weight: 600; text-decoration: none; }

/* Home */
.greet h1 { font-size: 32px; }
.greet p { color: var(--muted); margin-top: 4px; font-size: 14.5px; }
.home-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.home-head .greet { flex: 1; }

.wifi { display: flex; align-items: center; gap: 14px; }
.wifi .badge { width: 48px; height: 48px; border-radius: 14px; background: var(--ok-tint); color: var(--ok); display: grid; place-items: center; flex: none; }
.wifi b { display: block; font-size: 15.5px; }
.wifi .pw { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; color: var(--muted); }
.wifi .copy { margin-left: auto; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tile {
    text-align: left; display: flex; flex-direction: column; gap: 10px; padding: 16px; min-height: 140px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    text-decoration: none; transition: transform .15s var(--ease);
}
.tile:active { transform: scale(.98); }
.tile .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.tile b { font-size: 16px; line-height: 1.25; }
.tile small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.ic-brand { background: var(--brand-tint); color: var(--brand); }
.ic-info { background: var(--info-tint); color: var(--info); }
.ic-ok { background: var(--ok-tint); color: var(--ok); }
.ic-gold { background: var(--gold-tint); color: var(--gold); }
.tile .dot { position: absolute; }

.today {
    margin-top: 12px; border-radius: var(--radius); padding: 18px; color: #fff;
    background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); position: relative; overflow: hidden;
}
.today::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; border: 1px solid rgba(214, 170, 92, .35); }
.today .eyebrow { color: rgba(255,255,255,.7); }
.today b { display: block; font-size: 17px; margin-top: 6px; line-height: 1.35; font-weight: 600; }

.pulse h3 { font-size: 20px; }
.faces { display: flex; justify-content: space-between; gap: 6px; margin-top: 14px; }
.faces button {
    flex: 1; aspect-ratio: 1; max-width: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2);
    font-size: 28px; display: grid; place-items: center; transition: transform .15s var(--ease);
}
.faces button:active, .faces button[aria-pressed="true"] { transform: scale(1.08); border-color: var(--gold); background: var(--gold-tint); }

.row-link { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.row-link:last-child { border-bottom: 0; }
.row-link .grow { flex: 1; min-width: 0; }
.row-link b { display: block; font-size: 15.5px; }
.row-link small { color: var(--muted); font-size: 13px; }
.section-title { font-size: 20px; margin: 26px 0 10px; }

/* Tab bar */
.tabbar {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 520px; z-index: 50;
    display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 8px calc(8px + var(--safe-b));
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; }
.tabbar a[aria-current="page"] { color: var(--brand); }
.tabbar .badge-dot { position: absolute; top: 3px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }

/* Request */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cat {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 96px; padding: 10px 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px; font-size: 13.5px; font-weight: 600; text-align: center; line-height: 1.2;
    transition: .15s var(--ease);
}
.cat[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }
.req-form { display: grid; gap: 12px; margin-top: 14px; }
.sla { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.sla::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.req-item { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.req-item:last-child { border-bottom: 0; }
.req-item .top { display: flex; align-items: center; gap: 8px; }
.req-item .top b { flex: 1; }
.req-item .reply { background: var(--ok-tint); color: var(--ink-soft); padding: 10px 12px; border-radius: 12px; font-size: 14px; }

.steps { display: flex; gap: 6px; margin-top: 4px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--ok); }

/* Chat */
.chat-screen { display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding: 0; }
.chat-head { padding: calc(14px + var(--safe-t)) 18px 12px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-head h1 { font-size: 22px; flex: 1; }
.chat-head .chip { background: var(--ok-tint); color: var(--ok); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.bubble { max-width: 82%; padding: 11px 14px; border-radius: 18px; font-size: 15.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; animation: rise .25s var(--ease); }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble .who { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 3px; }
.bubble .meta { display: block; font-size: 11px; opacity: .65; margin-top: 4px; }
.bubble.sys { align-self: center; background: transparent; color: var(--muted); font-size: 13px; text-align: center; padding: 4px 10px; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.quick { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 10px; scrollbar-width: none; }
.quick button { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 13.5px; font-weight: 500; }
.composer { display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { flex: 1; min-height: 46px; max-height: 120px; padding: 12px 16px; border-radius: 23px; border: 1px solid var(--line); background: var(--bg); resize: none; outline: none; font-size: 16px; }
.composer button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }

/* Explore */
.map {
    height: 170px; border-radius: var(--radius); position: relative; overflow: hidden; border: 1px solid var(--line);
    background: radial-gradient(circle at 30% 70%, var(--ok-tint), transparent 55%), radial-gradient(circle at 75% 30%, var(--gold-tint), transparent 50%), var(--surface-2);
}
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pin { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; }
.pin i { width: 12px; height: 12px; border-radius: 50%; background: var(--warn); border: 2px solid var(--surface); box-shadow: var(--shadow-sm); }
.pin.home i { width: 16px; height: 16px; background: var(--brand); }
.pin span { background: var(--surface); padding: 2px 7px; border-radius: 6px; box-shadow: var(--shadow-sm); white-space: nowrap; }
.place { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.place:last-child { border-bottom: 0; }
.mins { width: 50px; height: 50px; border-radius: 12px; background: var(--ok-tint); color: var(--ok); display: grid; place-items: center; text-align: center; line-height: 1; flex: none; }
.mins b { font-size: 17px; display: block; } .mins small { font-size: 10.5px; font-weight: 600; }
.place .grow { flex: 1; min-width: 0; }
.place b { display: block; font-size: 15.5px; }
.place small { color: var(--muted); font-size: 13px; }
.plan { display: grid; gap: 10px; }
.plan .slot { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: start; }
.plan .slot time { font-weight: 700; color: var(--gold); font-size: 14px; padding-top: 2px; }

/* Review */
.stars { display: flex; justify-content: center; gap: 6px; margin: 18px 0 6px; }
.stars button { border: 0; background: none; padding: 4px; color: var(--line); transition: transform .15s var(--ease), color .15s; }
.stars button .icon { width: 42px; height: 42px; stroke-width: 1.3; }
.stars button.on { color: var(--gold); }
.stars button.on .icon { fill: currentColor; }
.stars button:active { transform: scale(1.15); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; }
.tags button[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-tint); color: var(--ok); }
.share-list { display: grid; gap: 10px; }
.share-btn { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 600; }
.share-btn .grow { flex: 1; }
.share-btn .logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 16px; }
.offer { border: 1.5px dashed var(--gold); background: var(--gold-tint); border-radius: var(--radius); padding: 16px; text-align: center; }
.offer code { display: inline-block; font-size: 22px; font-weight: 700; letter-spacing: .12em; color: var(--brand); margin: 8px 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-soft); }
.check input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; margin-top: 1px; }

.stack { display: grid; gap: 12px; }
.mt { margin-top: 12px; } .mt2 { margin-top: 22px; }
.center { text-align: center; }
.hero-ok { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-tint); color: var(--ok); display: grid; place-items: center; margin: 8px auto 14px; }
.hero-ok .icon { width: 36px; height: 36px; }

/* ==========================================================================
   Reception panel
   ========================================================================== */
.panel { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.side .brand .mono { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-style: italic; font-size: 22px; }
.side .brand b { font-family: var(--font-display); font-size: 18px; font-weight: 500; display: block; line-height: 1.1; }
.side .brand small { color: var(--muted); font-size: 12px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav-link:hover { background: var(--bg-alt); }
.nav-link[aria-current="page"] { background: var(--brand-tint); color: var(--brand); font-weight: 600; }
.nav-link .count { margin-left: auto; min-width: 22px; height: 22px; border-radius: 11px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.side .me { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.side .me b { color: var(--ink); }

.main { padding: 26px clamp(16px, 3vw, 36px) 60px; min-width: 0; }
.main-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.main-head h1 { font-size: 30px; flex: 1; min-width: 200px; }
.main-head .sub { width: 100%; color: var(--muted); font-size: 14px; margin-top: -8px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 500; line-height: 1.1; }
.stat small { color: var(--muted); font-size: 13px; }
.stat.ok b { color: var(--ok); }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }

.ticket { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 10px; animation: rise .3s var(--ease); }
.ticket.in_progress { border-left-color: var(--info); }
.ticket.done { border-left-color: var(--ok); opacity: .8; }
.ticket.urgent { border-left-color: var(--brand); box-shadow: 0 0 0 1px var(--brand-tint), var(--shadow-sm); }
.ticket .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ticket .top b { font-size: 16px; flex: 1; }
.ticket .orig { color: var(--muted); font-style: italic; font-size: 14px; }
.ticket .tr { border-top: 1px dashed var(--line); padding-top: 8px; }
.ticket .tr .eyebrow { font-size: 10.5px; }
.ticket .tr p { color: var(--info); font-weight: 600; margin-top: 2px; }
.ticket .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ticket .reply-row { display: flex; gap: 8px; }
.ticket .reply-row .input { min-height: 40px; padding: 8px 12px; font-size: 14px; border-radius: 11px; }
.list { display: grid; gap: 12px; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td .btn-sm { min-height: 34px; padding: 0 10px; font-size: 13px; }
.room-no { font-weight: 700; font-size: 16px; }

.chat-panel { display: grid; grid-template-columns: 300px 1fr; grid-template-rows: 100%; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: calc(100vh - 130px); min-height: 460px; }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-list button { display: block; width: 100%; text-align: left; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.chat-list button[aria-current="true"] { background: var(--brand-tint); }
.chat-list .r1 { display: flex; gap: 8px; align-items: center; }
.chat-list .r1 b { flex: 1; }
.chat-list p { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-panel > * { min-height: 0; }
.thread { display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; }
.thread .chat-log { min-height: 0; }
.thread .composer, .thread .quick-replies { flex: none; }
.thread .chat-log { background: var(--bg); }
.thread .bubble .tr { display: block; border-top: 1px solid rgba(255,255,255,.25); margin-top: 6px; padding-top: 6px; font-size: 14px; }
.thread .bubble.them .tr { border-top-color: var(--line); color: var(--info); font-weight: 600; }
.thread .composer { padding-bottom: 10px; }
.quick-replies { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 0; background: var(--surface); }
.quick-replies button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 6px 12px; font-size: 13px; }

.modal { position: fixed; inset: 0; z-index: 90; background: rgba(20, 16, 18, .45); display: grid; place-items: center; padding: 16px; animation: rise .2s var(--ease); }
.modal .card { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; }
.modal h2 { font-size: 24px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.login-box { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box .card { width: 100%; max-width: 380px; padding: 28px; text-align: center; }
.pin-input { text-align: center; font-size: 26px; letter-spacing: .5em; font-weight: 700; }

.fb { display: grid; gap: 8px; }
.fb .score { font-size: 18px; color: var(--gold); letter-spacing: 2px; }
.fb.bad { border-left: 4px solid var(--brand); }

@media (max-width: 860px) {
    .panel { grid-template-columns: 1fr; }
    .side { position: sticky; top: 0; z-index: 40; height: auto; flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); }
    .side .brand, .side .me { display: none; }
    .nav-link { flex: none; padding: 9px 12px; font-size: 14px; }
    .chat-panel { grid-template-columns: 1fr; height: auto; }
    .chat-list { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
    .thread { height: 70vh; }
    .form-grid { grid-template-columns: 1fr; }
}
.ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.ico.ic-brand, .ico.ic-info, .ico.ic-ok, .ico.ic-gold { border: 0; }
.fb-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.no-anim .ticket, .no-anim .card, .no-anim .bubble { animation: none; }

/* ---------- Requests board (compact two-lane layout) ---------- */
.board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.lane { background: var(--bg-alt); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; }
.lane h2 { font-family: var(--font-body); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.lane-count { min-width: 22px; height: 22px; border-radius: 11px; display: inline-grid; place-items: center; padding: 0 7px; font-size: 12px; background: var(--surface); color: var(--ink); letter-spacing: 0; }
.lane-new .lane-count { background: var(--warn); color: #fff; }
.lane-progress .lane-count { background: var(--info); color: #fff; }
.lane-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 18px 8px; }
.tk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }

.tk { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; animation: rise .3s var(--ease); }
.tk.in_progress { border-left-color: var(--info); }
.tk.done { border-left-color: var(--ok); opacity: .85; }
.tk.urgent { border-left-color: var(--brand); }
.tk.late .chip-new { background: var(--warn); color: #fff; }
.tk-head { display: flex; align-items: center; gap: 10px; }
.tk-room { min-width: 46px; height: 40px; padding: 0 6px; border-radius: 10px; background: var(--bg-alt); display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.tk-title { flex: 1; min-width: 0; }
.tk-title b { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.tk-title small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-text { font-size: 15px; font-weight: 500; }
.tk-orig { font-size: 13px; color: var(--muted); font-style: italic; margin-top: -4px; }
.tk-reply { font-size: 13.5px; color: var(--ok); display: flex; gap: 6px; align-items: flex-start; }
.tk-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tk-actions .btn-ok { margin-left: auto; }
.tk-box { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; }
.tk-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-quick button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 6px 12px; font-size: 13px; text-align: left; }
.tk-quick button:hover { border-color: var(--brand); }
.tk-box .reply-row { display: flex; gap: 8px; }
.tk-box .reply-row .input { min-height: 40px; padding: 8px 12px; font-size: 14px; border-radius: 11px; }
.tk-link { font-size: 13px; color: var(--brand); font-weight: 600; text-decoration: none; }
.no-anim .tk { animation: none; }
@media (max-width: 860px) { .board { grid-template-columns: 1fr; } }

/* ---------- Announcement banner & device cards (guest) ---------- */
.announce { display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin-bottom: 12px; border-radius: var(--radius); background: var(--gold-tint); border: 1px solid var(--gold); animation: rise .35s var(--ease); }
.announce .grow { flex: 1; min-width: 0; }
.announce p { font-weight: 600; margin-top: 2px; }
.announce .icon-btn { width: 34px; height: 34px; border-radius: 10px; background: transparent; border-color: transparent; }
.device { padding: 12px 14px; }
/* Cards that reuse the row-link layout keep a full border and breathe between sections. */
.card.row-link { border: 1px solid var(--line); padding: 12px 14px; }
.device { margin: 0 0 12px; }
.device + .device { margin-top: 0; }
