/* CafePOS+ shared SaaS design system and HTMX polish. */

:root {
    --cafepos-green: #1B4332;
    --cafepos-green-dark: #0f2f22;
    --cafepos-sage: #95D5B2;
    --cafepos-beige: #F5F1E8;
    --cafepos-brown: #6F4E37;
    --cafepos-coral: #E76F51;
    --cafepos-bg: #FAFAF7;
    --cafepos-border: rgba(27, 67, 50, 0.12);
    --cafepos-muted: #667085;
    --cafepos-text: #18231d;
    --cafepos-surface: rgba(255, 255, 255, 0.78);
    --cafepos-surface-solid: #ffffff;
    --cafepos-shadow-sm: 0 10px 30px rgba(27, 67, 50, 0.08);
    --cafepos-shadow-md: 0 22px 70px rgba(27, 67, 50, 0.14);
    --cafepos-radius-lg: 24px;
    --cafepos-radius-md: 18px;
}

body {
    background:
        radial-gradient(circle at 8% 8%, rgba(149, 213, 178, 0.34), transparent 30%),
        radial-gradient(circle at 88% 12%, rgba(245, 241, 232, 0.96), transparent 28%),
        radial-gradient(circle at 76% 88%, rgba(111, 78, 55, 0.12), transparent 24%),
        var(--cafepos-bg);
    color: var(--cafepos-text);
    overflow-x: hidden;
}

h1 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
    font-size: clamp(1.45rem, 3vw, 2.15rem);
}

h3,
h4 {
    font-size: clamp(1.12rem, 2.5vw, 1.55rem);
}

.main {
    position: relative;
}

.main::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 32% 22%, rgba(149, 213, 178, 0.16), transparent 18%),
        radial-gradient(circle at 96% 62%, rgba(231, 111, 81, 0.10), transparent 20%);
    z-index: -1;
}

.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    padding: 22px;
    background: rgba(255, 255, 255, 0.74);
    border-right: 1px solid var(--cafepos-border);
    box-shadow: 12px 0 36px rgba(27, 67, 50, 0.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 10;
}

.sidebar h4 {
    color: var(--cafepos-green);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.sidebar .nav-link,
.nav-link {
    position: relative;
    padding: 11px 13px;
    border-radius: 14px;
    color: #34443a;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar .nav-link:hover,
.nav-link:hover {
    background: rgba(149, 213, 178, 0.22);
    color: var(--cafepos-green);
    transform: translateX(2px);
}

.sidebar .nav-link.active,
.nav-link.active {
    background: linear-gradient(135deg, var(--cafepos-green), #2d6a4f);
    color: #fff !important;
    box-shadow: 0 14px 28px rgba(27, 67, 50, 0.20);
}

.main {
    margin-left: 260px;
    padding: 30px;
}

.card,
.glass-card,
.metric-card {
    border: 1px solid var(--cafepos-border);
    border-radius: var(--cafepos-radius-lg);
    background: var(--cafepos-surface);
    box-shadow: var(--cafepos-shadow-sm);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover,
.interactive-card:hover,
.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--cafepos-shadow-md);
    border-color: rgba(27, 67, 50, 0.20);
}

.card-header-soft,
.page-hero {
    border: 1px solid var(--cafepos-border);
    border-radius: var(--cafepos-radius-lg);
    background: linear-gradient(135deg, rgba(255,255,255,0.86), rgba(245,241,232,0.82));
    box-shadow: var(--cafepos-shadow-sm);
    padding: 1.35rem;
}

.btn {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: -0.01em;
    min-height: 42px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-success,
.btn-primary {
    background: linear-gradient(135deg, var(--cafepos-green), #2d6a4f);
    border-color: transparent;
    box-shadow: 0 12px 26px rgba(27, 67, 50, 0.18);
}

.btn-success:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, var(--cafepos-green-dark), var(--cafepos-green));
    border-color: transparent;
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-success {
    color: var(--cafepos-green);
    border-color: rgba(27, 67, 50, 0.18);
    background: rgba(255, 255, 255, 0.72);
}

.btn-outline-secondary:hover,
.btn-outline-primary:hover,
.btn-outline-success:hover {
    color: #fff;
    background: var(--cafepos-green);
    border-color: var(--cafepos-green);
}

.btn-outline-danger,
.btn-danger {
    border-color: rgba(231, 111, 81, 0.38);
}

.btn-danger,
.btn-outline-danger:hover {
    background: var(--cafepos-coral);
    border-color: var(--cafepos-coral);
}

.badge,
.status-chip {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: -0.01em;
    padding: 0.42rem 0.72rem;
}

.text-success {
    color: var(--cafepos-green) !important;
}

.text-warning {
    color: var(--cafepos-brown) !important;
}

.text-danger {
    color: var(--cafepos-coral) !important;
}

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

.table thead th {
    color: var(--cafepos-muted);
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom-color: var(--cafepos-border);
}

.table tbody tr {
    transition: background 0.18s ease, transform 0.18s ease;
}

.table tbody tr:hover {
    background: rgba(149, 213, 178, 0.12);
}

.table-responsive {
    border-radius: var(--cafepos-radius-md);
}

input.form-control,
.form-control,
.form-select {
    border-radius: 14px;
    border-color: rgba(27, 67, 50, 0.14);
    background-color: rgba(255,255,255,0.82);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--cafepos-sage);
    box-shadow: 0 0 0 0.22rem rgba(149, 213, 178, 0.28);
}

.async-alerts {
    min-height: 0;
}

.async-fade {
    transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.async-fade.htmx-swapping {
    opacity: 0;
    transform: translateY(4px);
}

.async-fade.htmx-settling {
    animation: cafeposFadeIn 0.18s ease;
}

@keyframes cafeposFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.htmx-indicator {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

.is-async-busy {
    opacity: 0.72;
    pointer-events: none;
}

body.htmx-page-busy::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    z-index: 2000;
    background: linear-gradient(90deg, var(--cafepos-green), var(--cafepos-sage), var(--cafepos-brown));
    animation: cafeposLoadingBar 1.1s ease-in-out infinite;
}

@keyframes cafeposLoadingBar {
    0% {
        transform: translateX(-100%);
    }
    55% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

.cafepos-htmx-surface.position-relative,
.cafepos-menu-live-root {
    position: relative;
}

.cafepos-htmx-surface-indicator.htmx-indicator,
.recommendation-live-indicator.htmx-indicator {
    position: absolute;
    top: 6px;
    right: 10px;
    height: 2px;
    width: clamp(80px, 22%, 200px);
    border-radius: 2px;
    background: linear-gradient(90deg, var(--cafepos-green), var(--cafepos-sage));
    z-index: 2;
    opacity: 0;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 40px;
}

.icon-button {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.metric-card {
    min-height: 112px;
}

.interactive-card {
    border-radius: var(--cafepos-radius-md);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.interactive-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--cafepos-shadow-md);
}

.pos-category-filter {
    white-space: nowrap;
    cursor: pointer;
}

.category-chip-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0.15rem 0.65rem;
}

.category-chip-bar::-webkit-scrollbar {
    display: none;
}

.pos-category-bar {
    position: sticky;
    top: 0;
    z-index: 4;
    margin-inline: -0.25rem;
}

.category-chip {
    flex: 0 0 auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.62rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(27, 67, 50, 0.14);
    background: rgba(255, 255, 255, 0.82);
    color: var(--cafepos-green);
    font-weight: 800;
    text-decoration: none;
    scroll-snap-align: start;
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.category-chip:hover,
.category-chip.active {
    background: linear-gradient(135deg, var(--cafepos-green), #2d6a4f);
    color: #fff;
    box-shadow: 0 12px 24px rgba(27, 67, 50, 0.18);
    transform: translateY(-1px);
}

.adaptive-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: clamp(0.8rem, 1.6vw, 1.1rem);
    align-items: stretch;
}

.menu-item,
.menu-item > .card {
    min-width: 0;
}

.pos-category-section {
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.pos-category-header {
    border: 1px solid var(--cafepos-border);
    border-left: 5px solid var(--cafepos-green);
    background: rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: var(--cafepos-shadow-sm);
}

.pos-product-card {
    min-height: 100%;
    overflow: hidden;
    border: 0;
}

.pos-product-card h5,
.addon-card h6,
.cart-line strong {
    overflow-wrap: anywhere;
}

.pos-product-card.unavailable,
.addon-card.unavailable {
    opacity: 0.58;
    filter: grayscale(0.55);
}

.pos-product-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
}

.addon-section {
    border: 1px dashed rgba(111, 78, 55, 0.35);
    background: rgba(245, 241, 232, 0.62);
    border-radius: var(--cafepos-radius-lg);
    padding: 1rem;
}

.addon-card {
    border-style: dashed;
    border-color: rgba(111, 78, 55, 0.28);
    background: var(--cafepos-surface);
}

.addon-thumb {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 12px;
}

.cart-shell {
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.pos-cart-panel {
    position: sticky;
    top: 24px;
}

.cashier-pos-grid {
    align-items: flex-start;
}

.cart-line {
    border-bottom: 1px solid var(--cafepos-border);
    padding-block: 0.85rem;
}

.cart-line:last-child {
    border-bottom: 0;
}

.cart-qty-controls {
    display: inline-grid;
    grid-template-columns: 40px minmax(34px, auto) 40px;
    align-items: center;
    gap: 0.4rem;
}

.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(149, 213, 178, 0.18);
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.72), transparent);
    animation: cafeposSkeleton 1.2s infinite;
}

@keyframes cafeposSkeleton {
    to {
        transform: translateX(100%);
    }
}

.table-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.responsive-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-content {
    border: 0;
    border-radius: var(--cafepos-radius-lg);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(18px);
    pointer-events: auto;
}

.modal {
    z-index: 1065;
    pointer-events: none;
}

.modal.show {
    pointer-events: auto;
}

.modal-dialog {
    position: relative;
    z-index: 1070;
}

.modal-backdrop {
    z-index: 1055;
    background-color: rgba(15, 23, 42, 0.42);
}

.modal-open .sidebar {
    z-index: 1;
}

.reservation-input {
    min-height: 52px;
    padding-left: 2.75rem;
}

.field-icon {
    position: absolute;
    left: 1rem;
    top: 2.55rem;
    color: var(--cafepos-green);
    pointer-events: none;
}

.section-panel {
    background: rgba(245, 241, 232, 0.42);
    border: 1px solid rgba(27, 67, 50, 0.10);
    border-radius: var(--cafepos-radius-lg);
    padding: 1rem;
}

.receipt-actions {
    gap: 0.75rem;
}

.receipt-shell {
    max-width: 420px;
    margin: 0 auto;
    background: #fff;
    color: #111;
    border-radius: 20px;
    box-shadow: var(--cafepos-shadow-md);
    border: 1px solid rgba(17, 24, 39, 0.08);
    overflow: hidden;
}

.thermal-receipt {
    width: 100%;
    padding: 0;
    font-family: "Courier New", Courier, monospace;
}

.receipt-brand {
    text-align: center;
    border-bottom: 1px dashed #222;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.receipt-items {
    border-block: 1px dashed #222;
    margin-block: 12px;
    padding-block: 10px;
}

.receipt-total {
    border-top: 2px solid #111;
    margin-top: 10px;
    padding-top: 10px;
    font-size: 16px;
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .pos-cart-panel {
        position: static !important;
    }

    .main {
        margin-left: 0 !important;
        padding: 18px !important;
    }

    .sidebar {
        position: sticky !important;
        top: 0;
        width: 100% !important;
        height: auto !important;
        padding: 14px 16px;
        border-right: 0 !important;
        border-bottom: 1px solid var(--cafepos-border);
        box-shadow: 0 10px 30px rgba(27, 67, 50, 0.08);
        z-index: 20;
    }

    .sidebar .nav {
        flex-direction: row !important;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }

    .sidebar .nav::-webkit-scrollbar {
        display: none;
    }

    .sidebar .nav li {
        flex: 0 0 auto;
    }

    .sidebar .nav-link {
        min-height: 44px;
        white-space: nowrap;
    }

    .sidebar form {
        margin-top: 0.75rem !important;
        padding-top: 0.75rem !important;
    }

    .cashier-pos-grid > [class*="col-"] {
        width: 100%;
    }

    .pos-product-image {
        height: clamp(135px, 24vw, 180px);
    }

    .pos-cart-panel {
        margin-bottom: 1rem;
    }
}

@media (max-width: 767.98px) {
    .responsive-toolbar {
        align-items: stretch;
    }

    .responsive-toolbar > * {
        width: 100%;
    }

    .table-action-group .btn,
    .table-action-group form {
        width: 100%;
    }

    .table-action-group form .btn {
        width: 100%;
    }

    .main {
        padding: 12px !important;
    }

    .page-hero,
    .card-body {
        padding: 1rem !important;
    }

    .btn {
        min-height: 44px;
    }

    .card,
    .glass-card,
    .metric-card {
        border-radius: 20px;
        box-shadow: 0 10px 28px rgba(27, 67, 50, 0.07);
    }

    .card:hover,
    .interactive-card:hover,
    .glass-card:hover {
        transform: none;
        box-shadow: 0 10px 28px rgba(27, 67, 50, 0.07);
    }

    .page-hero {
        align-items: flex-start !important;
    }

    .pos-category-header,
    .pos-card-meta,
    .pos-card-actions,
    .cart-line-header,
    .cart-line-actions {
        align-items: flex-start !important;
        flex-wrap: wrap;
    }

    .pos-card-actions form,
    .pos-card-actions .btn,
    .cart-line-actions form,
    .cart-line-actions .btn {
        width: 100%;
    }

    .cart-line-actions {
        gap: 0.75rem !important;
    }

    .cart-qty-controls {
        width: 100%;
        grid-template-columns: 44px 1fr 44px;
    }

    .cart-qty-controls .icon-button,
    .icon-button {
        width: 44px;
        height: 44px;
    }

    .addon-card-body {
        align-items: flex-start !important;
    }

    .addon-thumb {
        width: 72px;
        height: 72px;
    }

    .receipt-actions {
        width: 100%;
        flex-direction: column;
    }

    .receipt-actions .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .category-chip {
        min-height: 42px;
        padding-inline: 0.85rem;
        font-size: 0.88rem;
    }

    .adaptive-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .pos-product-card .card-body {
        padding: 0.8rem !important;
    }

    .pos-product-card h5 {
        font-size: 0.96rem;
    }

    .pos-product-card p {
        font-size: 0.8rem;
    }

    .pos-product-card .badge {
        font-size: 0.68rem;
        padding: 0.34rem 0.48rem;
    }

    .pos-product-card .action-button {
        min-height: 38px;
        font-size: 0.82rem;
    }

    .sidebar h4 {
        font-size: 1.05rem;
    }

    .sidebar .nav-link {
        padding-inline: 12px;
    }

    .pos-product-grid {
        gap: 0.75rem;
    }

    .addon-card-body {
        flex-direction: column;
    }

    .addon-thumb {
        width: 100%;
        height: 132px;
    }
}

@media (max-width: 767.98px) and (orientation: landscape) {
    .adaptive-menu-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 576px) and (max-width: 991.98px) and (orientation: portrait) {
    .adaptive-menu-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) and (orientation: landscape) {
    .adaptive-menu-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .pos-product-card .card-body,
    .addon-card .card-body {
        padding: 0.75rem !important;
    }

    .pos-product-card h5,
    .addon-card h6 {
        font-size: 0.92rem;
    }

    .pos-product-card p {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .pos-product-card .badge,
    .addon-card .badge {
        font-size: 0.66rem;
        padding: 0.32rem 0.45rem;
    }
}

@media (hover: none), (max-width: 991.98px) {
    .card,
    .interactive-card,
    .glass-card,
    .btn,
    .async-fade {
        transition-duration: 0.12s;
    }

    .main::before {
        opacity: 0.55;
    }
}

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

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .sidebar,
    .page-hero,
    .receipt-actions,
    .no-print,
    .modal,
    .modal-backdrop {
        display: none !important;
    }

    .main {
        margin: 0 !important;
        padding: 0 !important;
    }

    .receipt-shell:not(.thermal-screen-shell) {
        width: 72mm;
        max-width: 72mm;
        margin: 0;
        border: 0;
        box-shadow: none;
        border-radius: 0;
    }

    .receipt-shell.thermal-screen-shell {
        width: 58mm;
        max-width: 58mm;
    }

    /* Thermal receipt typography is owned by thermal-receipt.css */
    .thermal-receipt {
        padding: 0;
    }

    .card,
    .receipt-shell {
        background: #fff !important;
        backdrop-filter: none !important;
    }
}

/* Recipe editor toolbar — grouped import / export */
.recipe-editor-toolbar .recipe-editor-actions {
    flex: 1 1 auto;
    justify-content: flex-end;
    max-width: 100%;
    display: flex;
}

.recipe-editor-toolbar .recipe-io-group {
    flex-wrap: nowrap;
    align-items: stretch;
}

.recipe-editor-toolbar .recipe-import-form {
    display: inline-flex;
    margin: 0;
}

.recipe-editor-toolbar .recipe-import-btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.recipe-editor-toolbar .recipe-export-group .dropdown-toggle {
    min-height: 31px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 0;
}

@media (max-width: 575.98px) {
    .recipe-editor-toolbar .recipe-editor-actions {
        width: 100%;
    }

    .recipe-editor-toolbar .recipe-io-group {
        width: 100%;
        display: flex;
    }

    .recipe-editor-toolbar .recipe-import-form,
    .recipe-editor-toolbar .recipe-export-group {
        flex: 1 1 50%;
    }

    .recipe-editor-toolbar .recipe-import-btn,
    .recipe-editor-toolbar .recipe-export-group .dropdown-toggle {
        width: 100%;
        justify-content: center;
    }
}

/* Inventory dashboard — unified KPI grid */
.inventory-kpi-grid .inventory-kpi-card {
    display: flex;
    flex-direction: column;
    min-height: 118px;
}

.inventory-kpi-grid .inventory-kpi-label {
    display: block;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.inventory-kpi-grid .inventory-kpi-value {
    line-height: 1.15;
}

.inventory-kpi-grid .inventory-kpi-card-static {
    cursor: default;
}

.inventory-kpi-static-link {
    color: inherit;
}

.inventory-kpi-static-link:hover .inventory-kpi-card-static {
    border-color: rgba(27, 67, 50, 0.18);
}

/* Staff empty states */
.staff-empty-state {
    border: 1px dashed rgba(27, 67, 50, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.staff-empty-state-icon {
    font-size: 1.35rem;
    color: rgba(27, 67, 50, 0.45);
}

.staff-empty-state-title {
    color: #344054;
}

.staff-empty-state-message {
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

/* Operational layout polish */
.page-hero,
.responsive-toolbar,
.operational-filter-bar,
.reservations-filter-bar {
    gap: 0.75rem;
}

.reservations-workspace {
    position: relative;
}

.reservations-live-indicator {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    z-index: 2;
}

.action-button,
.btn.action-button,
.table-action-group .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
}

.htmx-request.htmx-error-banner-visible::after {
    content: none;
}

.cafepos-operational-toast {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%) translateY(120%);
    z-index: 1080;
    max-width: min(92vw, 420px);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(20, 33, 27, 0.94);
    color: #fff;
    font-size: 0.875rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.cafepos-operational-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.inventory-usage-panel form.card {
    border: 1px solid var(--cafepos-border);
}

/* Admin page organization */
.admin-page-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.admin-page-section + .admin-page-section {
    margin-top: 0;
}

.admin-page-header {
    align-items: flex-start;
}

.admin-page-subtitle {
    max-width: 42rem;
}

.admin-section-card .card-body {
    padding: 1.1rem 1.15rem;
}

.admin-section-heading h4,
.admin-section-heading h5 {
    letter-spacing: -0.02em;
}

.admin-data-table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #667085;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.admin-data-table tbody tr:nth-child(even) {
    background: rgba(27, 67, 50, 0.025);
}

.admin-data-table tbody td {
    padding-top: 0.72rem;
    padding-bottom: 0.72rem;
    vertical-align: middle;
}

.forecast-table-wrap {
    max-height: min(70vh, 720px);
    overflow: auto;
}

.forecast-table-head th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 -1px 0 rgba(27, 67, 50, 0.08);
}

.forecast-priority-card {
    border: 1px solid rgba(27, 67, 50, 0.1);
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    background: rgba(255, 255, 255, 0.82);
}

.forecast-list-row {
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(27, 67, 50, 0.08);
}

.forecast-list-row:last-child {
    border-bottom: 0;
}

.forecast-kpi-grid .inventory-kpi-card .card-body {
    min-height: 92px;
}

@media (max-width: 767.98px) {
    .admin-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .forecast-table-wrap {
        max-height: none;
    }
}
