:root {
    --bg: #f3eee6;
    --bg-alt: #fffaf2;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --text: #0f172a;
    --muted: #6b7280;
    --line: #e4d8c8;
    --line-strong: #d7c6af;
    --shadow: 0 24px 60px rgba(17, 24, 39, 0.10);
    --shadow-soft: 0 12px 30px rgba(17, 24, 39, 0.08);
    --blue: #1d4ed8;
    --blue-strong: #1e40af;
    --green: #16a34a;
    --red: #dc2626;
    --amber: #d97706;
    --cyan: #0e7490;
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    font-family: "Segoe UI", "Trebuchet MS", Tahoma, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background:
        radial-gradient(circle at top left, rgba(217, 119, 6, 0.10), transparent 24%),
        radial-gradient(circle at top right, rgba(30, 64, 175, 0.10), transparent 22%),
        linear-gradient(180deg, #fffdf8 0%, var(--bg) 100%);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 16% 16%, rgba(217, 119, 6, 0.07), transparent 0 18%),
        radial-gradient(circle at 86% 18%, rgba(30, 64, 175, 0.06), transparent 0 16%),
        radial-gradient(circle at 48% 96%, rgba(217, 119, 6, 0.05), transparent 0 22%);
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
}

header {
    padding: 26px 16px 20px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(16, 24, 40, 0.98), rgba(46, 32, 22, 0.98)),
        linear-gradient(135deg, var(--blue), var(--amber));
    box-shadow: 0 16px 34px rgba(17, 24, 39, 0.22);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

header h1,
header h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.1;
    letter-spacing: 0;
}

header .small,
header .header-subtitle {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.78);
}

.container {
    width: min(1260px, calc(100% - 32px));
    margin: 22px auto 44px;
}

.page-head,
.page-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-head {
    padding: 18px 20px;
    margin-bottom: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(251,244,232,0.82));
    border: 1px solid rgba(228, 216, 200, 0.92);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.page-head::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--amber));
}

.page-head h2,
.page-head h1 {
    margin: 0;
    font-size: clamp(26px, 2.2vw, 32px);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.page-head p,
.page-toolbar p {
    margin: 6px 0 0;
    color: var(--muted);
    max-width: 65ch;
    overflow-wrap: anywhere;
}

.page-head > div,
.page-toolbar > div,
.topbar-brand,
.topbar-text,
.restaurant-hero__content,
.restaurant-panel > *,
.schedule-top > div,
.cargo-top > div {
    min-width: 0;
}

.card {
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(251,248,242,0.94));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(232, 222, 208, 0.92);
    padding: 24px;
    border-radius: 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--blue), var(--cyan), var(--amber));
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.11);
}

.card h2,
.card h3 {
    margin-top: 0;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 20px;
    padding: 14px;
    background: rgba(255, 251, 245, 0.90);
    border: 1px solid rgba(226, 214, 200, 0.96);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 12px;
    z-index: 12;
}

.menu .btn,
.menu a {
    min-width: 0;
}

.menu a {
    text-decoration: none;
    width: auto;
    white-space: nowrap;
    flex: 0 0 auto;
    background: linear-gradient(180deg, #1c2437, #111827);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow-soft);
    border: 1px solid rgba(255,255,255,0.08);
}

.menu a.is-active {
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.menu a.red {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.btn,
button,
.menu a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 15px;
    border: 1px solid transparent;
    border-radius: 16px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease, filter 140ms ease;
}

.menu .btn,
.menu .red,
.menu .blue {
    box-shadow: var(--shadow-soft);
}

.btn:hover,
button:hover,
.menu a:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
    filter: saturate(1.02);
}

.btn:focus-visible,
button:focus-visible,
.menu a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.btn,
button {
    background: #111827;
    color: #fff;
}

.btn:hover,
button:hover {
    background: #1f2937;
}

.btn.blue,
button.blue {
    background: var(--blue);
}

.btn.blue:hover,
button.blue:hover {
    background: var(--blue-strong);
}

.btn.green,
button.green,
.green {
    background: var(--green);
}

.btn.green:hover,
button.green:hover,
.green:hover {
    background: #15803d;
}

.btn.red,
button.red,
.red {
    background: var(--red);
}

.btn.red:hover,
button.red:hover,
.red:hover {
    background: #b91c1c;
}

.yellow {
    background: var(--amber);
}

.yellow:hover {
    background: #b45309;
}

.btn-small {
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 12px;
    font-size: 12px;
}

.stats,
.grid {
    display: grid;
    gap: 14px;
}

.contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 14px;
}

.contact-field {
    display: flex;
    flex-direction: column;
}

.contact-grid > div:last-child {
    grid-column: 1 / -1;
}

.stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.stat {
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(251,247,241,0.96));
    border: 1px solid rgba(228, 216, 200, 0.96);
    border-radius: 18px;
    padding: 17px 18px;
    box-shadow: var(--shadow-soft);
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.stat:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
}

.stat strong {
    display: block;
    margin-top: 10px;
    font-size: clamp(24px, 2.1vw, 32px);
    line-height: 1;
    letter-spacing: -0.03em;
}

.stat .small {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

form.grid {
    align-items: end;
}

label {
    display: block;
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

input,
select,
textarea {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    padding: 13px 15px;
    font: inherit;
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #b9c7d9;
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(37, 99, 235, 0.65);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--blue);
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(228, 216, 200, 0.96);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-soft);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #f7efe4, #f4eadc);
    color: #334155;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

tbody tr:nth-child(even) td {
    background: rgba(248, 250, 252, 0.8);
}

tr:last-child td {
    border-bottom: 0;
}

tr:hover td {
    background: rgba(217, 119, 6, 0.05);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
}

.badge.aprovado,
.badge.aprovado {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
    border-color: rgba(22, 163, 74, 0.18);
}

.badge.pendente {
    background: rgba(217, 119, 6, 0.12);
    color: #92400e;
    border-color: rgba(217, 119, 6, 0.18);
}

.badge.recusado,
.badge.inativo {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
    border-color: rgba(220, 38, 38, 0.18);
}

.badge.compareceu {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
    border-color: rgba(22, 163, 74, 0.18);
}

.badge.faltou {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
    border-color: rgba(220, 38, 38, 0.18);
}

.pix-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 220px;
}

.pix-value {
    min-width: 0;
    word-break: break-word;
    color: var(--text);
    font-weight: 600;
}

.copy-mini {
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
}

.alert,
.success,
.error {
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-soft);
}

.alert {
    background: rgba(219, 234, 254, 0.9);
    color: #1d4ed8;
    border-color: rgba(96, 165, 250, 0.24);
}

.success {
    background: rgba(220, 252, 231, 0.92);
    color: #166534;
    border-color: rgba(74, 222, 128, 0.24);
}

.error {
    background: rgba(254, 226, 226, 0.92);
    color: #991b1b;
    border-color: rgba(248, 113, 113, 0.24);
}

.day {
    border: 1px solid var(--line);
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-soft);
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.schedule-card {
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 16px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.schedule-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.09);
}

.schedule-choice {
    cursor: pointer;
    user-select: none;
}

.schedule-choice .choice-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.schedule-choice .choice-mark {
    display: flex;
    align-items: center;
    gap: 12px;
}

.schedule-choice .choice-dot {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid #cbd5e1;
    background: #fff;
    flex: 0 0 auto;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.schedule-choice .choice-title {
    font-weight: 700;
    color: #0f172a;
}

.schedule-choice .choice-hint {
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
}

.schedule-choice:hover .choice-dot {
    border-color: var(--blue);
    transform: scale(1.03);
}

.schedule-choice.is-selected {
    border-color: rgba(37, 99, 235, 0.38);
    background: linear-gradient(180deg, rgba(240, 247, 255, 0.98), rgba(248, 251, 255, 0.94));
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.10);
}

.schedule-choice.is-selected .choice-dot {
    border-color: var(--blue);
    background: radial-gradient(circle at center, var(--blue) 0 45%, #fff 46% 100%);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.schedule-card.is-blocked {
    opacity: 0.92;
}

.schedule-card.is-blocked .schedule-top .badge {
    box-shadow: none;
}

.schedule-card.approved {
    background: linear-gradient(180deg, rgba(220, 252, 231, 0.92), rgba(240, 253, 244, 0.86));
    border-color: rgba(22, 163, 74, 0.16);
}

.schedule-card.pending {
    background: linear-gradient(180deg, rgba(254, 243, 199, 0.95), rgba(255, 251, 235, 0.88));
    border-color: rgba(217, 119, 6, 0.18);
}

.schedule-card.recused,
.schedule-card.locked {
    background: linear-gradient(180deg, rgba(254, 226, 226, 0.95), rgba(255, 241, 242, 0.88));
    border-color: rgba(220, 38, 38, 0.16);
}

.schedule-card.available {
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.84));
}

.schedule-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.schedule-top strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
}

.schedule-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.permissions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.perm-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,0.9);
    cursor: pointer;
    min-height: 44px;
}

.perm-chip input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.cargo-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    background: rgba(250,252,255,0.92);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    margin-bottom: 16px;
}

.cargo-card:last-child {
    margin-bottom: 0;
}

.cargo-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.readonly-pill {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,0.95);
    color: var(--text);
    font-weight: 600;
}

.cargo-edit .grid > div:nth-child(2) select {
    display: none;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.legend .badge {
    background: #fff;
}

.day strong {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 15px;
}

.resumo-dia {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.76);
    margin-bottom: 12px;
}

.resumo-dia h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.small {
    font-size: 12px;
    color: var(--muted);
}

textarea {
    min-height: 220px;
    resize: vertical;
    line-height: 1.5;
}

/* Login */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(217, 119, 6, 0.16), transparent 25%),
        radial-gradient(circle at bottom right, rgba(30, 64, 175, 0.10), transparent 28%),
        linear-gradient(180deg, #fffdf7 0%, #efe6d8 100%);
}

.login-box {
    width: min(460px, 100%);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(232, 222, 208, 0.92);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 30px;
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--blue), var(--cyan), var(--amber));
}

.login-title {
    margin: 0 0 6px;
    font-size: clamp(28px, 2.4vw, 34px);
    letter-spacing: -0.03em;
}

.login-subtitle {
    margin: 0 0 22px;
    color: var(--muted);
}

.login-box .small {
    letter-spacing: 0.01em;
}

.login-box form {
    display: grid;
    gap: 12px;
    margin-top: 6px;
}

.login-box button {
    width: 100%;
}

.login-link {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    margin-top: 14px;
    color: var(--blue);
    font-weight: 700;
}

.login-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 900px) {
    .stats,
    .grid,
    .schedule-grid {
        grid-template-columns: 1fr;
    }

    .stats[style] {
        grid-template-columns: 1fr !important;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .page-head,
    .page-toolbar {
        flex-direction: column;
    }

    .card {
        padding: 18px;
    }
}

@media (max-width: 768px) {
    .container {
        width: min(100% - 20px, 1180px);
        margin-top: 16px;
    }

    header {
        padding: 20px 14px 16px;
    }

    header h1,
    header h2 {
        font-size: 22px;
    }

    .card {
        padding: 16px;
    }

    .page-head,
    .page-toolbar {
        gap: 12px;
    }

    .menu {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 10px;
        gap: 8px;
    }

    .menu a,
    .menu .btn {
        width: auto;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .btn,
    button {
        width: auto;
    }

    .login-box {
        padding: 22px;
        border-radius: 20px;
    }

    th,
    td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .menu {
        position: static;
        top: auto;
    }

    .page-head h1,
    .page-head h2 {
        font-size: 24px;
    }

    table {
        min-width: 100%;
    }

    table form,
    table .btn,
    table button,
    table input,
    table select {
        max-width: 100%;
    }

    table select[style],
    table input[style] {
        min-width: 0 !important;
        width: 100% !important;
    }
}

body.restaurant-page {
    background:
        radial-gradient(circle at 12% 10%, rgba(107, 92, 255, 0.14), transparent 24%),
        radial-gradient(circle at 88% 12%, rgba(34, 193, 220, 0.10), transparent 18%),
        linear-gradient(180deg, #fbfcff 0%, #eef2fb 52%, #e8edf9 100%);
}

body.restaurant-page::before {
    background:
        radial-gradient(circle at 18% 16%, rgba(107, 92, 255, 0.08), transparent 0 18%),
        radial-gradient(circle at 84% 18%, rgba(34, 193, 220, 0.06), transparent 0 16%),
        radial-gradient(circle at 54% 96%, rgba(107, 92, 255, 0.05), transparent 0 22%);
}

body.restaurant-page header {
    background:
        linear-gradient(135deg, rgba(29, 24, 85, 0.98), rgba(57, 43, 170, 0.98)),
        linear-gradient(135deg, #6b5cff, #22c1dc);
    box-shadow: 0 16px 34px rgba(33, 39, 71, 0.22);
}

body.restaurant-page .menu {
    border-color: rgba(217, 224, 242, 0.96);
    background: rgba(255, 255, 255, 0.88);
}

body.restaurant-page .menu a {
    background: linear-gradient(180deg, #1d2440, #111827);
}

body.restaurant-page .menu a.is-active {
    background: linear-gradient(180deg, #6b5cff, #5544ef);
    box-shadow: 0 10px 20px rgba(107, 92, 255, 0.24);
}

.topbar-shell {
    width: min(1320px, calc(100% - 32px));
    margin: 18px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(82, 64, 208, 0.88), rgba(52, 37, 158, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 38px rgba(33, 39, 71, 0.20);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.topbar-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.16);
    padding: 7px;
    flex: 0 0 auto;
}

.topbar-text {
    min-width: 0;
}

.topbar-title {
    font-size: 21px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.topbar-subtitle {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 14px;
}

.topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 10px 18px rgba(33, 39, 71, 0.14);
}

.topbar-logout:hover {
    background: rgba(255,255,255,0.20);
}

.hero-shell {
    width: min(1320px, calc(100% - 32px));
    margin: 18px auto 0;
}

.restaurant-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 18px;
    padding: 28px;
    border-radius: 28px;
    overflow: hidden;
    position: relative;
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.16), transparent 20%),
        radial-gradient(circle at 78% 10%, rgba(255, 255, 255, 0.10), transparent 18%),
        linear-gradient(135deg, rgba(107, 92, 255, 0.98), rgba(61, 36, 180, 0.98));
    color: #fff;
    box-shadow: 0 24px 60px rgba(79, 70, 229, 0.22);
}

.restaurant-hero::after {
    content: '';
    position: absolute;
    inset: auto -60px -70px auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.20) 0, rgba(255, 255, 255, 0.06) 48%, transparent 70%);
    filter: blur(2px);
    pointer-events: none;
}

.restaurant-hero__content,
.restaurant-hero__stats {
    position: relative;
    z-index: 1;
}

.restaurant-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.20);
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.restaurant-hero h1 {
    margin: 14px 0 10px;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.restaurant-hero p {
    margin: 0;
    max-width: 60ch;
    color: rgba(255, 255, 255, 0.84);
    font-size: 16px;
}

.restaurant-hero__stats {
    display: grid;
    gap: 12px;
    align-content: stretch;
}

.restaurant-stat {
    padding: 18px 18px 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
}

.restaurant-stat span {
    display: block;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.restaurant-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 34px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.restaurant-stat small {
    display: block;
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.80);
}

.restaurant-stat.accent {
    background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.10));
    border-color: rgba(255,255,255,0.20);
}

.restaurant-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.restaurant-chip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(217, 224, 242, 0.94);
    box-shadow: 0 10px 24px rgba(33, 39, 71, 0.06);
}

.restaurant-chip span {
    color: #6b5cff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.restaurant-chip strong {
    font-size: 20px;
    line-height: 1.1;
    color: #141a33;
}

.restaurant-chip small {
    color: var(--muted);
}

.restaurant-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
    gap: 16px;
    margin-bottom: 18px;
}

.restaurant-intro {
    padding: 22px;
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(107, 92, 255, 0.10), transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 255, 0.92));
    border: 1px solid rgba(217, 224, 242, 0.96);
    box-shadow: 0 14px 34px rgba(33, 39, 71, 0.08);
}

.restaurant-intro h2 {
    margin-bottom: 10px;
}

.restaurant-intro p {
    margin: 0;
    color: var(--muted);
}

.restaurant-note {
    display: grid;
    gap: 10px;
    padding: 22px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(29, 24, 85, 0.98), rgba(57, 43, 170, 0.96));
    color: #fff;
    box-shadow: 0 16px 34px rgba(79, 70, 229, 0.18);
}

.restaurant-note h3 {
    margin: 0;
    font-size: 18px;
}

.restaurant-note p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

.restaurant-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.restaurant-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 12px;
    font-weight: 700;
}

.restaurant-table-card {
    padding: 0;
    overflow: hidden;
}

.restaurant-table-card .page-toolbar {
    padding: 22px 22px 0;
    margin-bottom: 14px;
}

.restaurant-table-card .table-wrap {
    border: 0;
    border-radius: 0 0 22px 22px;
    box-shadow: none;
}

.restaurant-table-card table {
    background: rgba(255, 255, 255, 0.78);
}

.restaurant-table-card th {
    background: linear-gradient(180deg, #eff3ff, #e9eefc);
}

.restaurant-table-card tr:hover td {
    background: rgba(107, 92, 255, 0.05);
}

@media (max-width: 920px) {
    .restaurant-hero,
    .restaurant-panel {
        grid-template-columns: 1fr;
    }

    .restaurant-highlights {
        grid-template-columns: 1fr;
    }

    .topbar-shell {
        width: min(100% - 20px, 1320px);
        padding: 12px 16px;
    }

    .hero-shell {
        width: min(100% - 20px, 1320px);
    }
}

@media (max-width: 640px) {
    .topbar-shell {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-logout {
        align-self: stretch;
    }
}

@media (max-width: 640px) {
    .restaurant-hero {
        padding: 22px;
        border-radius: 22px;
    }

    .restaurant-hero h1 {
        font-size: 30px;
    }

    .restaurant-stat strong {
        font-size: 28px;
    }
}

/* Dashboard refresh */
:root {
    --bg: #eef2fb;
    --bg-alt: #f8faff;
    --text: #141a33;
    --muted: #66718d;
    --line: #d9e0f2;
    --line-strong: #c6d0ea;
    --shadow: 0 24px 60px rgba(33, 39, 71, 0.10);
    --shadow-soft: 0 12px 30px rgba(33, 39, 71, 0.08);
    --blue: #6b5cff;
    --blue-strong: #5544ef;
    --cyan: #22c1dc;
}

body {
    background:
        radial-gradient(circle at top left, rgba(107, 92, 255, 0.14), transparent 24%),
        radial-gradient(circle at top right, rgba(34, 193, 220, 0.10), transparent 22%),
        linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
}

body::before {
    background:
        radial-gradient(circle at 16% 16%, rgba(107, 92, 255, 0.08), transparent 0 18%),
        radial-gradient(circle at 86% 18%, rgba(34, 193, 220, 0.07), transparent 0 16%),
        radial-gradient(circle at 48% 96%, rgba(107, 92, 255, 0.05), transparent 0 22%);
}

header {
    background:
        linear-gradient(135deg, rgba(29, 24, 85, 0.98), rgba(57, 43, 170, 0.98)),
        linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 16px 34px rgba(33, 39, 71, 0.22);
}

.container {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    gap: 18px 20px;
    width: min(1320px, calc(100% - 32px));
}

.container > * {
    min-width: 0;
}

.container > .menu {
    grid-column: 1;
    grid-row: 1 / span 999;
    position: sticky;
    top: 12px;
    align-self: start;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.container > .menu a {
    width: 100%;
    justify-content: flex-start;
}

.container > .page-head,
.container > .card,
.container > .stats,
.container > .table-wrap,
.container > .page-toolbar,
.container > .success,
.container > .error,
.container > .alert,
.container > .restaurant-panel {
    grid-column: 2;
}

.page-head {
    min-height: 132px;
    align-items: center;
    background:
        radial-gradient(circle at 78% 18%, rgba(255,255,255,0.18), transparent 0 18%),
        radial-gradient(circle at 90% 0%, rgba(255,255,255,0.14), transparent 0 10%),
        linear-gradient(135deg, rgba(107, 92, 255, 0.98), rgba(76, 43, 196, 0.98));
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 28px;
    box-shadow: 0 18px 34px rgba(79, 70, 229, 0.18);
}

.page-head::before {
    height: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.45), rgba(255,255,255,0.08));
}

.page-head::after {
    content: '';
    position: absolute;
    right: -70px;
    top: -50px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.14) 0, rgba(255,255,255,0.05) 45%, transparent 70%);
    pointer-events: none;
}

.page-head h1,
.page-head h2 {
    color: #fff;
    font-size: clamp(28px, 2.4vw, 38px);
}

.page-head p,
.page-toolbar p {
    color: rgba(255,255,255,0.82);
}

.card {
    border: 1px solid rgba(217, 224, 242, 0.92);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,255,0.94));
}

.card::before {
    background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.menu {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(217, 224, 242, 0.96);
}

.menu a {
    background: linear-gradient(180deg, #1d2440, #111827);
}

.menu a.is-active {
    background: linear-gradient(180deg, var(--blue), var(--blue-strong));
    box-shadow: 0 12px 24px rgba(107, 92, 255, 0.24);
    transform: translateX(2px);
}

.menu a.red {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.stat {
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.12), transparent 28%),
        linear-gradient(180deg, rgba(31, 38, 86, 0.98), rgba(50, 38, 120, 0.98));
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 24px;
}

.stat .small {
    color: rgba(255,255,255,0.78);
}

.stat::after {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0, rgba(255, 255, 255, 0.04) 60%, transparent 72%);
}

.table-wrap {
    border: 1px solid rgba(217, 224, 242, 0.96);
}

th {
    background: linear-gradient(180deg, #eff3ff, #e9eefc);
    color: #34405f;
}

tr:hover td {
    background: rgba(107, 92, 255, 0.05);
}

.login-shell {
    background:
        radial-gradient(circle at top left, rgba(107, 92, 255, 0.16), transparent 25%),
        radial-gradient(circle at bottom right, rgba(34, 193, 220, 0.10), transparent 28%),
        linear-gradient(180deg, #fbfcff 0%, #eef2fb 100%);
}

.login-box {
    border: 1px solid rgba(217, 224, 242, 0.92);
}

.login-box::before {
    background: linear-gradient(90deg, var(--blue), var(--cyan));
}

@media (max-width: 920px) {
    .container {
        display: block;
        width: min(100% - 20px, 1260px);
    }

    .container > .menu {
        position: sticky;
        top: 12px;
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        grid-row: auto;
    }

    .container > .menu a {
        width: auto;
        justify-content: center;
    }

    .container > .page-head,
    .container > .card,
    .container > .stats,
    .container > .table-wrap,
    .container > .page-toolbar,
    .container > .success,
    .container > .error,
    .container > .alert,
    .container > .restaurant-panel {
        grid-column: auto;
    }

    .stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 14px, 1260px);
        margin-top: 14px;
    }

    .topbar-shell {
        padding: 12px 14px;
        border-radius: 20px;
        gap: 12px;
    }

    .topbar-brand {
        gap: 10px;
    }

    .topbar-logo {
        width: 52px;
        height: 52px;
        border-radius: 14px;
        padding: 5px;
    }

    .topbar-title {
        font-size: 18px;
    }

    .topbar-subtitle {
        font-size: 13px;
    }

    .page-head {
        padding: 14px;
        border-radius: 18px;
    }

    .card {
        padding: 14px;
        border-radius: 18px;
    }

    .page-head h1,
    .page-head h2 {
        font-size: 22px;
    }

    .page-toolbar {
        flex-direction: column;
    }

    .schedule-top,
    .cargo-top {
        flex-direction: column;
    }

    .schedule-top .badge {
        align-self: flex-start;
    }

    .pix-cell {
        min-width: 0;
        flex-direction: column;
        align-items: flex-start;
    }

    .perm-chip {
        width: 100%;
    }

    .menu {
        padding: 8px;
    }

    .menu a,
    .menu .btn {
        min-height: 40px;
        padding: 9px 12px;
    }

    .login-shell {
        padding: 16px;
    }

    .login-box {
        padding: 18px;
        border-radius: 18px;
    }

    .restaurant-hero {
        padding: 18px;
        border-radius: 18px;
    }

    .restaurant-hero h1 {
        font-size: 28px;
    }

    .restaurant-stat strong {
        font-size: 26px;
    }
}
