/* =====================================================================
   ESCAPE CONTROL — app.css — Design system "vibe Apple"
   Referência de linguagem visual: TattooControl (glassmorphism, dock
   flutuante, cartão "hero" com gradiente, ícones em traço fino, tema
   claro/escuro). Paleta própria do Escape Control: violeta/índigo sobre
   neutros grafite — escuro por padrão (identidade já estabelecida),
   com tema claro disponível pelo botão no dock.
   ===================================================================== */

/* ---------- Tokens: tema escuro (padrão) ---------- */
:root {
    --bg: #0a0a10;
    --bg-glow:
        radial-gradient(1200px 600px at 85% -10%, rgba(109, 94, 248, .20), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(74, 63, 208, .16), transparent 60%);
    --surface: #14151d;
    --surface-2: #1b1d28;
    --surface-3: #242735;
    --text: #edeef4;
    --text-2: #9aa0b4;
    --text-3: #676d80;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .14);

    --accent: #6d5ef8;
    --accent-2: #4a3fd0;
    --accent-grad: linear-gradient(135deg, #8b7bff 0%, #6d5ef8 50%, #4a3fd0 100%);
    --accent-ink: #ab9dff;
    --accent-soft: rgba(109, 94, 248, .18);
    --accent-ring: rgba(171, 157, 255, .28);
    --on-accent: #ffffff;

    --green: #45c97e;
    --green-soft: rgba(69, 201, 126, .13);
    --orange: #f0a43a;
    --orange-soft: rgba(240, 164, 58, .14);
    --blue: #5aa9ff;
    --blue-soft: rgba(90, 169, 255, .14);
    --danger: #ff6b5e;
    --danger-soft: rgba(255, 107, 94, .14);

    --glass: rgba(20, 21, 29, .62);
    --glass-strong: rgba(25, 26, 36, .92);
    --glass-line: rgba(255, 255, 255, .10);
    --glass-shadow: 0 10px 40px rgba(0, 0, 0, .55), 0 1px 0 rgba(255, 255, 255, .05) inset;

    --shadow-sm: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 2px 10px rgba(0, 0, 0, .28);
    --shadow-md: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 12px 32px rgba(0, 0, 0, .40);
    --shadow-lg: 0 24px 80px rgba(0, 0, 0, .60);

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 22px;

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, monospace;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --dock-h: 96px;

    color-scheme: dark;
}

/* ---------- Tokens: tema claro (opt-in via botão no dock) ---------- */
:root[data-theme="light"] {
    --bg: #eeedf5;
    --bg-glow:
        radial-gradient(1200px 600px at 85% -10%, rgba(109, 94, 248, .09), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(74, 63, 208, .07), transparent 60%);
    --surface: #ffffff;
    --surface-2: #f3f2f9;
    --surface-3: #e8e6f2;
    --text: #101018;
    --text-2: #585d6e;
    --text-3: #8c8fa0;
    --line: rgba(20, 15, 60, .08);
    --line-strong: rgba(20, 15, 60, .14);

    --accent-ink: #5c4de3;
    --accent-soft: rgba(93, 79, 224, .08);
    --accent-ring: rgba(93, 79, 224, .18);
    --on-accent: #ffffff;

    --green: #1b8a4a;
    --green-soft: rgba(27, 138, 74, .10);
    --orange: #a86200;
    --orange-soft: rgba(168, 98, 0, .12);
    --blue: #2673d6;
    --blue-soft: rgba(38, 115, 214, .10);
    --danger: #b3140a;
    --danger-soft: rgba(179, 20, 10, .10);

    --glass: rgba(255, 255, 255, .66);
    --glass-strong: rgba(255, 255, 255, .88);
    --glass-line: rgba(20, 15, 60, .08);
    --glass-shadow: 0 10px 40px rgba(20, 15, 60, .14), 0 1px 0 rgba(255, 255, 255, .6) inset;

    --shadow-sm: 0 1px 2px rgba(20, 15, 60, .04), 0 2px 8px rgba(20, 15, 60, .04);
    --shadow-md: 0 4px 12px rgba(20, 15, 60, .06), 0 12px 32px rgba(20, 15, 60, .06);
    --shadow-lg: 0 24px 80px rgba(20, 15, 60, .20);

    color-scheme: light;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    letter-spacing: -.005em;
    color: var(--text);
    background: var(--bg);
    background-image: var(--bg-glow);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.icon { flex-shrink: 0; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
p { margin: 0; }
::selection { background: var(--accent-ring); }
:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; border-radius: 8px; }

/* ---------- Topo ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 1180px; width: 100%; margin: 0 auto; padding: 18px 24px 0; gap: 16px; flex-shrink: 0;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; letter-spacing: -.01em; }
.brand-mark svg { display: block; border-radius: 9px; box-shadow: 0 4px 12px rgba(109, 94, 248, .32); }
.brand-name { font-weight: 600; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-user {
    display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 14px;
    border-radius: 999px; background: var(--glass); border: 1px solid var(--line);
    backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.topbar-user-text { display: flex; flex-direction: column; text-align: right; line-height: 1.15; }
.topbar-user-text strong { font-size: 13px; font-weight: 600; }
.topbar-user-text small { font-size: 11.5px; color: var(--text-2); }
.inline-form { display: inline; }

.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    background: var(--accent-grad); color: #fff; font-size: 13px; font-weight: 600; letter-spacing: 0;
}

/* Faixa de "modo suporte" (Super Admin acessando como uma empresa cliente) */
.impersonation-banner {
    display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
    padding: 9px 24px; font-size: 13px; font-weight: 600;
    background: var(--orange-soft); color: var(--orange);
    border-bottom: 1px solid var(--line);
}
.impersonation-banner span { display: flex; align-items: center; gap: 8px; }
.impersonation-banner .btn-sm { color: var(--orange); border-color: rgba(240, 164, 58, .4); }

.btn-icon {
    width: 36px; height: 36px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; background: transparent;
    border: 1px solid var(--line); color: var(--text-2); cursor: pointer; font-size: 14px;
    transition: background .2s, color .2s;
}
.btn-icon:hover { color: var(--text); background: var(--surface-2); }

/* ---------- Conteúdo ---------- */
.content {
    padding: 28px 24px calc(var(--dock-h) + 40px);
    flex: 1; max-width: 1180px; width: 100%; margin: 0 auto;
    animation: page-in .4s var(--ease) both;
}
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header h1 { font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.page-header .eyebrow { display: block; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); margin-bottom: 4px; }
.page-header p { color: var(--text-2); margin-top: 4px; }

.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13.5px; margin-bottom: 18px; font-weight: 500; }
.alert-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(255, 107, 94, .28); }
.alert-success { background: var(--green-soft); color: var(--green); border: 1px solid rgba(69, 201, 126, .28); }
.alert-warning { background: var(--orange-soft); color: var(--orange); border: 1px solid rgba(240, 164, 58, .35); display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
.alert-warning .icon { flex-shrink: 0; margin-top: 2px; }
.alert-warning.hidden { display: none !important; }

/* ---------- Cards & métricas ---------- */
.card {
    background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--line);
    box-shadow: var(--shadow-sm); padding: 20px;
}
.cards-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); font-weight: 500; margin-bottom: 12px; }
.card-value { font-size: 27px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* Cartão "hero" — destaca a métrica mais importante (1º card do grid) */
.cards-grid .card:first-child,
.card.card-hero {
    position: relative; overflow: hidden;
    background: var(--accent-grad); color: #fff; border: 0;
    box-shadow: 0 14px 34px rgba(109, 94, 248, .30);
}
.cards-grid .card:first-child .card-label,
.card.card-hero .card-label { color: rgba(255, 255, 255, .78); }
.cards-grid .card:first-child::after,
.card.card-hero::after {
    content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .18), transparent); pointer-events: none;
}

/* ---------- Botões ---------- */
.btn-primary, .btn-ghost, .btn-danger, .btn-tinted, .btn-green {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
    font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap;
    transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s, color .2s, border-color .2s;
    -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn-primary:active, .btn-ghost:active, .btn-danger:active { transform: scale(.97); }
.btn-primary {
    background: var(--accent-grad); color: var(--on-accent);
    box-shadow: 0 6px 18px rgba(109, 94, 248, .30), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(109, 94, 248, .42), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-tinted { background: var(--accent-soft); color: var(--accent-ink); }
.btn-tinted:hover { background: var(--accent-ring); }
.btn-green { background: var(--green-soft); color: var(--green); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(255, 107, 94, .35); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-inline { width: auto; }
.btn-sm { height: 32px; padding: 0 13px; font-size: 13px; }
.btn[disabled], button[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Campos de formulário ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 16px; }
.field > label, .filter-bar label { font-size: 12.5px; font-weight: 600; color: var(--text-2); padding-left: 2px; }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="number"], .field input[type="tel"], .field input[type="date"],
.field input[type="time"], .field select, .field textarea, .search-input,
.filter-bar input, .filter-bar select {
    width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid transparent; color: var(--text);
    font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none; appearance: none; font-family: inherit;
}
.field textarea { height: auto; min-height: 88px; padding: 11px 14px; resize: vertical; line-height: 1.45; }
.field select {
    padding-right: 36px; cursor: pointer;
    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='%238A8A8A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
.field input:hover, .field select:hover, .field textarea:hover,
.search-input:hover, .filter-bar input:hover, .filter-bar select:hover { background-color: var(--surface-3); }
.field input:focus, .field select:focus, .field textarea:focus,
.search-input:focus, .filter-bar input:focus, .filter-bar select:focus {
    border-color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-ring); background-color: var(--surface);
}
.field input::placeholder, .field textarea::placeholder, .search-input::placeholder { color: var(--text-3); }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="time"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
:root:not([data-theme="light"]) input[type="date"]::-webkit-calendar-picker-indicator,
:root:not([data-theme="light"]) input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1); }
.field-error { color: var(--danger); font-size: 12px; margin-top: 6px; }
.field-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.field-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 13px; }
.password-toggle { display: flex; gap: 8px; align-items: center; color: var(--text-2); }

.checkbox-field label { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.checkbox-field input[type="checkbox"] { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- Formulários em cartão ---------- */
.form-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); padding: 26px; max-width: 560px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .field.full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }

/* ---------- Cartões "lista" (Salas, Empresas, Cupons, Equipe…) ---------- */
.cards-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.item-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px;
    display: flex; flex-direction: column; gap: 6px;
    box-shadow: var(--shadow-sm); transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.item-card h3 { margin: 2px 0 4px; font-size: 16px; font-weight: 650; }
.item-card-head { display: flex; justify-content: flex-end; }
/* .item-card-link também é usado em <button> (abre modal de edição), além
   de <a> (link direto) — por isso sem qualificador de tag. */
.item-card-link { width: 100%; text-align: left; cursor: pointer; }
.item-card-link:hover { border-color: var(--accent-ring); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.status-pill {
    display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; align-self: flex-start; white-space: nowrap;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-pill.status-active,
.status-pill.status-completed,
.status-pill.status-escaped { background: var(--green-soft); color: var(--green); }
.status-pill.status-inactive,
.status-pill.status-suspended,
.status-pill.status-cancelled,
.status-pill.status-no_show,
.status-pill.status-not_escaped { background: var(--danger-soft); color: var(--danger); }
.status-pill.status-maintenance,
.status-pill.status-awaiting,
.status-pill.status-pending { background: var(--orange-soft); color: var(--orange); }
.status-pill.status-confirmed,
.status-pill.status-checked_in,
.status-pill.status-paid { background: var(--blue-soft); color: var(--blue); }
.status-pill.status-in_progress { background: var(--accent-soft); color: var(--accent-ink); }

.item-meta { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.item-meta .icon { color: var(--text-3); }
.item-price { font-size: 18px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.item-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Bloco de credenciais (exibidas uma única vez) ---------- */
.credentials-box { display: flex; flex-direction: column; gap: 8px; }
.credentials-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.credentials-line code { background: var(--surface-2); padding: 3px 10px; border-radius: 8px; font-family: var(--mono); color: var(--accent-ink); }

/* ---------- Busca ---------- */
.search-bar { display: flex; gap: 10px; margin-bottom: 18px; max-width: 480px; }
.search-input { flex: 1; }

/* ---------- Tabela ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--line); }
.simple-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.simple-table th, .simple-table td { padding: 13px 16px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.simple-table th { color: var(--text-3); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.simple-table tbody tr:last-child td { border-bottom: none; }
.simple-table tbody tr { transition: background .15s; }
.simple-table tbody tr:hover { background: var(--surface-2); }

/* ---------- Filtros ---------- */
.filter-bar { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar .field { margin: 0; }

/* ---------- Cartões de métrica (Dashboard, Relatórios) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat-card .stat-label { font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; font-weight: 500; }
.stat-card .stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-card.stat-hero { background: var(--accent-grad); color: #fff; border: 0; box-shadow: 0 14px 34px rgba(109, 94, 248, .30); }
.stat-card.stat-hero .stat-label { color: rgba(255, 255, 255, .78); }
.stat-card.stat-hero::after {
    content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .18), transparent); pointer-events: none;
}

/* ---------- Autocomplete ---------- */
.autocomplete { position: relative; }
.autocomplete-results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
    background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--radius);
    max-height: 240px; overflow-y: auto; box-shadow: var(--shadow-md); display: none; padding: 6px;
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.autocomplete-results.open { display: block; }
.autocomplete-item { padding: 9px 10px; font-size: 13.5px; cursor: pointer; border-radius: 10px; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--accent-soft); }
.autocomplete-item small { display: block; color: var(--text-2); font-size: 11.5px; }

/* ---------- Vazio / erro ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-2); }
.error-page { text-align: center; }
.error-code {
    font-size: 64px; font-weight: 800; letter-spacing: -.04em; display: block;
    background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.error-page h1 { font-size: 20px; margin: 10px 0 6px; }
.error-page p { color: var(--text-2); margin-bottom: 22px; }

/* =====================================================================
   DOCK — navegação flutuante estilo macOS/iOS, com ícones "de app"
   coloridos e alternância de tema. Efeito de ampliação sob o cursor via
   JS (initDockMagnify em app.js); aqui só o visual estático + tooltip.
   ===================================================================== */
.dock {
    position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
    z-index: 60; max-width: calc(100vw - 20px); pointer-events: none;
}
.dock-inner {
    pointer-events: auto;
    display: flex; align-items: flex-end; gap: 7px;
    height: 70px; padding: 0 10px 9px; border-radius: 26px;
    background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
    backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%);
    max-width: calc(100vw - 20px);
}

/* --s controla o tamanho real do ícone (largura/altura), não um
   transform:scale() — assim o layout flex empurra os vizinhos e ganha
   espaço de verdade ao crescer, sem sobrepor nada ao redor (era o bug
   reportado: o scale antigo só "pintava" por cima, sem reservar espaço,
   e o dock ficava sobrepondo o conteúdo da página ao passar o mouse). */
.dock-item {
    --s: 52px;
    position: relative; display: flex; flex-direction: column; align-items: center; flex-shrink: 0;
    width: var(--s); border: 0; background: none; padding: 0; margin: 0;
    transition: width .18s var(--ease); -webkit-tap-highlight-color: transparent;
}
.dock-icon {
    width: var(--s); height: var(--s); border-radius: 23%; display: grid; place-items: center; color: #fff;
    position: relative; overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(0, 0, 0, .15);
    transition: width .18s var(--ease), height .18s var(--ease), transform .3s var(--ease);
}
.dock-icon::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 45%);
}
.dock-icon .icon { width: 46%; height: 46%; }
.dock-item:active .dock-icon { transform: scale(.92); }

.dock-item.active::after {
    content: ""; position: absolute; bottom: -8px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px;
    border-radius: 50%; background: var(--text); opacity: .8;
}
.dock-tooltip {
    content: ""; position: absolute; bottom: calc(100% + 12px); left: 50%;
    transform: translate(-50%, 4px); padding: 5px 11px; border-radius: 8px; white-space: nowrap;
    font-size: 12.5px; font-weight: 500; color: var(--text);
    background: var(--glass-strong); border: 1px solid var(--line); box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
@media (hover: hover) and (pointer: fine) {
    .dock-item:hover .dock-tooltip, .dock-item:focus-visible .dock-tooltip { opacity: 1; transform: translate(-50%, 0); }
}
.dock-label { display: none; }
.dock-sep { width: 1px; height: 44px; align-self: flex-end; margin: 0 3px 4px; background: var(--line-strong); }

/* Cores dos "ícones de app" do dock — variedade tipo tela inicial do iOS,
   todas na mesma fórmula de gradiente + brilho, dentro da família violeta
   do Escape Control mais alguns complementares para diferenciar módulos. */
.tile-violet   { background: linear-gradient(160deg, #9384ff 0%, #6d5ef8 55%, #4a3fd0 100%); }
.tile-indigo   { background: linear-gradient(160deg, #6f8bff 0%, #3f5fe0 55%, #2438a8 100%); }
.tile-graphite { background: linear-gradient(160deg, #7a7f92 0%, #4d5266 55%, #262a36 100%); }
.tile-teal     { background: linear-gradient(160deg, #3fd6c4 0%, #14a390 55%, #0a6a5c 100%); }
.tile-amber    { background: linear-gradient(160deg, #ffc36b 0%, #f0a43a 55%, #a86a10 100%); }
.tile-magenta  { background: linear-gradient(160deg, #ff7fc0 0%, #e03f96 55%, #971e63 100%); }
.tile-slate    { background: linear-gradient(160deg, #8891a8 0%, #5b6278 55%, #33374a 100%); }
.tile-onyx     { background: linear-gradient(160deg, #3a3a45 0%, #17171d 55%, #000000 100%); }
.tile-glass    { background: var(--surface); color: var(--text); box-shadow: 0 4px 10px rgba(0, 0, 0, .16), inset 0 0 0 1px var(--line); }
.tile-glass::after { display: none; }
.tile-avatar   { background: var(--accent-grad); color: #fff; font-weight: 600; font-size: 19px; letter-spacing: 0; }

/* Ícone do dock que mostra o dia de hoje (tipo o app Calendário da Apple) */
.cal-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; line-height: 1; background: var(--surface); }
.cal-tile-wd { font-size: calc(var(--s) * .19); font-weight: 700; color: var(--accent-ink); letter-spacing: .03em; margin-top: 4%; text-transform: uppercase; }
.cal-tile-day { font-size: calc(var(--s) * .5); font-weight: 500; letter-spacing: -.04em; color: var(--text); margin-top: -2%; }

/* Alternância de tema (sol / lua) */
.theme-ico { display: grid; place-items: center; width: 100%; height: 100%; }
.theme-ico-moon { display: none; }
:root[data-theme="light"] .theme-ico-sun { display: none; }
:root[data-theme="light"] .theme-ico-moon { display: grid; }
:root:not([data-theme="light"]) .theme-ico-moon { display: none; }
:root:not([data-theme="light"]) .theme-ico-sun { display: grid; }

/* =====================================================================
   MODAIS (sheets) — <dialog class="sheet">, mesmo padrão do TattooControl:
   centralizado no desktop, vira bottom sheet no mobile. Reaproveitado por
   toda a app para criar/editar (ver .hidden { display: none !important; }
   já usado nas views para o padrão data-when-edit/data-when-new em app.js).
   ===================================================================== */
.hidden { display: none !important; }

dialog.sheet {
    border: 0; padding: 0; margin: auto;
    width: min(600px, calc(100vw - 24px)); max-height: min(88dvh, 860px);
    border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
    box-shadow: var(--shadow-lg); overflow: hidden;
    display: none; flex-direction: column;
}
dialog.sheet[open] { display: flex; animation: sheet-in .32s var(--ease); }
dialog.sheet.is-closing { animation: sheet-out .2s ease-in forwards; }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in .25s ease; }
dialog.sheet.is-closing::backdrop { animation: fade-out .2s ease forwards; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes sheet-up { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: none; } }
@keyframes sheet-down { to { opacity: 0; transform: translateY(60%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.sheet-head {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
    padding: 16px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0;
    background: var(--surface);
}
.sheet-head h3 { font-size: 16px; font-weight: 650; text-align: center; }
.sheet-head .btn-ghost, .sheet-head .btn-primary { justify-self: start; }
.sheet-head .btn-primary { justify-self: end; }
.sheet-body { padding: 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
/* O <form> fica entre o <dialog> e o cabeçalho/corpo/rodapé: precisa ser coluna
   flex com altura limitada, senão o .sheet-body nunca rola (no celular a tela de
   trás é que rolava). html.sheet-open trava o scroll da página enquanto há modal. */
dialog.sheet > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; max-height: inherit; overflow: hidden; }
html.sheet-open, html.sheet-open body { overflow: hidden; }
.sheet-foot-save { justify-content: stretch; background: var(--surface); padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.sheet-foot-save .btn-primary { width: 100%; justify-content: center; }
.sheet-body .form-grid { grid-template-columns: 1fr 1fr; }
.sheet-foot { display: flex; gap: 10px; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; flex-shrink: 0; }
.sheet-foot:empty { display: none; }

.sheet-alert { width: min(360px, calc(100vw - 32px)) !important; text-align: center; }
.alert-body { padding: 28px 24px 18px; }
.alert-ico { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }
.alert-body h3 { font-size: 17px; margin-bottom: 6px; }
.alert-body p { font-size: 14px; color: var(--text-2); }
.alert-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 20px 22px; }

@media (max-width: 640px) {
    dialog.sheet {
        width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0;
        max-height: 94dvh; padding-bottom: env(safe-area-inset-bottom);
    }
    dialog.sheet[open] { animation: sheet-up .38s var(--ease); }
    dialog.sheet.is-closing { animation: sheet-down .22s ease-in forwards; }
    dialog.sheet-alert { margin: auto; border-radius: 20px; }
    dialog.sheet-alert[open] { animation: sheet-in .3s var(--ease); }
    .sheet-head { position: relative; padding-top: 20px; }
    .sheet-head::before {
        content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 5px;
        margin-left: -18px; border-radius: 3px; background: var(--line-strong);
    }
    .sheet-body { padding: 16px; }
    .sheet-body .form-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   LOGIN / RECUPERAÇÃO DE SENHA — tela dividida (arte + formulário)
   ===================================================================== */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art {
    position: relative; overflow: hidden; color: #edeef4; padding: 48px;
    display: flex; flex-direction: column; justify-content: space-between;
    background:
        radial-gradient(800px 500px at 20% 10%, rgba(139, 123, 255, .55), transparent 60%),
        radial-gradient(700px 600px at 90% 90%, rgba(74, 63, 208, .65), transparent 60%),
        #08080d;
}
.auth-art::before {
    content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
    background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 14px);
}
.auth-art .topbar-brand { color: #edeef4; position: relative; padding: 0; }
.auth-quote { position: relative; max-width: 460px; }
.auth-quote h2 { font-size: 42px; font-weight: 700; letter-spacing: -.035em; line-height: 1.08; }
.auth-quote h2 em { font-style: normal; color: rgba(237, 238, 244, .55); }
.auth-quote p { margin-top: 16px; color: rgba(237, 238, 244, .72); font-size: 16px; max-width: 380px; }
.auth-feats { position: relative; display: flex; gap: 10px; flex-wrap: wrap; }
.auth-feats span {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(10px);
}
.auth-form-wrap { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-logo .name { font-weight: 600; font-size: 16px; display: block; }
.auth-logo .by { font-size: 11px; color: var(--text-3); display: block; }
.auth-card h1 { font-size: 27px; font-weight: 700; letter-spacing: -.03em; margin-bottom: 4px; }
.auth-card .lead { color: var(--text-2); margin-bottom: 20px; font-size: 14px; }
.auth-theme { position: fixed; top: 16px; right: 16px; z-index: 5; }

/* =====================================================================
   Responsivo
   ===================================================================== */
@media (max-width: 1080px) {
    .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth-art { min-height: 240px; padding: 26px 22px; }
    .auth-quote h2 { font-size: 30px; }
    .auth-feats { display: none; }
}

@media (max-width: 640px) {
    :root { --dock-h: 78px; }
    .topbar { padding: 12px 16px 0; }
    .topbar-user-text { display: none; }
    .topbar-user { padding: 3px; }
    .impersonation-banner { padding: 9px 14px; font-size: 12px; }
    .content { padding: 18px 16px calc(var(--dock-h) + 34px); }
    .page-header { margin-bottom: 18px; align-items: flex-start; }
    .page-header h1 { font-size: 26px; }
    .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .card { padding: 14px; border-radius: 16px; }
    .card-value { font-size: 20px; }
    .stat-grid { gap: 10px; margin-bottom: 16px; }
    .stat-card { padding: 14px; border-radius: 16px; }
    .stat-card .stat-value { font-size: 20px; }
    .form-card { padding: 18px; max-width: 100%; border-radius: 18px; }
    .form-grid { grid-template-columns: 1fr; }
    .item-card { border-radius: 16px; }

    /* Dock vira "tab bar" flutuante, mais compacta */
    .dock-inner { gap: 3px; height: 58px; padding: 0 8px 7px; border-radius: 24px; }
    .dock-item { --s: 42px; }
    .dock-icon { border-radius: 26%; }
    .dock-tooltip { display: none; }
}

/* =====================================================================
   AGENDA — grade do dia (uma coluna por sala, uma linha por horário)
   --hour = altura de 1 hora; precisa bater com $hourPx em agenda/index.php
   ===================================================================== */
.page-sub { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.item-meta.muted, .muted { color: var(--text-3); }

.agenda-new { width: 100%; justify-content: center; gap: 8px; padding: 14px 18px; font-size: 15px; margin-bottom: 14px; }
.agenda-bar { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; }
.agenda-nav { display: flex; align-items: center; justify-content: center; gap: 8px; }
.agenda-date-form input {
    background: var(--surface-2); color: var(--text); border: 0; border-radius: var(--radius-sm);
    padding: 9px 12px; font: inherit; font-size: 14px; font-weight: 600;
}
.agenda-counts { display: flex; justify-content: center; gap: 14px; font-size: 13.5px; color: var(--text-2); }
.agenda-count strong { color: var(--text); font-size: 15px; }

.agenda-wrap {
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    overflow: auto; max-height: calc(100vh - 290px); min-height: 360px;
    -webkit-overflow-scrolling: touch;
}
.agenda { display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(168px, 1fr)); min-width: min-content; }
.agenda-corner, .agenda-head { position: sticky; top: 0; z-index: 4; background: var(--surface); padding: 12px 12px 10px; }
.agenda-corner { left: 0; z-index: 6; }
.agenda-head { display: flex; flex-direction: column; gap: 2px; box-shadow: 0 1px 0 var(--line); }
.agenda-head strong { font-size: 14.5px; letter-spacing: -.01em; }
.agenda-head small { font-size: 12px; color: var(--text-2); }

.agenda-hours { position: sticky; left: 0; z-index: 3; background: var(--surface); }
.agenda-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.agenda-hours span:first-child { transform: translateY(2px); }

.agenda-col {
    position: relative;
    background-image:
        repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent var(--hour)),
        repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) / 2), rgba(127, 127, 150, .06) calc(var(--hour) / 2), rgba(127, 127, 150, .06) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px), transparent var(--hour));
    box-shadow: -1px 0 0 var(--line);
}
.agenda-col.is-clickable { cursor: pointer; }
.agenda-col.is-clickable:hover { background-color: var(--accent-soft); }

.agenda-event {
    position: absolute; left: 5px; right: 5px; z-index: 2;
    display: flex; flex-direction: column; gap: 3px; align-items: stretch; justify-content: flex-start;
    padding: 7px 10px 7px 13px; border: 0; border-radius: 12px; text-align: left; cursor: pointer;
    font: inherit; color: var(--text); overflow: hidden;
    background: var(--surface-3); box-shadow: inset 3px 0 0 var(--text-3);
    transition: transform .15s var(--ease), filter .15s var(--ease);
}
.agenda-event:hover { transform: scale(1.015); filter: brightness(1.08); z-index: 3; }
.agenda-event-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; line-height: 1.2; }
.agenda-event-name {
    font-size: 13.5px; line-height: 1.25; font-weight: 650; min-width: 0;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
    overflow-wrap: anywhere;
}
.agenda-event-time { font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.agenda-event-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-2); flex-shrink: 0; }
.agenda-event.status-awaiting { background: var(--orange-soft); box-shadow: inset 3px 0 0 var(--orange); }
.agenda-event.status-confirmed { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.agenda-event.status-checked_in, .agenda-event.status-in_progress { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.agenda-event.status-completed { background: var(--green-soft); box-shadow: inset 3px 0 0 var(--green); }

.agenda-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 1; pointer-events: none; }
.agenda-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.agenda-tip { margin-top: 12px; font-size: 12.5px; color: var(--text-3); }

/* Detalhe da reserva (modal) */
.detail-title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 12px; }
.detail-list { display: flex; flex-direction: column; gap: 9px; }
.detail-list .item-meta { font-size: 14px; }
.detail-list a { color: var(--accent-ink); text-decoration: none; }
.sheet-foot-actions { justify-content: flex-end; }
.sheet-foot-actions .inline-form { display: inline-flex; }

@media (max-width: 640px) {
    .agenda-wrap { max-height: calc(100vh - 320px); border-radius: var(--radius); }
    .agenda { grid-template-columns: 48px repeat(var(--cols), minmax(150px, 1fr)); }
}


/* ---------- Link de agendamento, foto e horários das salas ---------- */
.link-card {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
    background: var(--accent-soft); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px;
}
.link-card-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 260px; }
.link-card-text strong { font-size: 15px; }
.link-card-text span { font-size: 13px; color: var(--text-2); }
.link-card-text code { font-family: var(--mono); font-size: 12.5px; color: var(--accent-ink); overflow-wrap: anywhere; margin-top: 4px; }
.link-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.item-photo { width: calc(100% + 36px); margin: -18px -18px 10px; height: 150px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; display: block; }
.item-price small { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 4px; }

.photo-preview { width: 100%; max-height: 190px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 10px; display: block; }
.field input[type="file"] { width: 100%; font: inherit; font-size: 13.5px; color: var(--text-2); padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-top: 8px; cursor: pointer; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.field label small { font-weight: 400; color: var(--text-3); }

.day-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.day-pick { cursor: pointer; position: relative; display: inline-flex; }
.day-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.day-pick span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 38px; padding: 0 12px;
    border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600;
    transition: background .15s, color .15s;
}
.day-pick input:checked + span { background: var(--accent); color: var(--on-accent); }
.day-pick input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }

.slot-gen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.slot-gen label { display: inline-flex; align-items: center; gap: 6px; }
.slot-gen input { width: auto; height: 36px; padding: 0 10px; background: var(--surface-2); border: 0; border-radius: 10px; color: var(--text); font: inherit; font-size: 13px; }
.slot-gen input[type="number"] { width: 68px; }

/* Agenda: aguardando confirmação + copiar link */
.agenda-counts { flex-wrap: wrap; align-items: center; }
.agenda-count.is-warn { color: var(--orange); }
.agenda-count.is-warn strong { color: var(--orange); }
.agenda-copy {
    display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--accent-soft); color: var(--accent-ink);
    font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.agenda-copy:hover { background: var(--accent-ring); }


@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
