:root {
    --brand: #0f766e;
    --ink: #172033;
    --muted: #6b7280;
    --line: #e5e7eb;
    --soft: #f7f9fb;
}

body {
    background: var(--soft);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { text-decoration: none; }

.form-control, .form-select, .btn {
    border-radius: 8px;
}

.table {
    --bs-table-bg: transparent;
}

.table thead th {
    color: #667085;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: 0;
    border-bottom-color: #d0d5dd;
}

.table td {
    vertical-align: middle;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef7f5 100%);
}

.auth-card, .panel-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
}

.panel-card {
    transition: transform .16s ease, box-shadow .16s ease;
}

.panel-card:hover {
    box-shadow: 0 16px 36px rgba(15, 23, 42, .08);
}

.app-shell {
    min-height: 100vh;
}

.app-main {
    padding: 28px;
}

.sidebar {
    min-height: 100vh;
    background: #101522;
    color: #fff;
    position: sticky;
    top: 0;
    box-shadow: 12px 0 30px rgba(16, 21, 34, .08);
}

.sidebar h1 {
    font-weight: 800;
    letter-spacing: 0;
}

.sidebar a {
    color: rgba(255,255,255,.78);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    font-weight: 600;
}

.sidebar a.active, .sidebar a:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.metric {
    border-left: 4px solid var(--brand);
    min-height: 112px;
}

.management-page {
    display: grid;
    gap: 18px;
}

.management-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.management-heading h1 {
    margin: 2px 0 0;
    font-size: 1.85rem;
    font-weight: 800;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-title h2 {
    margin: 0;
}

.section-title span {
    color: var(--muted);
    font-size: .9rem;
}

.app-table {
    min-width: 760px;
}

.app-table tbody tr {
    border-color: #eef2f7;
}

.app-table tbody tr:hover {
    background: #f8fafc;
}

.btn-brand {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: #115e59;
    --bs-btn-hover-border-color: #115e59;
    color: #fff;
}

.btn-outline-brand {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
}

.place-items-center {
    place-items: center;
}

.public-hero {
    min-height: 280px;
    background: #0f172a center/cover no-repeat;
    color: #fff;
    display: flex;
    align-items: end;
    position: relative;
}

.public-hero-rich {
    min-height: 460px;
    align-items: end;
    background-color: #101827;
    background-position: center;
}

.public-hero-no-cover {
    min-height: 360px;
}

.public-hero-rich::before {
    background: linear-gradient(180deg, rgba(15,23,42,.2), rgba(15,23,42,.9));
}

.public-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,23,42,.25), rgba(15,23,42,.82));
}

.public-hero > .container { position: relative; }

.hero-topline {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 760px;
}

.hero-logo {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 8px;
    background: #fff;
    border: 3px solid rgba(255,255,255,.8);
}

.hero-description {
    color: rgba(255,255,255,.82);
    font-size: 1.05rem;
}

.hero-info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 24px;
}

.hero-info {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255,255,255,.9);
    font-size: .92rem;
}

.hero-info:hover {
    color: #fff;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.hero-actions .btn {
    min-height: 48px;
}

.cart-count {
    display: inline-grid;
    place-items: center;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255,255,255,.2);
    font-size: .75rem;
    margin-left: 4px;
}

.public-menu {
    background: #f8fafc;
}

.menu-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.menu-heading h2 {
    margin: 2px 0 0;
    font-size: 1.7rem;
}

.menu-eyebrow, .modal-eyebrow {
    color: var(--brand);
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.menu-section {
    scroll-margin-top: 70px;
    margin: 28px 0 38px;
}

.section-heading {
    margin-bottom: 14px;
}

.section-heading h2 {
    font-size: 1.35rem;
    margin-bottom: 3px;
}

.section-heading p {
    color: var(--muted);
    margin: 0;
}

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

.menu-product-card {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    min-height: 166px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15,23,42,.04);
}

.menu-product-card > .product-photo {
    width: 132px;
    height: 100%;
    min-height: 166px;
    object-fit: cover;
    border-radius: 0;
}

.product-photo-empty {
    display: grid;
    place-items: center;
    background: #eef2f7;
    color: #94a3b8;
    font-size: 2rem;
}

.product-card-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 14px;
}

.product-card-title {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
}

.product-card-title h3 {
    font-size: 1rem;
    margin: 0;
}

.product-card-body p {
    color: var(--muted);
    font-size: .86rem;
    margin: 6px 0 0;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

.modal-content {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15,23,42,.22);
}

.modal-header, .modal-footer {
    border-color: var(--line);
}

.modal-dialog-scrollable .modal-body,
.modal-body {
    max-height: min(68vh, 720px);
    overflow-y: auto;
}

.order-modal-cart {
    min-height: 72px;
}

.order-summary-box {
    max-height: 180px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafc;
    white-space: pre-wrap;
    font: inherit;
    font-size: .92rem;
}

.order-form-divider {
    height: 1px;
    background: var(--line);
    margin: 4px 0 16px;
}

.schedule-list {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.schedule-list > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
}

.schedule-list > div:last-child {
    border-bottom: 0;
}

.contact-list {
    margin-top: 18px;
}

.contact-list p {
    display: flex;
    gap: 9px;
    align-items: start;
    margin-bottom: 9px;
}

.menu-product img {
    width: 78px;
    height: 78px;
    object-fit: cover;
    border-radius: 8px;
}

.menu-product {
    border-color: #eef2f7;
}

.product-copy {
    min-width: 0;
}

.product-action {
    flex: 0 0 auto;
}

.allergen-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.allergen-icons img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 4px;
}

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

.allergen-option {
    display: grid;
    grid-template-columns: 18px 32px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: .75rem;
    cursor: pointer;
}

.allergen-option:has(input:checked) {
    border-color: var(--brand);
    background: #f0fdfa;
}

.allergen-option img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.allergen-option span {
    overflow-wrap: anywhere;
}

.cart-line, .cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.cart-line small {
    display: block;
    color: var(--muted);
}

.cart-controls {
    display: grid;
    grid-template-columns: 32px 24px 32px 32px;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.cart-controls .btn {
    width: 32px;
    height: 32px;
    padding: 0;
}

.cart-total {
    border-bottom: 0;
    padding-top: 12px;
}

.internal-products {
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.internal-products label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 70px;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid var(--line);
}

.internal-products label:last-child {
    border-bottom: 0;
}

.internal-products small {
    color: var(--muted);
}

.status-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: #344054;
    font-size: .78rem;
}

.app-pagination {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
}

.app-pagination .page-link {
    color: var(--brand);
}

.app-pagination .active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 16px 16px;
    padding: 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff7f7;
}

.danger-zone p {
    margin: 2px 0 0;
    color: #7f1d1d;
    font-size: .86rem;
}

.danger-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.danger-actions form {
    margin: 0;
}

.table-tile {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #fff;
    min-height: 120px;
}

.status-free { border-left: 5px solid #16a34a; }
.status-reserved { border-left: 5px solid #f59e0b; }
.status-occupied { border-left: 5px solid #dc2626; }

.whatsapp-float {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 20;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #25d366;
    color: #fff;
    box-shadow: 0 10px 22px rgba(0,0,0,.18);
    font-size: 26px;
}

.print-body {
    margin: 0;
    background: #eef2f7;
    color: #000;
    font-family: "Courier New", monospace;
}

.print-toolbar {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px;
}

.print-toolbar button {
    border: 1px solid #111;
    background: #fff;
    padding: 8px 12px;
    cursor: pointer;
}

.ticket {
    width: 80mm;
    margin: 0 auto 24px;
    padding: 8mm 5mm;
    background: #fff;
    font-size: 12px;
    line-height: 1.35;
}

.ticket p {
    margin: 2px 0;
}

.ticket-header {
    text-align: center;
}

.ticket-header h1 {
    font-size: 18px;
    margin: 0 0 4px;
}

.ticket-separator {
    margin: 9px 0;
    border-top: 1px dashed #000;
}

.ticket-details, .ticket-totals {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 10px;
    margin: 0;
}

.ticket-details dt, .ticket-details dd,
.ticket-totals dt, .ticket-totals dd {
    margin: 0;
}

.ticket-details dd, .ticket-totals dd {
    text-align: right;
}

.ticket-section h2 {
    font-size: 12px;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.ticket-items {
    width: 100%;
    border-collapse: collapse;
}

.ticket-items td {
    padding: 2px 0;
    vertical-align: top;
}

.ticket-items td:last-child {
    text-align: right;
    white-space: nowrap;
}

.ticket-total {
    padding-top: 4px;
    font-size: 14px;
    font-weight: 700;
}

.ticket-footer {
    text-align: center;
    font-size: 10px;
}

@media print {
    @page {
        size: 80mm auto;
        margin: 0;
    }

    .print-body {
        background: #fff;
    }

    .print-toolbar {
        display: none;
    }

    .ticket {
        margin: 0;
        box-shadow: none;
    }
}

@media (max-width: 991px) {
    .app-main {
        padding: 18px;
    }

    .sidebar {
        min-height: auto;
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .sidebar h1, .sidebar hr {
        grid-column: 1 / -1;
    }

    .sidebar a {
        justify-content: center;
        font-size: .92rem;
    }

    .management-heading {
        align-items: start;
        display: grid;
    }

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

@media (max-width: 575px) {
    .public-hero {
        min-height: 230px;
    }

    .public-hero-rich {
        min-height: 520px;
    }

    .public-hero-no-cover {
        min-height: 500px;
    }

    .display-5 {
        font-size: 2rem;
    }

    .hero-topline {
        align-items: flex-start;
    }

    .hero-logo {
        width: 64px;
        height: 64px;
    }

    .hero-info-grid {
        display: grid;
        gap: 9px;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .menu-heading {
        display: block;
    }

    .menu-heading .btn {
        margin-top: 12px;
    }

    .allergen-picker {
        grid-template-columns: 1fr;
    }

    .table-responsive {
        font-size: .88rem;
    }

    .section-title {
        align-items: start;
        display: grid;
    }

    .danger-zone {
        align-items: stretch;
        display: grid;
    }

    .danger-actions {
        justify-content: stretch;
    }

    .danger-actions form,
    .danger-actions .btn {
        width: 100%;
    }

    .category-nav {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--soft);
        padding-top: 8px;
    }

    .menu-product-card {
        grid-template-columns: 92px minmax(0, 1fr);
        min-height: 150px;
    }

    .menu-product-card > .product-photo {
        width: 92px;
        min-height: 150px;
    }

    .product-card-body {
        padding: 11px;
    }

    .product-card-footer .btn {
        padding-left: 9px;
        padding-right: 9px;
    }
}
