/* ======================================================
   Hotel Operations Hub
   Clean Professional Light Theme
   Bootstrap-standard colours
====================================================== */

:root {
    /* Standard Bootstrap-style palette */
    --primary: #0d6efd;
    --primary-hover: #0b5ed7;
    --secondary: #6c757d;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;

    /* App neutrals */
    --page-bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8f9fa;
    --surface-hover: #eef2f7;

    --text: #212529;
    --text-soft: #495057;
    --muted: #6c757d;

    --border: #dee2e6;
    --border-soft: #e9ecef;

    --radius-sm: 0.45rem;
    --radius-md: 0.65rem;
    --radius-lg: 0.9rem;

    /* Bootstrap variable support */
    --bs-body-bg: var(--page-bg);
    --bs-body-color: var(--text);
    --bs-primary: var(--primary);
    --bs-primary-rgb: 13, 110, 253;
    --bs-secondary: var(--secondary);
    --bs-secondary-rgb: 108, 117, 125;
    --bs-success: var(--success);
    --bs-danger: var(--danger);
    --bs-warning: var(--warning);
    --bs-info: var(--info);
    --bs-border-color: var(--border);
    --bs-link-color: var(--primary);
    --bs-link-hover-color: var(--primary-hover);
    --bs-tertiary-bg: var(--surface-soft);
    --bs-secondary-bg: var(--surface-soft);
}

/* ======================================================
   Base
====================================================== */

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    background: var(--page-bg) !important;
    color: var(--text) !important;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover,
a:focus {
    color: var(--primary-hover);
    text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
label,
strong {
    color: var(--text);
}

p {
    color: var(--text-soft);
}

small,
.text-body-secondary,
.muted {
    color: var(--muted) !important;
}

/* ======================================================
   Layout
====================================================== */

.container-fluid,
.row {
    background: transparent !important;
}

main {
    background: transparent !important;
    color: var(--text) !important;
    padding-top: 0.85rem !important;
    padding-bottom: 1rem !important;
}

aside {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* ======================================================
   Navbar / top bar
====================================================== */

.navbar {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 0.65rem 0.85rem !important;
    margin-bottom: 0.85rem !important;
}

.navbar h1 {
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.navbar .small {
    color: var(--muted) !important;
}

/* ======================================================
   Brand / logo blocks
====================================================== */

.bg-primary,
.rounded.bg-primary {
    background-color: var(--primary) !important;
}

.text-white {
    color: #ffffff !important;
}

/* ======================================================
   Sidebar and navigation
====================================================== */

.list-group {
    background: transparent !important;
}

.list-group-flush > .list-group-item {
    border-width: 0 0 1px;
}

.list-group-item {
    background: transparent !important;
    color: var(--text-soft) !important;
    border-color: var(--border-soft) !important;
    padding: 0.55rem 0.75rem;
    font-weight: 500;
}

.list-group-item i {
    color: currentColor;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background: var(--surface-hover) !important;
    color: var(--text) !important;
}

.list-group-item.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

.list-group-item.active *,
.list-group-item.active i,
.list-group-item.active span {
    color: #ffffff !important;
}

button.list-group-item {
    width: 100%;
    text-align: left;
}

/* Nested menu links */
.ps-4 .list-group-item {
    font-size: 0.875rem;
    padding: 0.45rem 0.65rem;
    color: var(--muted) !important;
}

.ps-4 .list-group-item:hover {
    color: var(--text) !important;
}

.ps-4 .list-group-item.active {
    color: #ffffff !important;
}

/* ======================================================
   Mobile offcanvas menu
====================================================== */

.offcanvas,
.offcanvas-header,
.offcanvas-body {
    background: var(--surface) !important;
    color: var(--text) !important;
}

.offcanvas {
    border-color: var(--border) !important;
}

.offcanvas-title {
    color: var(--text);
    font-weight: 700;
}

.offcanvas .list-group {
    background: var(--surface) !important;
}

.offcanvas .list-group-item {
    background: var(--surface) !important;
    color: var(--text-soft) !important;
    border-color: var(--border-soft) !important;
}

.offcanvas .list-group-item:hover,
.offcanvas .list-group-item:focus {
    background: var(--surface-hover) !important;
    color: var(--text) !important;
}

.offcanvas .list-group-item.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

/* ======================================================
   Cards and containers
====================================================== */

.card {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 1rem;
    margin-bottom: 0.85rem;
    box-shadow: none !important;
}

.card:has(> .card-body),
.card:has(> .card-header) {
    padding: 0;
}

.card-body {
    color: var(--text);
    padding: 1rem;
}

.card-header {
    color: var(--text);
    border-color: var(--border-soft) !important;
    padding: 0.75rem 1rem;
}

.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6 {
    color: var(--text);
    font-weight: 700;
}

.card p {
    color: var(--text-soft);
}

/* ======================================================
   Movable / minimisable page panels
====================================================== */

.layout-grid-container {
    position: relative;
}

.layout-panel {
    position: relative;
}

.layout-panel.is-dragging {
    opacity: 0.72;
}

.layout-panel-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    min-height: 2.25rem;
    color: var(--text);
}

.card > .layout-panel-bar,
.card-header.layout-panel-bar {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-soft);
}

.card > .layout-panel-bar + .layout-panel-body > .card-body {
    padding-top: 1rem;
}

.table-wrap > .layout-panel-bar,
.table-responsive > .layout-panel-bar,
.metric > .layout-panel-bar,
.stock-value-card > .layout-panel-bar,
.stock-health-card > .layout-panel-bar,
.stock-category-card > .layout-panel-bar,
[class*="col-"] > .layout-panel-bar,
[class^="col"] > .layout-panel-bar {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border-soft);
    background: var(--surface-soft);
}

[class*="col-"] > .layout-panel-bar,
[class^="col"] > .layout-panel-bar {
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

[class*="col-"] > .layout-panel-body > .card,
[class^="col"] > .layout-panel-body > .card,
[class*="col-"] > .layout-panel-body > .metric,
[class^="col"] > .layout-panel-body > .metric {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

.layout-panel-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
}

.layout-panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex: 0 0 auto;
}

.layout-panel-button {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem !important;
    height: 1.45rem !important;
    min-width: 1.45rem !important;
    min-height: 1.45rem !important;
    padding: 0 !important;
    border: 1px solid transparent !important;
    border-radius: 0.35rem !important;
    background: transparent !important;
    color: var(--muted) !important;
    box-shadow: none !important;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1 !important;
}

.layout-panel-button:hover,
.layout-panel-button:focus {
    color: var(--text) !important;
    background: var(--surface-hover) !important;
    border-color: var(--border) !important;
    outline: none;
}

.layout-drag-handle {
    cursor: grab;
}

.layout-drag-handle:active {
    cursor: grabbing;
}

.layout-panel.is-minimised {
    min-height: 0;
}

.layout-panel.is-minimised > .layout-panel-bar {
    border-bottom: 0;
}

.layout-panel-body[hidden] {
    display: none !important;
}

/* ======================================================
   Dashboard metrics
====================================================== */

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.metric {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg);
    padding: 0.9rem;
    min-height: 90px;
}

.metric span {
    display: block;
    color: var(--muted) !important;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.metric strong {
    display: block;
    color: var(--text) !important;
    font-size: 1.45rem;
    font-weight: 700;
}

.metric small {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted) !important;
    font-size: 0.82rem;
}

.stock-flat-summary-grid .metric {
    min-height: 72px;
    padding: 0.7rem 0.8rem;
}

.stock-flat-summary-grid .metric span {
    margin-bottom: 0.22rem;
    font-size: 0.8rem;
}

.stock-flat-summary-grid .metric strong {
    overflow: hidden;
    font-size: 1.22rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-flat-summary-grid .metric small {
    margin-top: 0.2rem;
    font-size: 0.76rem;
}

.stock-category-filter-card {
    display: block;
    text-decoration: none !important;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.stock-category-filter-card:hover,
.stock-category-filter-card:focus {
    color: var(--text) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 8px 18px rgba(13, 110, 253, 0.12) !important;
    transform: translateY(-1px);
}

.stock-category-filter-card.active {
    border-color: var(--primary) !important;
    box-shadow: inset 0 0 0 1px var(--primary), 0 8px 18px rgba(13, 110, 253, 0.1) !important;
}

/* ======================================================
   Forms
====================================================== */

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

input,
select,
textarea,
.form-control,
.form-select {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.5rem 0.7rem;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted) !important;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.16) !important;
}

textarea {
    min-height: 90px;
}

/* ======================================================
   Buttons
====================================================== */

.btn-primary,
.button,
button[type="submit"] {
    background: var(--primary) !important;
    color: #ffffff !important;
    border: 1px solid var(--primary) !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600;
}

.btn-primary:hover,
.button:hover,
button[type="submit"]:hover {
    background: var(--primary-hover) !important;
    color: #ffffff !important;
    border-color: var(--primary-hover) !important;
}

.btn-outline-secondary {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    border-radius: var(--radius-md) !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--surface-hover) !important;
    color: var(--text) !important;
    border-color: var(--secondary) !important;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    text-decoration: none;
}

.secondary-button {
    background: var(--surface-soft) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}

.secondary-button:hover {
    background: var(--surface-hover) !important;
    color: var(--text) !important;
}

.small-button {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* ======================================================
   Tables
====================================================== */

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

table {
    width: 100%;
    background: var(--surface) !important;
    color: var(--text) !important;
    border-collapse: collapse;
    margin-bottom: 0;
}

th,
td {
    color: var(--text) !important;
    border-color: var(--border-soft) !important;
    padding: 0.65rem 0.75rem;
    vertical-align: middle;
}

th {
    background: var(--surface-soft) !important;
    color: var(--muted) !important;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

th.table-sortable {
    cursor: pointer;
    user-select: none;
}

th.table-sortable:hover,
th.table-sortable:focus {
    color: var(--text) !important;
    background: var(--surface-hover) !important;
}

.table-sort-indicator {
    display: inline-block;
    min-width: 1em;
    margin-left: 0.35rem;
    color: var(--muted);
    font-size: 0.75em;
}

td {
    color: var(--text-soft) !important;
}

tr:hover td {
    background: var(--surface-hover) !important;
}

/* Bootstrap table compatibility */
.table {
    --bs-table-bg: var(--surface);
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border-soft);
    --bs-table-striped-bg: var(--surface-soft);
    --bs-table-hover-bg: var(--surface-hover);
}

/* ======================================================
   Dropdowns
====================================================== */

.dropdown-menu {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    border-radius: var(--radius-md);
}

.dropdown-item,
.dropdown-item-text {
    color: var(--text) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--surface-hover) !important;
    color: var(--text) !important;
}

.dropdown-divider {
    border-color: var(--border);
}

/* ======================================================
   Alerts
====================================================== */

.success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.warning,
.warn {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

/* ======================================================
   Badges / stock helpers
====================================================== */

.badge {
    font-weight: 600;
}

.stock-positive {
    color: var(--success) !important;
    font-weight: 700;
}

.stock-negative {
    color: var(--danger) !important;
    font-weight: 700;
}

img.thumb {
    max-width: 80px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* ======================================================
   Modal
====================================================== */

.modal-content {
    display: flex;
    flex-direction: column;
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    border-radius: var(--radius-lg);
    max-height: calc(100vh - 3.5rem);
    max-height: calc(100dvh - 3.5rem);
    overflow: hidden;
}

.modal-content > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    max-height: inherit;
}

.modal-header,
.modal-footer {
    border-color: var(--border) !important;
    flex-shrink: 0;
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-title {
    color: var(--text);
    font-weight: 700;
}

/* ======================================================
   Utility cleanup
====================================================== */

.border,
.border-top,
.border-bottom,
.border-start,
.border-end {
    border-color: var(--border) !important;
}

.bg-light,
.bg-body-tertiary {
    background-color: var(--surface-soft) !important;
}

.bg-white {
    background-color: var(--surface) !important;
}

.text-dark,
.text-black {
    color: var(--text) !important;
}

/* ======================================================
   Compact phone/tablet layout
====================================================== */

@media (max-width: 992px) {
    .app-main {
        padding: 0.75rem !important;
    }

    main {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .row.g-4,
    .row.g-3 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }

    .mb-4 {
        margin-bottom: 0.9rem !important;
    }

    .gap-3 {
        gap: 0.65rem !important;
    }

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

    .metric {
        padding: 0.75rem;
        min-height: 78px;
    }

    .metric strong {
        font-size: 1.25rem;
    }

    .card {
        padding: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .card:has(> .card-body),
    .card:has(> .card-header) {
        padding: 0;
    }

    .card-body,
    .card-body.p-4 {
        padding: 0.8rem !important;
    }

    .card-body.p-0 {
        padding: 0 !important;
    }

    .card-header {
        padding: 0.65rem 0.8rem;
    }

    .navbar {
        margin-bottom: 0.75rem !important;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 14px;
    }

    .modal {
        --bs-modal-margin: 0.5rem;
        overflow-y: auto !important;
    }

    .modal-dialog,
    .modal-dialog-scrollable {
        height: calc(100vh - 1rem);
        height: calc(100dvh - 1rem);
        min-height: 0;
        margin: 0.5rem;
        display: flex;
        align-items: stretch;
    }

    .modal-content {
        width: 100%;
        flex: 1 1 auto;
        min-height: 0;
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .modal-body {
        max-height: none;
        padding: 0.6rem;
    }

    .modal-header,
    .modal-footer {
        padding: 0.55rem 0.6rem;
    }

    .modal-footer {
        gap: 0.45rem;
    }

    .app-main {
        padding: 0.5rem !important;
    }

    main {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        padding-top: 0.5rem !important;
        padding-bottom: 0.75rem !important;
    }

    .d-flex.flex-column.flex-md-row,
    .d-flex.justify-content-between.align-items-center {
        margin-bottom: 0.7rem !important;
    }

    .row.g-4,
    .row.g-3 {
        --bs-gutter-x: 0.55rem;
        --bs-gutter-y: 0.55rem;
    }

    .mb-4 {
        margin-bottom: 0.7rem !important;
    }

    .mb-3 {
        margin-bottom: 0.55rem !important;
    }

    .gap-3,
    .gap-2 {
        gap: 0.45rem !important;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        margin-bottom: 0.65rem;
    }

    .app-main > .row.g-3 > [class*="col-md-"]:has(> .card),
    .app-main > .row.g-3 > [class*="col-md-"]:has(> a > .card) {
        flex: 0 0 auto;
        width: 50%;
    }

    .navbar {
        padding: 0.45rem 0.55rem !important;
        margin-bottom: 0.55rem !important;
    }

    .navbar h1 {
        font-size: 1rem;
    }

    .metric {
        padding: 0.65rem;
        min-height: 70px;
    }

    .metric span {
        font-size: 0.8rem;
    }

    .metric strong {
        font-size: 1.15rem;
    }

    .card {
        padding: 0.6rem;
        margin-bottom: 0.6rem;
        border-radius: var(--radius-md) !important;
    }

    .card:has(> .card-body),
    .card:has(> .card-header) {
        padding: 0;
    }

    .card-body,
    .card-body.p-4 {
        padding: 0.6rem !important;
    }

    .card-body.p-0 {
        padding: 0 !important;
    }

    .card-header {
        padding: 0.55rem 0.6rem;
    }

    .card .p-4,
    .table-wrap + .p-4 {
        padding: 0.65rem !important;
    }

    .h3,
    h1.h3 {
        font-size: 1.15rem;
    }

    .h5,
    h2.h5 {
        font-size: 1rem;
    }

    .display-6 {
        font-size: 1.22rem;
        line-height: 1.15;
    }

    .card .small {
        line-height: 1.2;
    }

    th,
    td {
        padding: 0.45rem 0.5rem;
        font-size: 0.875rem;
    }

    input,
    select,
    textarea,
    .form-control,
    .form-select,
    .button {
        padding: 0.42rem 0.55rem;
    }
}
:root {
    --nyt-primary: var(--primary);
    --nyt-primary-dark: var(--primary-hover);
    --nyt-primary-soft: rgba(13, 110, 253, 0.15);
    --nyt-dark: #111827;
    --nyt-muted: #6b7280;
    --nyt-border: rgba(148, 163, 184, 0.25);
    --theme-accent: var(--primary);
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --emerald-800: #065f46;
}

/* Login page */
.login-page-shell {
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 3rem);
    margin: -1.5rem calc(50% - 50vw);
    padding: 0 1rem;
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.45), transparent 34rem),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.35), transparent 32rem),
        linear-gradient(135deg, #0f172a 0%, #1e1b4b 48%, #020617 100%);
}

.login-background-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(8px);
    opacity: 0.55;
    pointer-events: none;
}

.login-background-orb-one {
    width: 18rem;
    height: 18rem;
    left: 8%;
    top: 12%;
    background: rgba(129, 140, 248, 0.35);
}

.login-background-orb-two {
    width: 22rem;
    height: 22rem;
    right: 6%;
    bottom: 8%;
    background: rgba(56, 189, 248, 0.25);
}

.login-logo {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
}

.login-logo i {
    font-size: 2.4rem;
    color: #fff;
}

.login-brand {
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.login-card {
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
}

.login-card .form-control {
    border-radius: 16px;
    border-color: #e5e7eb;
}

.login-card .form-control:focus {
    border-color: var(--nyt-primary);
    box-shadow: 0 0 0 0.25rem var(--nyt-primary-soft);
}

.login-button {
    border: 0;
    border-radius: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--nyt-primary), #2563eb);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
}

.login-button:hover {
    background: linear-gradient(135deg, var(--nyt-primary-dark), #1d4ed8);
    transform: translateY(-1px);
}

/* Optional: makes your logged-in app match the same theme */
.app-shell {
    min-height: 100vh;
    background: #f8fafc;
}

.app-sidebar {
    min-height: 100vh;
    background: #ffffff !important;
}

.app-sidebar .list-group-item {
    border: 0;
    border-radius: 14px;
    margin-bottom: 0.25rem;
    color: #334155;
}

.app-sidebar .list-group-item:hover {
    background: #f1f5f9;
    color: var(--nyt-primary-dark);
}

.app-sidebar .list-group-item.active {
    background: linear-gradient(135deg, var(--nyt-primary), #2563eb);
    color: #fff;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.22);
}

.app-main .navbar {
    background: #ffffff !important;
    border-color: var(--nyt-border) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

/* ======================================================
   App shell sizing and scroll-safe sidebar
====================================================== */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.app-shell {
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

.app-row {
    min-height: 100vh;
    min-height: 100dvh;
    flex-wrap: nowrap;
}

.app-sidebar {
    position: sticky;
    top: 0;
    width: 274px;
    flex: 0 0 274px;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    transition: width 0.18s ease, flex-basis 0.18s ease;
}

.app-sidebar-brand {
    flex: 0 0 auto;
    min-height: 66px;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-soft);
}

.app-sidebar-logo {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    font-weight: 800;
}

.app-sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-sidebar-toggle {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

.app-sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.55rem;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.sidebar-menu {
    gap: 0.15rem;
}

.app-sidebar .list-group-flush > .list-group-item,
.offcanvas .list-group-flush > .list-group-item {
    border-width: 0;
}

.app-sidebar .list-group-item,
.offcanvas .list-group-item {
    min-height: 40px;
    border-radius: 8px;
    margin-bottom: 0.15rem;
    padding: 0.5rem 0.6rem;
}

.app-sidebar .list-group-item i:first-child,
.offcanvas .list-group-item i:first-child {
    width: 1.3rem;
    flex: 0 0 1.3rem;
    text-align: center;
}

.sidebar-child-link {
    padding-left: 0.75rem !important;
}

.app-main {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
}

.app-main > * {
    max-width: 100%;
}

.table-responsive,
.table-wrap {
    max-width: 100%;
}

body.sidebar-collapsed .app-sidebar {
    width: 76px;
    flex-basis: 76px;
}

body.sidebar-collapsed .app-sidebar-brand {
    justify-content: center;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .app-sidebar .sidebar-label,
body.sidebar-collapsed .app-sidebar .sidebar-chevron,
body.sidebar-collapsed .app-sidebar .collapse {
    display: none !important;
}

body.sidebar-collapsed .app-sidebar-toggle {
    margin-left: 0 !important;
}

body.sidebar-collapsed .app-sidebar-scroll {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}

body.sidebar-collapsed .app-sidebar .list-group-item {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

body.sidebar-collapsed .app-sidebar .list-group-item i:first-child {
    width: auto;
    flex-basis: auto;
}

.offcanvas {
    max-width: min(86vw, 320px);
    height: 100vh;
    height: 100dvh;
}

.offcanvas-body.app-sidebar-scroll {
    padding: 0.55rem !important;
}

@media (max-width: 991.98px) {
    .app-row {
        display: block;
        min-height: auto;
    }

    .app-main {
        width: 100%;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
    }
}

/* ======================================================
   Friendlier app-style navigation
====================================================== */

.app-sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
}

.app-sidebar-brand {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(12px);
}

.app-sidebar-logo {
    box-shadow: 0 10px 22px rgba(13, 110, 253, 0.18);
}

.app-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
    padding: 0.15rem 0 0.75rem;
    margin-bottom: 0.55rem;
    border-bottom: 1px solid var(--border-soft);
}

.app-quick-action {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 40px;
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(13, 110, 253, 0.18);
    border-radius: 10px;
    color: var(--primary);
    background: rgba(13, 110, 253, 0.06);
    font-weight: 700;
}

.app-quick-action:hover,
.app-quick-action:focus {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

.app-quick-action i {
    width: 1.25rem;
    text-align: center;
}

.sidebar-section-label {
    padding: 0.85rem 0.6rem 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
}

.app-sidebar .list-group-item,
.offcanvas .list-group-item {
    position: relative;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.app-sidebar .list-group-item:hover,
.offcanvas .list-group-item:hover {
    transform: translateX(2px);
}

.app-sidebar .list-group-item.active,
.offcanvas .list-group-item.active {
    background: #0d6efd !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(13, 110, 253, 0.18);
}

body.sidebar-collapsed .app-quick-actions {
    padding-bottom: 0.45rem;
}

body.sidebar-collapsed .app-quick-action {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

body.sidebar-collapsed .sidebar-section-label {
    display: none;
}

.mobile-tabbar {
    position: fixed;
    left: 0.65rem;
    right: 0.65rem;
    bottom: max(0.65rem, env(safe-area-inset-bottom));
    z-index: 1030;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.2rem;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(14px);
}

.mobile-tabbar-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 48px;
    gap: 0.15rem;
    border-radius: 12px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.mobile-tabbar-link i {
    font-size: 1.05rem;
    line-height: 1;
}

.mobile-tabbar-link.active {
    color: var(--primary);
    background: rgba(13, 110, 253, 0.09);
}

.mobile-tabbar-link:hover,
.mobile-tabbar-link:focus {
    color: var(--primary);
}

@media (max-width: 991.98px) {
    .app-main {
        padding-bottom: 5.5rem !important;
    }

    .offcanvas .app-quick-actions {
        padding: 0.15rem 0 0.75rem;
    }
}

@media (max-width: 420px) {
    .mobile-tabbar {
        left: 0.45rem;
        right: 0.45rem;
        bottom: 0.45rem;
        border-radius: 14px;
    }

    .mobile-tabbar-link {
        min-height: 44px;
        font-size: 0.68rem;
    }
}

/* ======================================================
   Full-height app viewport lock
====================================================== */

.app-body {
    width: 100%;
    height: var(--app-height, 100vh);
    min-height: var(--app-height, 100vh);
    max-height: var(--app-height, 100vh);
    overflow: hidden;
}

.public-body {
    min-height: 100vh;
    overflow-x: hidden;
}

.app-body .app-shell {
    width: 100%;
    height: var(--app-height, 100vh);
    min-height: 0;
    max-height: var(--app-height, 100vh);
    padding: 0 !important;
    overflow: hidden;
}

.app-body .app-row {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    width: 100%;
    margin: 0 !important;
    overflow: hidden;
}

.app-body .app-sidebar {
    height: 100%;
    max-height: 100%;
}

.app-body .app-main {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.app-body .app-main > .navbar {
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* ======================================================
   Stock dashboard
====================================================== */

.stock-sheet-card {
    background: #ffffff;
    border: 1px solid var(--slate-200, #e2e8f0);
    border-radius: 0.75rem;
    padding: 0;
    margin-bottom: 0.85rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stock-sheet-card > .d-flex {
    display: none !important;
}

.stock-row-hidden-form {
    display: none;
}

.stock-sheet-wrap {
    --stock-item-column-width: 260px;
    max-width: 100%;
    width: 100%;
    display: block;
    overflow-x: auto;
    overflow-y: visible;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.stock-sheet-table {
    width: 100%;
    min-width: 1400px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    line-height: 1.2;
    text-align: left;
}

.stock-sheet-table th,
.stock-sheet-table td {
    border: 0 !important;
    border-bottom: 1px solid var(--slate-200, #e2e8f0) !important;
    border-left: 1px solid var(--slate-200, #e2e8f0) !important;
    color: var(--slate-800, #1e293b) !important;
}

.stock-sheet-table th:first-child,
.stock-sheet-table td:first-child {
    border-left: 0 !important;
}

.stock-sheet-table th {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 0.75rem 0.5rem;
    background: var(--slate-100, #f1f5f9) !important;
    color: var(--slate-600, #475569) !important;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    vertical-align: middle;
    cursor: grab;
}

.stock-sheet-table th.stock-dragging {
    opacity: 0.55;
}

.stock-sheet-table th.stock-drag-over {
    outline: 2px solid var(--theme-accent, #2563eb);
    outline-offset: -2px;
}

.stock-sheet-table tbody tr:hover {
    background: color-mix(in srgb, var(--theme-accent, #2563eb) 8%, transparent);
}

.stock-group-row td {
    padding: 0.5rem 1rem;
    background: var(--slate-50, #f8fafc) !important;
    color: var(--slate-700, #334155) !important;
    font-size: 0.875rem;
    font-weight: 700;
}

.stock-data-row td {
    height: 54px;
    padding: 0.5rem;
    background: #ffffff !important;
    vertical-align: middle;
}

.stock-data-row:nth-of-type(even) td {
    background: #f8fafc !important;
}

.stock-data-row:hover td {
    background: color-mix(in srgb, var(--theme-accent, #2563eb) 8%, white) !important;
}

.stock-sheet-table th[data-col="item"],
.stock-sheet-table td[data-col="item"] {
    position: sticky;
    left: 0;
    width: var(--stock-item-column-width);
    min-width: var(--stock-item-column-width);
    max-width: var(--stock-item-column-width);
    z-index: 25;
    background: #ffffff !important;
    box-shadow: 1px 0 0 var(--slate-200, #e2e8f0), 8px 0 14px rgba(15, 23, 42, 0.08);
    transform: translateZ(0);
}

.stock-sheet-table th[data-col="item"] {
    z-index: 40;
    background: var(--slate-100, #f1f5f9) !important;
    cursor: default;
}

.stock-data-row:nth-of-type(even) td[data-col="item"] {
    background: #f8fafc !important;
}

.stock-data-row:hover td[data-col="item"] {
    background: color-mix(in srgb, var(--theme-accent, #2563eb) 8%, white) !important;
}

.stock-col-item {
    width: var(--stock-item-column-width);
    max-width: var(--stock-item-column-width);
    text-align: left !important;
}

.stock-number-cell {
    width: 80px;
    max-width: 80px;
    text-align: right;
    font-family: Consolas, "Courier New", monospace;
    color: var(--slate-600, #475569) !important;
}

.stock-col-opening {
    background: rgba(245, 158, 11, 0.05) !important;
}

.stock-col-week,
.stock-sheet-table td[data-col="deliveries"] {
    background: color-mix(in srgb, var(--theme-accent, #2563eb) 5%, transparent) !important;
}

.stock-data-row:nth-of-type(even) .stock-col-week,
.stock-data-row:nth-of-type(even) td[data-col="deliveries"] {
    background: color-mix(in srgb, var(--theme-accent, #2563eb) 8%, #f8fafc) !important;
}

.stock-col-sales {
    background: rgba(168, 85, 247, 0.05) !important;
}

.stock-data-row:nth-of-type(even) .stock-col-sales {
    background: color-mix(in srgb, #a855f7 8%, #f8fafc) !important;
}

.stock-sheet-table td[data-col="theoretical"] {
    background: rgba(248, 250, 252, 0.8) !important;
}

.stock-data-row:nth-of-type(even) td[data-col="theoretical"] {
    background: #eef2f7 !important;
}

.stock-col-closing,
.stock-sheet-table td[data-col="totalItems"],
.stock-sheet-table td[data-col="itemStockValue"],
.stock-sheet-table td[data-col="openingStockValue"] {
    background: rgba(16, 185, 129, 0.05) !important;
    color: var(--emerald-800, #065f46) !important;
}

.stock-data-row:nth-of-type(even) .stock-col-closing,
.stock-data-row:nth-of-type(even) td[data-col="totalItems"],
.stock-data-row:nth-of-type(even) td[data-col="itemStockValue"],
.stock-data-row:nth-of-type(even) td[data-col="openingStockValue"] {
    background: color-mix(in srgb, #10b981 9%, #f8fafc) !important;
}

.stock-sheet-table th[data-col="sales"],
.stock-sheet-table td[data-col="sales"],
.stock-sheet-table th[data-col="theoretical"],
.stock-sheet-table td[data-col="theoretical"],
.stock-sheet-table th[data-col="closing"],
.stock-sheet-table td[data-col="closing"] {
    width: 96px;
    max-width: 96px;
}

.stock-sheet-table th[data-col="action"],
.stock-sheet-table td[data-col="action"] {
    width: 62px;
    max-width: 62px;
}

.stock-item-name {
    display: block;
    max-width: 238px;
    overflow: hidden;
    color: var(--slate-800, #1e293b);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-view span {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: var(--slate-500, #64748b);
    font-size: 0.75rem;
    line-height: 1.2;
    text-transform: uppercase;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-edit-cell {
    cursor: text;
}

.stock-item-details-cell {
    cursor: pointer;
}

.stock-item-details-cell:hover .stock-item-name {
    color: var(--theme-accent, #2563eb);
}

@media (max-width: 991.98px) {
    .stock-sheet-wrap {
        --stock-item-column-width: 190px;
    }

    .stock-col-item {
        width: var(--stock-item-column-width);
        max-width: var(--stock-item-column-width);
    }

    .stock-item-name {
        max-width: 168px;
    }

    .stock-view span {
        max-width: 168px;
    }
}

@media (max-width: 576px) {
    .stock-sheet-wrap {
        --stock-item-column-width: 168px;
    }

    .stock-col-item {
        width: var(--stock-item-column-width);
        max-width: var(--stock-item-column-width);
    }

    .stock-item-name,
    .stock-view span {
        max-width: 146px;
    }
}

.stock-editor {
    display: none !important;
}

.stock-number-cell.stock-edit-cell {
    padding: 0.25rem !important;
}

.stock-number-cell.stock-edit-cell .stock-view {
    display: none !important;
}

.stock-number-cell.stock-edit-cell .stock-editor {
    display: block !important;
}

.stock-edit-cell.is-editing .stock-view {
    display: none;
}

.stock-edit-cell.is-editing .stock-editor {
    display: block !important;
}

.stock-editor-stack {
    gap: 0.25rem;
}

.stock-edit-cell.is-editing .stock-editor-stack {
    display: grid !important;
}

.stock-sheet-table input {
    width: 100%;
    min-width: 50px;
    min-height: 0;
    height: auto;
    padding: 0.375rem 0.25rem !important;
    border: 1px solid transparent !important;
    border-radius: 0.375rem !important;
    background: transparent !important;
    color: var(--slate-800, #1e293b) !important;
    box-shadow: none !important;
    outline: none;
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.15;
    text-align: center;
    transition: all 0.2s;
}

.stock-sheet-table input:hover {
    border-color: var(--slate-300, #cbd5e1) !important;
    background: #ffffff !important;
}

.stock-sheet-table input:focus {
    border-color: var(--theme-accent, #2563eb) !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-accent, #2563eb) 20%, transparent) !important;
}

.stock-sheet-table input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.stock-row-dirty td {
    box-shadow: inset 0 2px 0 rgba(37, 99, 235, 0.18);
}

.stock-action-cell {
    width: 62px;
    max-width: 62px;
    padding: 0.25rem !important;
    text-align: center;
    white-space: nowrap;
}

.stock-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0.375rem !important;
    background: transparent !important;
    color: var(--slate-600, #475569) !important;
}

.stock-save-button {
    color: var(--theme-accent, #2563eb) !important;
}

.stock-delete-button {
    color: var(--slate-600, #475569) !important;
}

.stock-icon-button:hover,
.stock-icon-button:focus {
    background: var(--slate-100, #f1f5f9) !important;
}

.stock-product-modal .modal-content {
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
}

.stock-product-modal .modal-content > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    max-height: inherit;
}

.stock-product-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100vh - 12rem);
    max-height: calc(100dvh - 12rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--slate-50, #f8fafc);
    padding: 1.35rem 1.5rem;
}

.stock-product-modal .modal-header,
.stock-product-modal .modal-footer {
    flex: 0 0 auto;
    padding: 1.15rem 1.5rem;
}

.stock-product-modal .form-label {
    color: #344563;
    font-size: 0.82rem;
    font-weight: 700;
}

.stock-product-modal .form-control,
.stock-product-modal .form-select {
    min-height: 43px;
    border-color: #cbd7e6 !important;
    border-radius: 8px !important;
}

.stock-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.25rem;
}

.stock-summary-grid,
.stock-category-subtotal-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.stock-subtotal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.15rem 0 0.75rem;
}

.stock-subtotal-header h2 {
    margin: 0;
    color: #0f2546;
    font-size: 1rem;
    font-weight: 800;
}

.stock-value-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 128px;
    padding: 1.55rem 1.6rem;
    color: #0f2546 !important;
    background: #ffffff;
    border: 1px solid #dbe3ed;
    border-radius: 0.85rem;
    box-shadow: 0 4px 0 #c8d3df;
    text-decoration: none !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stock-value-card:hover,
.stock-value-card:focus {
    color: #0f2546 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 0 #c8d3df;
}

.stock-value-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 700;
}

.stock-value-label i {
    font-size: 1.1rem;
}

.stock-value-amount {
    color: #10213f;
    font-size: 1.85rem;
    line-height: 1;
    font-weight: 800;
}

.stock-value-text {
    overflow: hidden;
    font-size: 1.35rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-value-meta {
    margin-top: 0.65rem;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
}

.stock-report-chart-card .card-body {
    min-height: 260px;
    max-height: 320px;
}

.stock-report-chart-card canvas {
    max-height: 260px;
}

.business-calendar-card {
    padding: 1rem;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #d7dee8);
    border-radius: var(--radius-lg, 14px);
}

.business-calendar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.business-calendar-header h2 {
    margin: 0 0 0.15rem;
    font-size: 1.1rem;
    font-weight: 800;
}

.business-calendar-header p {
    margin: 0;
    color: var(--muted, #64748b);
    font-size: 0.88rem;
}

.business-calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
    gap: 0.9rem;
    align-items: start;
}

.business-calendar-weekdays,
.business-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.business-calendar-weekdays {
    border: 1px solid var(--border, #d7dee8);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.business-calendar-weekdays span {
    padding: 0.45rem;
    background: var(--bg, #f3f6fb);
    color: var(--muted, #64748b);
    font-size: 0.75rem;
    font-weight: 800;
    text-align: center;
}

.business-calendar-grid {
    border-top: 1px solid var(--border, #d7dee8);
    border-left: 1px solid var(--border, #d7dee8);
}

.business-calendar-day {
    min-height: 112px;
    padding: 0.4rem;
    background: #ffffff;
    border-right: 1px solid var(--border, #d7dee8);
    border-bottom: 1px solid var(--border, #d7dee8);
}

.business-calendar-day-empty {
    background: #f8fafc;
}

.business-calendar-day.is-today {
    box-shadow: inset 0 0 0 2px var(--primary, #0d6efd);
}

.business-calendar-day-number {
    margin-bottom: 0.3rem;
    color: var(--text, #0f172a);
    font-size: 0.78rem;
    font-weight: 800;
}

.business-calendar-empty-note {
    color: #94a3b8;
    font-size: 0.72rem;
}

.business-calendar-events {
    display: grid;
    gap: 0.25rem;
}

.business-calendar-event,
.business-calendar-upcoming-item {
    color: var(--text, #0f172a);
    text-decoration: none;
}

.business-calendar-event {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    padding: 0.22rem 0.28rem;
    border-left: 3px solid currentColor;
    border-radius: 5px;
    background: #f8fafc;
    font-size: 0.72rem;
    line-height: 1.15;
}

.business-calendar-event span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.business-calendar-more {
    color: var(--muted, #64748b);
    font-size: 0.7rem;
    font-weight: 700;
}

.business-calendar-upcoming {
    padding: 0.75rem;
    border: 1px solid var(--border, #d7dee8);
    border-radius: 10px;
    background: #ffffff;
}

.business-calendar-upcoming h3 {
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
    font-weight: 800;
}

.business-calendar-upcoming-list {
    display: grid;
    gap: 0.5rem;
}

.business-calendar-upcoming-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.55rem;
    border: 1px solid #e2e8f0;
    border-left: 4px solid currentColor;
    border-radius: 8px;
    background: #f8fafc;
}

.business-calendar-upcoming-date {
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: #ffffff;
    line-height: 1.05;
}

.business-calendar-upcoming-date strong {
    font-size: 1rem;
}

.business-calendar-upcoming-date span,
.business-calendar-upcoming-meta {
    color: var(--muted, #64748b);
    font-size: 0.72rem;
}

.business-calendar-upcoming-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.84rem;
    font-weight: 800;
}

.business-calendar-upcoming-meta {
    margin-top: 0.2rem;
    line-height: 1.25;
}

.business-calendar-upcoming-empty {
    color: var(--muted, #64748b);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem 0.5rem;
}

.business-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.8rem;
    margin-top: 0.8rem;
}

.business-calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.76rem;
    font-weight: 800;
}

.event-rooms { color: #2563eb; }
.event-maintenance { color: #ef4444; }
.event-laundry { color: #06b6d4; }
.event-stock { color: #10b981; }
.event-staff { color: #f59e0b; }
.event-lost { color: #8b5cf6; }
.event-purchase { color: #0f766e; }
.event-invoice { color: #64748b; }

.stock-value-neutral .stock-value-label i {
    color: #1f2d3d;
}

.stock-value-breakfast {
    box-shadow: 0 4px 0 #c8d3df;
}

.stock-value-breakfast .stock-value-label,
.stock-value-breakfast .stock-value-label i {
    color: #f59f00;
}

.stock-value-food {
    box-shadow: 0 4px 0 #20c997;
}

.stock-value-food .stock-value-label,
.stock-value-food .stock-value-label i {
    color: #00a878;
}

.stock-value-beverages .stock-value-label,
.stock-value-beverages .stock-value-label i {
    color: #3f7cff;
}

.stock-value-maintenance .stock-value-label,
.stock-value-maintenance .stock-value-label i {
    color: #dc3545;
}

.stock-health-card {
    padding: 1.75rem 1.65rem 1.55rem;
    background: #ffffff;
    border: 1px solid #dbe3ed;
    border-radius: 0.85rem;
}

.stock-health-card h2 {
    margin: 0 0 1.35rem;
    color: #0f2546;
    font-size: 1.45rem;
    font-weight: 800;
}

.stock-health-panel {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    min-height: 110px;
    padding: 1.45rem 1.5rem;
    border: 1px solid #0c7a5a;
    border-radius: 0.85rem;
    background: #e9fbf3;
    color: #0c6b50;
}

.stock-health-panel i {
    flex: 0 0 auto;
    font-size: 2.4rem;
}

.stock-health-value {
    margin-bottom: 0.35rem;
    font-size: 1.35rem;
    font-weight: 800;
}

.stock-health-copy {
    font-size: 1.05rem;
}

.stock-health-positive {
    border-color: #0c7a5a;
    background: #e9fbf3;
    color: #0c6b50;
}

.stock-health-alert {
    border-color: #b42318;
    background: #fff0ee;
    color: #9f1f17;
}

.stock-category-card {
    padding: 1.35rem;
    background: #ffffff;
    border: 1px solid #dbe3ed;
    border-radius: 0.55rem;
    box-shadow: 0 2px 6px rgba(15, 33, 63, 0.06);
}

.stock-category-card h2 {
    margin: 0 0 1.1rem;
    color: #0f2546;
    font-size: 1rem;
    font-weight: 800;
}

.stock-category-add-row,
.stock-category-name-form,
.stock-subcategory-add-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(130px, 0.52fr);
    gap: 1rem;
    align-items: end;
}

.stock-category-list {
    display: grid;
    gap: 0.8rem;
    margin-top: 1.25rem;
}

.stock-category-item {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid #d4deea;
    border-radius: 0.65rem;
}

.stock-category-delete-form {
    margin-left: calc(50% + 0.5rem);
}

.stock-category-delete-form .btn {
    width: 100%;
}

.stock-subcategory-add-form {
    grid-template-columns: minmax(0, 1fr) 84px;
}

.stock-subcategory-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.stock-subcategory-tags form {
    margin: 0;
}

.stock-subcategory-tag {
    padding: 0.35rem 0.65rem;
    color: #0f2546;
    background: #f3f6fa;
    border: 1px solid #dbe3ed;
    border-radius: 0.45rem;
    font-size: 0.88rem;
    line-height: 1.1;
}

.stock-subcategory-tag:hover,
.stock-subcategory-tag:focus {
    background: #e8eef6;
}

.stock-freeze-first-column-wrap {
    overflow-x: auto !important;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.stock-freeze-first-column {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    min-width: 560px;
}

.stock-freeze-first-column th:first-child,
.stock-freeze-first-column td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 5 !important;
    width: 210px;
    min-width: 210px;
    max-width: 210px;
    background: #ffffff !important;
    box-shadow: 1px 0 0 #dbe3ed, 10px 0 16px rgba(15, 33, 63, 0.12);
    transform: translateZ(0);
}

.stock-freeze-first-column thead th:first-child {
    z-index: 9 !important;
    background: #f8fafc !important;
}

.stock-freeze-first-column tbody tr:hover td:first-child {
    background: #f3f7fb !important;
}

.stock-take-table {
    min-width: 430px;
}

.stock-take-table th,
.stock-take-table td {
    padding: 0.55rem 0.6rem;
}

.stock-take-table th:first-child,
.stock-take-table td:first-child {
    width: 230px;
    min-width: 230px;
    max-width: 230px;
}

.stock-take-table .counted-boxes,
.stock-take-table .counted-unboxed {
    min-width: 74px;
    max-width: 90px;
    min-height: 36px;
    padding: 0.35rem 0.45rem;
    font-size: 0.95rem;
    text-align: center;
}

.stock-take-table td:first-child .fw-semibold {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-take-table td:first-child .small {
    display: block;
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .stock-freeze-first-column th:first-child,
    .stock-freeze-first-column td:first-child {
        width: 170px;
        min-width: 170px;
        max-width: 170px;
    }

    .stock-take-table {
        min-width: 360px;
        font-size: 0.82rem;
    }

    .stock-take-table th,
    .stock-take-table td {
        padding: 0.35rem 0.35rem;
    }

    .stock-take-table th:first-child,
    .stock-take-table td:first-child {
        width: 156px;
        min-width: 156px;
        max-width: 156px;
    }

    .stock-take-table th:not(:first-child),
    .stock-take-table td:not(:first-child) {
        width: 82px;
        min-width: 82px;
        max-width: 82px;
    }

    .stock-take-table .counted-boxes,
    .stock-take-table .counted-unboxed {
        min-width: 62px;
        max-width: 72px;
        min-height: 30px;
        padding: 0.2rem 0.25rem;
        border-radius: 0.35rem;
        font-size: 0.88rem;
    }

    .stock-take-table td:first-child .fw-semibold {
        font-size: 0.8rem;
        line-height: 1.12;
    }

    .stock-take-table td:first-child .small {
        margin-top: 1px;
        font-size: 0.66rem;
        line-height: 1.1;
    }
}

@media (max-width: 420px) {
    .stock-take-table {
        min-width: 330px;
    }

    .stock-take-table th:first-child,
    .stock-take-table td:first-child {
        width: 142px;
        min-width: 142px;
        max-width: 142px;
    }

    .stock-take-table th:not(:first-child),
    .stock-take-table td:not(:first-child) {
        width: 74px;
        min-width: 74px;
        max-width: 74px;
    }
}

@media (max-width: 767.98px) {
    .stock-dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .stock-value-card {
        min-height: 112px;
        padding: 1.25rem;
    }

    .stock-value-amount {
        font-size: 1.55rem;
    }

    .stock-health-panel {
        align-items: flex-start;
        padding: 1.15rem;
    }

    .stock-health-card h2 {
        font-size: 1.2rem;
    }

    .stock-category-add-row,
    .stock-category-name-form,
    .stock-subcategory-add-form {
        grid-template-columns: 1fr;
    }

    .stock-category-delete-form {
        margin-left: 0;
    }

    .business-calendar-card {
        padding: 0.75rem;
    }

    .business-calendar-header {
        flex-direction: column;
    }

    .business-calendar-layout {
        grid-template-columns: 1fr;
    }

    .business-calendar-weekdays span {
        padding: 0.35rem 0.2rem;
        font-size: 0.68rem;
    }

    .business-calendar-day {
        min-height: 86px;
        padding: 0.28rem;
    }

    .business-calendar-event {
        font-size: 0.66rem;
    }
}

@media (max-width: 991.98px) {
    .app-body .app-row {
        height: 100%;
        display: block;
    }

    .app-body .app-main {
        height: 100%;
        min-height: 0;
        max-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        padding-bottom: 5.75rem !important;
    }
}
