/* ─── Variables ──────────────────────────────────────────────────── */
:root {
    --sidebar-width: 240px;
    /* Alojamento: degradé verde-azulado (categoria "Hotelaria", docs/alojamento/PLANO_DESENVOLVIMENTO.md §4). */
    --sidebar-bg: linear-gradient(180deg, #134e4a 0%, #0f766e 45%, #14b8a6 100%);
    --sidebar-accent: #14b8a6;
    --topbar-height: 56px;
    --text-muted-light: #6b7280;
}

html, body {
    height: 100%;
    margin: 0;
    font-size: 14px;
}

/* ─── App Layout ─────────────────────────────────────────────────── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
}

/* ─── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #c9d1d9;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.25s ease;
    overflow-y: auto;
    /* #48/#1950 — mesma curvatura usada no Vendas sobre o fundo em degradé. */
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 20px 20px 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.avatar {
    width: 36px; height: 36px;
    background: var(--sidebar-accent);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
    flex-shrink: 0;
}

.user-info {
    overflow: hidden;
    display: flex; flex-direction: column;
}

/* #48/#1950 — --text-muted-light (#6b7280) era pensado para o fundo preto antigo,
   ilegível sobre o novo azul da sidebar (mesmo ajuste feito no Vendas, #1009). */
.user-info small { color: rgba(255,255,255,0.85); font-size: 0.7rem; line-height: 1; }
.user-info span { color: #fff; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    /* #48/#1950 — #8b949e era pensado para o fundo preto antigo, ilegível sobre o
       novo azul (mesmo ajuste feito no Vendas, #1009). */
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.sidebar-link.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-left-color: #fff;
    font-weight: 600;
}

.sidebar-footer {
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ─── Main Content ───────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Topbar ─────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    position: sticky; top: 0; z-index: 99;
}

.sidebar-toggle { color: #6b7280 !important; }
.sidebar-toggle:hover { color: #111 !important; }

/* ─── Stats Cards ────────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted-light); margin-top: 3px; }

/* ─── Tables ─────────────────────────────────────────────────────── */
.table th { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: #6b7280; }
.table td { vertical-align: middle; font-size: 0.875rem; }

/* ─── Employee Avatar ────────────────────────────────────────────── */
.emp-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
    flex-shrink: 0;
}

/* ─── Status Dot ─────────────────────────────────────────────────── */
.status-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.online  { background: #198754; box-shadow: 0 0 0 3px rgba(25,135,84,0.2); }
.status-dot.offline { background: #6c757d; }

/* ─── Login ──────────────────────────────────────────────────────── */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1d23 0%, #23293a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-brand {
    text-align: center;
    margin-bottom: 24px;
}

.letter-spacing-3 { letter-spacing: 0.3em; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}


/* ─── Alojamento ─────────────────────────────────────────────────── */
:root { --al: #0d9488; --al-bg: #ecfdf5; --airbnb: #ff5a5f; --booking: #003580; --vrbo: #245abc; --direto: #0d9488; --bloqueio: #9ca3af; }
.btn-al { background: var(--al); border-color: var(--al); color: #fff; }
.btn-al:hover, .btn-al:focus { background: #0f766e; border-color: #0f766e; color: #fff; }
.al-demo { background: #fef3c7; color: #92400e; border-radius: 8px; padding: 6px 12px; font-size: .82rem; }
.al-kpi-ic { width: 42px; height: 42px; border-radius: 10px; background: var(--al-bg); color: var(--al); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.al-canal { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; color: #fff; white-space: nowrap; }
.al-canal.airbnb { background: var(--airbnb); } .al-canal.booking { background: var(--booking); } .al-canal.vrbo { background: var(--vrbo); }
.al-canal.direto { background: var(--direto); } .al-canal.ical, .al-canal.bloqueio { background: var(--bloqueio); }
.al-estado { font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; white-space: nowrap; display: inline-block; }
.al-e-ok { background: #d1fae5; color: #065f46; } .al-e-info { background: #dbeafe; color: #1e40af; } .al-e-warn { background: #fef3c7; color: #92400e; }
.al-e-err { background: #fee2e2; color: #991b1b; } .al-e-mute { background: #f3f4f6; color: #4b5563; }
.al-tabela th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; font-weight: 700; background: #f9fafb; }
.al-tabela td { vertical-align: middle; }
.al-tabela td.text-end, .al-tabela th.text-end { white-space: nowrap; }
.al-tabela tr.al-click { cursor: pointer; }
.al-tabela tr.al-click:hover td { background: #f0fdfa; }
.al-hbar { display: flex; align-items: center; gap: 10px; margin: 7px 0; font-size: .86rem; }
.al-hbar .n { width: 150px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-hbar .t { flex: 1; height: 10px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.al-hbar .f { height: 100%; border-radius: 6px; background: var(--al); }
.al-hbar .v { width: 90px; text-align: right; font-weight: 600; white-space: nowrap; }
.al-mono { font-family: Consolas, monospace; font-size: .85em; }

/* Calendário (timeline) */
.al-tl-wrap { overflow-x: auto; background: #fff; border-radius: 10px; }
.al-tl { position: relative; }
.al-tl-head, .al-tl-row { display: grid; }
.al-tl-head { position: sticky; top: 0; background: #f9fafb; border-bottom: 1px solid #e5e7eb; z-index: 3; }
.al-tl-head .d { text-align: center; font-size: .7rem; color: #6b7280; padding: 6px 0; border-left: 1px solid #f1f5f9; }
.al-tl-head .d b { display: block; font-size: .88rem; color: #1f2937; }
.al-tl-head .d.we { background: #f3f4f6; }
.al-tl-head .d.hoje { background: var(--al); color: #fff; }
.al-tl-head .d.hoje b { color: #fff; }
.al-tl-row { border-bottom: 1px solid #f1f5f9; height: 52px; position: relative; }
.al-tl-row .u { position: sticky; left: 0; background: #fff; z-index: 2; padding: 6px 12px; font-size: .82rem; border-right: 1px solid #e5e7eb; white-space: nowrap; overflow: hidden; }
.al-tl-row .u small { display: block; color: #6b7280; font-size: .7rem; }
.al-tl-row .c { border-left: 1px solid #f1f5f9; }
.al-tl-row .c.we { background: #fafafa; }
.al-tl-row .c.hoje { background: #f0fdfa; }
.al-tl-bar { position: absolute; top: 9px; height: 34px; border-radius: 8px; color: #fff; font-size: .74rem; padding: 3px 8px; overflow: hidden; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.15); line-height: 1.2; text-decoration: none; z-index: 1; }
.al-tl-bar:hover { color: #fff; filter: brightness(1.08); }
.al-tl-bar small { display: block; opacity: .85; font-size: .66rem; }
.al-tl-bar.airbnb { background: var(--airbnb); }
.al-tl-bar.booking { background: var(--booking); }
.al-tl-bar.vrbo { background: var(--vrbo); }
.al-tl-bar.direto { background: var(--direto); }
.al-tl-bar.bloqueio { background: repeating-linear-gradient(45deg, #9ca3af, #9ca3af 6px, #a8b0bb 6px, #a8b0bb 12px); }

/* Limpezas (quadro) */
.al-kanban { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; }
.al-kcol { background: #eef2f6; border-radius: 12px; padding: 10px; min-height: 260px; }
.al-kcol h6 { font-size: .82rem; font-weight: 700; margin: 4px 6px 10px; display: flex; justify-content: space-between; }
.al-kcard { background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.06); font-size: .82rem; border-left: 4px solid var(--al); }
.al-kcard.urg { border-left-color: #ef4444; }
.al-kcard.prob { border-left-color: #f59e0b; }
.al-kcard .m { color: #6b7280; font-size: .74rem; }

/* Tarifário */
.al-pg { border-collapse: separate; border-spacing: 3px; font-size: .76rem; }
.al-pg th { font-weight: 600; color: #6b7280; text-align: center; padding: 4px; }
.al-pg td.p { min-width: 50px; text-align: center; border-radius: 6px; padding: 6px 2px; background: #f0fdfa; border: 1px solid #ccfbf1; }
.al-pg td.p.oc { background: #f3f4f6; border-color: #e5e7eb; color: #9ca3af; text-decoration: line-through; }
.al-pg td.p.fds { background: #ccfbf1; font-weight: 700; }
.al-pg td.p small { display: block; color: #6b7280; font-size: .64rem; text-decoration: none; }

/* Unidades */
.al-ucard .foto { height: 110px; display: flex; align-items: flex-end; padding: 10px 14px; color: #fff; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.4); border-radius: .375rem .375rem 0 0; }
.al-ucard .l { display: flex; justify-content: space-between; padding: 3px 0; font-size: .84rem; gap: 8px; }

/* Relatórios */
.al-vbars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 14px; }
.al-vbars .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: .74rem; color: #6b7280; }
.al-vbars .b { width: 100%; max-width: 46px; background: #5eead4; border-radius: 6px 6px 0 0; position: relative; }
.al-vbars .b.cur { background: var(--al); }
.al-vbars .b span { position: absolute; top: -18px; left: -10px; right: -10px; text-align: center; font-weight: 700; color: #374151; font-size: .72rem; }

/* Tabelas largas (calendário, tarifário) fazem scroll dentro do cartão em vez de alargar a página. */
.main-content { min-width: 0; }

/* Fase 1: interacção */
.al-tl-row .c.al-tl-livre { cursor: pointer; }
.al-tl-row .c.al-tl-livre:hover { background: #ccfbf1; }
.al-sugestoes { position: absolute; left: 0; right: 0; top: 100%; z-index: 1060; max-height: 260px; overflow-y: auto; }
.al-ck { max-width: 820px; margin: 0 auto; }
.al-ck-topo { background: linear-gradient(135deg, #2DD4BF, #0F766E); color: #fff; border-radius: 14px; padding: 22px 26px; }
.al-ck-hosp { border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px; margin-bottom: 12px; background: #fff; }
.al-quadro .al-tarefa { cursor: pointer; }
