@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:wght@600;700&display=swap');

/* ============================================================
   Recanto — Painel administrativo (minimalista, tons quentes)
   ============================================================ */
:root {
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;

    --bg: #f5f2ed;
    --card: #ffffff;
    --line: #e9e2d7;
    --line-soft: #f1ece4;
    --ink: #2b2620;
    --ink-soft: #6f6458;
    --ink-faint: #a89e90;

    --accent: #b0561f;
    --accent-dark: #8e4517;
    --accent-soft: #f6ece2;

    --success: #5d7d5a;
    --success-soft: #edf2ea;
    --danger: #c0492f;
    --danger-soft: #f9e9e3;
    --warning: #a97c31;
    --warning-soft: #f7efdc;
    --info: #4a7a8f;
    --info-soft: #e9f0f3;

    --radius: 12px;
    --shadow: 0 1px 2px rgba(43, 38, 32, .05), 0 1px 6px rgba(43, 38, 32, .04);
    --shadow-lg: 0 16px 44px rgba(43, 38, 32, .16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 244px;
    background: var(--card);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 120;
    padding-bottom: 8px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--line-soft);
}

.logo-box {
    width: 40px; height: 40px;
    border-radius: 11px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-serif);
    font-size: 20px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
}
.logo-text small {
    display: block;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-faint);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: var(--accent-soft); }

.menu-label {
    padding: 16px 10px 6px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--ink-faint);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    margin-bottom: 2px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-soft);
    transition: background .15s, color .15s;
}
.sidebar-nav a .icon { display: flex; align-items: center; color: var(--ink-faint); transition: color .15s; }
.sidebar-nav a:hover { background: var(--line-soft); color: var(--ink); }
.sidebar-nav a:hover .icon { color: var(--accent); }
.sidebar-nav a.active {
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 600;
}
.sidebar-nav a.active .icon { color: var(--accent); }

.sidebar-footer {
    padding: 14px 20px 10px;
    border-top: 1px solid var(--line-soft);
    font-size: 11px;
    color: var(--ink-faint);
}

/* ---------- Main ---------- */
.main {
    flex: 1;
    margin-left: 244px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content {
    flex: 1;
    padding: 26px 30px 40px;
    max-width: 1220px;
    width: 100%;
    margin: 0 auto;
}
.main-content { padding: 26px 30px 40px; max-width: 1220px; margin: 0 auto; }

/* ---------- Topbar ---------- */
.topbar {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 14px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 99;
}
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-actions .btn { margin: 0; }

.toggle-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.toggle-btn span { display: block; width: 17px; height: 2px; background: var(--ink); border-radius: 2px; }
.toggle-btn span + span { margin-top: 4px; }
.toggle-btn:hover { background: var(--line-soft); }

.icon-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 8px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.icon-btn .dot {
    position: absolute;
    top: 3px; right: 3px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #fff;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.user-chip:hover { border-color: var(--accent); }
.user-chip .avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}
.user-chip .name { font-size: 12.5px; font-weight: 600; line-height: 1.15; }
.user-chip .role { font-size: 11px; color: var(--ink-faint); line-height: 1.15; }
.user-chip .caret { color: var(--ink-faint); font-size: 10px; margin-left: 2px; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 6px;
    z-index: 200;
    display: none;
}
.dropdown.open .dropdown-menu { display: block; }

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
}
.dropdown-menu a svg { color: var(--ink-soft); }
.dropdown-menu a:hover { background: var(--line-soft); color: var(--ink); }
.dropdown-menu a.danger { color: var(--danger); }
.dropdown-menu a.danger svg { color: var(--danger); }
.dropdown-menu hr { border: none; border-top: 1px solid var(--line-soft); margin: 6px 4px; }
.dropdown-menu .menu-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ink-faint);
    padding: 8px 12px 6px;
}

.notif-menu { width: 330px; max-width: 90vw; }
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-list a {
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
}
.notif-list a .notif-bullet {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}
.notif-list a strong { display: block; font-size: 12.5px; font-weight: 600; }
.notif-list a small { font-size: 11.5px; color: var(--ink-faint); }
.notif-menu > a { margin-top: 4px; font-weight: 600; }

/* ---------- Cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 22px;
}
.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.card-header h2, .card-header h3 { font-size: 15px; font-weight: 700; }
.card-header .actions { display: flex; gap: 8px; }
.card-body { padding: 22px; }
.card-body > :last-child { margin-bottom: 0; }
.card-body.flush { padding: 0; }
.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--line-soft);
    background: var(--line-soft);
    font-size: 13px;
}

/* ---------- Stats ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow .2s, transform .2s, border-color .2s;
}
.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--accent);
}
a.stat-card-link {
    text-decoration: none;
    color: inherit;
}
a.stat-card-link .stat-label {
    text-decoration: none;
}
a.stat-card-link:hover .stat-label {
    color: var(--accent);
}
.stat-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon.is-negative { background: var(--danger-soft); color: var(--danger); }
.stat-value { font-size: 23px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-soft);
    margin-top: 2px;
}
.stat-sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table, .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.table th, .data-table th {
    text-align: left;
    padding: 11px 14px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ink-faint);
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    background: var(--line-soft);
    white-space: nowrap;
}
.table td, .data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}
.table tbody tr:hover, .data-table tbody tr:hover { background: var(--line-soft); }
.table .actions, .data-table .actions { white-space: nowrap; width: 1%; }

.actions { display: flex; gap: 6px; align-items: center; }
.actions a, .actions button { flex-shrink: 0; }
.actions-cell { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.actions-cell form { display: inline-flex; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--accent-soft); color: var(--accent-dark); }
.badge-secondary, .badge-neutral { background: var(--line-soft); color: var(--ink-soft); }
.badge-dark { background: var(--ink); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
}
.btn svg { flex-shrink: 0; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #4a6848; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a13a26; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-danger-outline { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--line-soft); color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: 8px; align-items: center; }

/* ---------- Forms ---------- */
.form-card { max-width: 720px; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group label .req { color: var(--danger); }

.form-control, select.form-control, textarea.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, select.form-control:focus, textarea.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.form-control { min-height: 90px; resize: vertical; }
select.form-control { appearance: auto; }
.form-control.is-invalid { border-color: var(--danger); }
.invalid-feedback { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.form-hint, .form-text { color: var(--ink-faint); font-size: 12.5px; margin-top: 4px; }

.form-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 8px; }
.form-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.form-check label { margin: 0; font-weight: 500; }
.form-check-inline { display: inline-flex; margin-right: 16px; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.form-fieldset {
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 18px;
    margin-bottom: 20px;
}
.form-fieldset legend {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ink-soft);
    padding: 0 8px;
}
.fieldset-group { display: flex; flex-direction: column; gap: 18px; }

.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form .form-control { width: auto; min-width: 180px; }
.form-checks { display: flex; gap: 18px; flex-wrap: wrap; margin: 14px 0 2px; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--line);
    border-radius: 24px;
    transition: background .2s;
}
.switch .slider:before {
    content: '';
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(43, 38, 32, .25);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(18px); }

/* ---------- Alerts / Flash ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13.5px;
    border: 1px solid transparent;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.alert-success { background: var(--success-soft); border-color: #d9e3d5; color: #3f5c3d; }
.alert-danger { background: var(--danger-soft); border-color: #f0cdc2; color: #8f301c; }
.alert-warning { background: var(--warning-soft); border-color: #eadbb4; color: #7a5a1f; }
.alert-info { background: var(--info-soft); border-color: #d3e2e8; color: #3c6577; }

/* ---------- Toasts ---------- */
#toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--ink);
    color: #fff;
    padding: 13px 18px;
    border-radius: 11px;
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    max-width: 340px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: slideIn .25s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast .close { cursor: pointer; opacity: .7; margin-left: auto; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Modals ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(43, 38, 32, .45);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
    animation: zoomIn .2s ease;
}
.modal.lg { max-width: 780px; }
.modal.sm { max-width: 400px; }
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 15px; }
.modal-header .close-btn, .modal-header .modal-close {
    background: none; border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--ink-faint);
    line-height: 1;
}
.modal-header .close-btn:hover, .modal-header .modal-close:hover { color: var(--ink); }
.modal-body { padding: 20px; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--line-soft);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
@keyframes zoomIn { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Pagination ---------- */
.pagination-wrap { display: flex; justify-content: flex-end; padding: 16px 20px 0; }
.pagination { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px; height: 34px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 13px;
    color: var(--ink);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent-dark); }
.pagination li.active a { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pagination li.disabled span { opacity: .5; }

/* ---------- Filters bar ---------- */
.filters-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
}
.filters-bar .form-control { width: auto; }
.filters-bar .spacer { flex: 1; }

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
    overflow-x: auto;
}
.tabs a {
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-soft);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.tabs a:hover { color: var(--accent); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a .badge { margin-left: 6px; }

/* Filter tabs por status */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px 16px 0;
    border-bottom: 1px solid var(--line);
}
.filter-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid transparent;
}
.filter-tabs a:hover { color: var(--accent); }
.filter-tabs a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--accent-soft);
}
.filter-tabs .count {
    background: var(--line-soft);
    border-radius: 999px;
    font-size: 11px;
    padding: 1px 7px;
    font-weight: 700;
    color: var(--ink-soft);
}
.filter-tabs a.active .count { background: var(--accent); color: #fff; }

/* ---------- Login ---------- */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(520px 380px at 85% 12%, rgba(176, 86, 31, .10), transparent 65%),
        radial-gradient(520px 420px at 8% 88%, rgba(93, 125, 90, .10), transparent 60%),
        var(--bg);
    padding: 20px;
}
.auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    padding: 40px 36px;
}
.auth-card .auth-logo {
    width: 56px; height: 56px;
    border-radius: 15px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 20px rgba(176, 86, 31, .28);
}
.auth-card .auth-logo svg {
    width: 32px; height: 32px;
    stroke: #fff;
    fill: none;
}
.auth-card h1 {
    font-family: var(--font-serif);
    font-size: 21px;
    text-align: center;
}
.auth-card p.sub { text-align: center; color: var(--ink-soft); font-size: 13px; margin: 6px 0 24px; }

/* ---------- Calendar ---------- */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line-soft);
}
.calendar-nav h3 { flex: 1; font-size: 16px; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 12px;
}
.calendar-grid .cal-head {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 4px;
}
.cal-day {
    min-height: 74px;
    border-radius: 10px;
    padding: 6px;
    font-size: 12.5px;
    cursor: pointer;
    border: 1px solid var(--line);
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: transform .1s, border-color .1s;
}
.cal-day:hover { transform: translateY(-1px); border-color: var(--accent); }
.cal-day .day-num { font-weight: 700; color: var(--ink); }
.cal-day .day-events { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-day .mini-event {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 4px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.cal-day.other-month { opacity: .35; }

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line-soft);
}
.calendar-legend .dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; color: var(--ink-soft); }
.legend .item { display: flex; align-items: center; gap: 6px; }
.legend .swatch { width: 14px; height: 14px; border-radius: 4px; }

/* ---------- Date picker (reservas) ---------- */
.datepicker-popup {
    display: none;
    position: fixed;
    z-index: 2200;
    width: 288px;
    max-width: calc(100vw - 16px);
    max-height: min(440px, calc(100vh - 16px));
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 12px;
}
.datepicker-popup.open { display: block; }
.datepicker-popup .dp-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.datepicker-popup .dp-nav strong { font-size: 13.5px; color: var(--ink); }
.dp-nav-btn {
    background: var(--line-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    width: 28px; height: 28px;
    cursor: pointer;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1;
    display: grid;
    place-items: center;
}
.dp-nav-btn:hover { background: var(--accent-soft); color: var(--accent); }
.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.dp-grid .dp-head {
    text-align: center;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 3px 0;
}
.dp-day, .dp-empty {
    height: 31px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 600;
}
.dp-day.available {
    background: var(--accent-soft);
    color: var(--accent-dark);
    border: 1px solid transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.dp-day.available:hover { background: var(--accent); color: #fff; }
.dp-day.unavailable {
    background: #f4f0e9;
    color: var(--ink-faint);
    border: 1px solid transparent;
    cursor: not-allowed;
    position: relative;
    text-decoration: line-through;
}
.dp-day.unavailable::after {
    content: '\2715';
    position: absolute;
    top: 0; right: 3px;
    font-size: 9px;
    font-weight: 700;
    color: var(--danger);
    line-height: 1;
}
.dp-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 9px;
    font-size: 11px;
    color: var(--ink-faint);
    padding-top: 8px;
    border-top: 1px solid var(--line-soft);
}
.dp-note .dp-x { color: var(--danger); font-weight: 700; }
.dp-message { padding: 14px 6px; text-align: center; color: var(--ink-faint); font-size: 12.5px; }

/* ---------- Gallery ---------- */
.gallery-grid, .gallery-sortable {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
.gallery-item {
    position: relative;
    border-radius: 11px;
    overflow: hidden;
    background: var(--line-soft);
    border: 1px solid var(--line);
    aspect-ratio: 4/3;
    cursor: grab;
}
.gallery-item:active { cursor: grabbing; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item.inactive img { opacity: .45; }
.gallery-item .gallery-overlay, .gallery-item .gallery-caption {
    position: absolute;
    inset: auto 0 0 0;
    background: linear-gradient(transparent, rgba(43, 38, 32, .78));
    padding: 22px 10px 8px;
    color: #fff;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 6px;
}
.gallery-item .gallery-overlay .actions { display: flex; gap: 4px; }
.gallery-item .gallery-overlay .actions button {
    background: rgba(255, 255, 255, .9);
    border: none;
    border-radius: 6px;
    width: 26px; height: 26px;
    cursor: pointer;
    font-size: 12px;
    color: var(--ink);
}
.gallery-item .gallery-actions {
    position: absolute;
    top: 8px; right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity .15s;
}
.gallery-item:hover .gallery-actions { opacity: 1; }
.gallery-item .gallery-actions .btn, .gallery-item .gallery-actions form button {
    padding: 3px 8px;
    font-size: 11px;
    box-shadow: 0 1px 3px rgba(43, 38, 32, .25);
}
.gallery-caption small { display: block; opacity: .85; }
.gallery-tag {
    position: absolute;
    top: 8px; left: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
}
.gallery-tag.tag-main { background: var(--accent); color: #fff; }
.gallery-tag.tag-inactive { background: rgba(43, 38, 32, .7); color: #fff; }
.gallery-item .main-flag { position: absolute; top: 8px; left: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.gallery-item .inactive-flag { position: absolute; top: 8px; right: 8px; background: rgba(43, 38, 32, .72); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }

/* ---------- Upload ---------- */
.dropzone {
    border: 2px dashed var(--line);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    color: var(--ink-soft);
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s;
    background: var(--line-soft);
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.dropzone .dz-icon {
    width: 44px; height: 44px;
    margin: 0 auto 10px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink-faint);
    display: flex;
    align-items: center;
    justify-content: center;
}
.dropzone:hover .dz-icon, .dropzone.drag .dz-icon { color: var(--accent); }
#upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 14px;
}
#upload-preview .preview-item { position: relative; border-radius: 9px; overflow: hidden; aspect-ratio: 1; }
#upload-preview img { width: 100%; height: 100%; object-fit: cover; }

.upload-row { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: start; }
@media (max-width: 720px) { .upload-row { grid-template-columns: 1fr; } }
.upload-fields { display: flex; flex-direction: column; gap: 8px; }
.upload-fields label { font-size: 12.5px; font-weight: 600; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; position: relative; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 20px 28px; }
.timeline li::before {
    content: '';
    position: absolute;
    left: 6px; top: 4px; bottom: -4px;
    width: 2px;
    background: var(--line);
}
.timeline li:last-child::before { display: none; }
.timeline li::after {
    content: '';
    position: absolute;
    left: 0; top: 4px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--accent-soft);
}
.timeline li .tl-date { font-size: 11.5px; color: var(--ink-faint); }
.timeline li .tl-note { font-size: 13.5px; margin-top: 2px; }

/* ---------- Misc ---------- */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-head h2 { font-size: 19px; letter-spacing: -.01em; }
.page-head .actions { display: flex; gap: 10px; }

.empty-state {
    text-align: center;
    padding: 46px 20px;
    color: var(--ink-soft);
}
.empty-state .icon {
    width: 48px; height: 48px;
    margin: 0 auto 12px;
    border-radius: 14px;
    background: var(--line-soft);
    color: var(--ink-faint);
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    margin: 4px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line-soft);
}
.separator { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

.detail-list { list-style: none; margin: 0; padding: 0; }
.detail-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
}
.detail-list li:last-child { border-bottom: none; }
.detail-list .label { color: var(--ink-soft); }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px 20px;
}
.detail-grid label {
    display: block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-faint);
    margin-bottom: 2px;
}
.detail-grid span { font-size: 14px; color: var(--ink); }
.detail-grid a { font-weight: 600; }

.calc-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--line-soft);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 14px 18px;
    margin: 18px 0;
}
.calc-summary div { display: flex; flex-direction: column; gap: 2px; }
.calc-summary span { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.calc-summary strong { font-size: 18px; }
.calc-summary .total-strong { color: var(--accent); font-size: 22px; }

.finance-section {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
    margin-top: 22px;
    background: var(--card);
}
.finance-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-faint);
    margin: 0 0 14px;
}

.detail-card {
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 14px;
    margin-bottom: 12px;
    background: var(--card);
}
.detail-card:last-child { margin-bottom: 0; }
.detail-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.detail-card-head strong { font-size: 14px; }

.cal-pay-plan {
    margin-top: 12px;
    border-top: 1px dashed var(--line);
    padding-top: 10px;
}
.cal-pay-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-faint);
    margin-bottom: 8px;
}
.cal-pay-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 7px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13px;
}
.cal-pay-row:last-child { border-bottom: 0; }
.cal-pay-form {
    display: flex;
    gap: 6px;
    align-items: center;
}
.cal-pay-form select { width: 118px; }


.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }

/* Progress bar */
.progress {
    background: var(--line-soft);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}
.progress > span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width .5s ease;
}

/* ---------- Perfis e permissões ---------- */
.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.perm-module {
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 14px;
    background: var(--line-soft);
}
.perm-module h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-soft);
    margin-bottom: 10px;
}
.perm-module .form-check { padding: 4px 0; }

/* ---------- Acomodações ---------- */
.accommodation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.accommodation-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}
.accommodation-card.inactive { opacity: .55; }
.accommodation-card .acc-icon {
    width: 44px; height: 44px;
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.accommodation-card .acc-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.accommodation-card .acc-info strong { font-size: 14px; }
.accommodation-card .acc-info p { width: 100%; font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.accommodation-card .acc-thumb { width: 54px; height: 44px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.accommodation-card .acc-actions { display: flex; gap: 4px; align-items: center; }
.accommodation-card .acc-actions form { display: inline-flex; }

/* ---------- Notificações ---------- */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
}
.notif-item.unread { background: var(--accent-soft); }
.notif-item .notif-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--line);
    margin-top: 6px;
    flex-shrink: 0;
}
.notif-item.unread .notif-dot { background: var(--accent); }
.notif-item .notif-content { flex: 1; min-width: 0; }
.notif-item .notif-content p { font-size: 13px; color: var(--ink-soft); margin: 2px 0 0; }
.notif-item .notif-content small { font-size: 11.5px; color: var(--ink-faint); }
.notif-item .notif-mark { flex-shrink: 0; }

/* ---------- Backup ---------- */
.backup-form { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- Utilidades ---------- */
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.text-muted { color: var(--ink-soft); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.ml-auto { margin-left: auto; }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.grid-2r { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .grid-2, .grid-2r { grid-template-columns: 1fr; } }

/* ---------- Responsive ---------- */
.bottom-nav {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 130;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 24px rgba(43, 38, 32, .08);
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 4px 8px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ink-faint);
    text-decoration: none;
    position: relative;
    transition: color .15s;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav a .icon { width: 22px; height: 22px; }
.bottom-nav a:active { color: var(--accent); }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 42px; height: 3px;
    border-radius: 0 0 5px 5px;
    background: var(--accent);
}

@media (max-width: 900px) {
    .bottom-nav { display: flex; }
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
    .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
    .main { margin-left: 0; }
    .toggle-btn { display: flex; }
    .topbar { padding: 12px 18px; }
    .content { padding: 18px 18px 86px; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
    .user-chip .name, .user-chip .role { display: none; }
}
@media (max-width: 600px) {
    .filters-bar .form-control { width: 100%; }
    .topbar h1 { font-size: 15px; }
    .page-head { flex-direction: column; align-items: stretch; }
    .page-head .actions { flex-wrap: wrap; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

/* ---------- Calendar responsive ---------- */
@media (max-width: 900px) {
    .calendar-grid { gap: 4px; padding: 8px; }
    .cal-day { min-height: 58px; padding: 4px; font-size: 11.5px; }
}
@media (max-width: 600px) {
    .calendar-nav { padding: 10px 12px; gap: 8px; }
    .calendar-nav .btn { padding: 6px 8px; font-size: 11.5px; }
    .calendar-nav strong { font-size: 15px; }
    .calendar-legend { gap: 8px 14px; padding: 10px 12px; font-size: 11px; }
    .calendar-grid { gap: 3px; padding: 6px; }
    .cal-day {
        min-height: 48px;
        padding: 3px;
        font-size: 11px;
        border-radius: 8px;
    }
    .cal-day .day-num { font-size: 11px; line-height: 1.2; }
    .cal-day .day-events { gap: 2px; }
    .cal-day .mini-event {
        width: 100%;
        height: 5px;
        padding: 0;
        font-size: 0;
        line-height: 0;
        text-indent: -9999px;
        white-space: nowrap;
        overflow: hidden;
        border-radius: 3px;
    }
    .cal-pay-form { width: 100%; justify-content: flex-end; }
    .cal-pay-form select { flex: 1; max-width: 140px; }
    .modal-backdrop { padding: 10px; align-items: flex-end; }
    .modal {
        max-height: 88vh;
        border-radius: 14px 14px 0 0;
    }
}
@media (max-width: 400px) {
    .calendar-grid { gap: 2px; padding: 4px; }
    .cal-day { min-height: 44px; padding: 2px; border-radius: 6px; }
    .cal-day .mini-event { height: 4px; }
}
