/* SuperMart POS System - Custom Styles */

:root {
    --primary-color: #1f4e5f;    /* Hotel navy */
    --secondary-color: #2d6a73;  /* Teal slate */
    --tertiary-color: #b14d4d;   /* Muted red */
    --quaternary-color: #c4a458; /* Gold accent */
    --success-color: #2f7a63;
    --danger-color: #b14d4d;
    --warning-color: #c4a458;
    --info-color: #3f7f8c;
    --light-color: #f4f7f6;
    --dark-color: #18333f;
    --surface-color: #ffffff;
    --surface-muted: #eef4f3;
    --border-color: #d6e1de;
    --text-color: #2f3f46;
    --sidebar-width: 280px;
    --navbar-height: 60px;
    
    /* Bootstrap Color Overrides */
    --bs-primary: #1f4e5f;
    --bs-secondary: #2d6a73;
    --bs-success: #2f7a63;
    --bs-danger: #b14d4d;
    --bs-warning: #c4a458;
    --bs-info: #3f7f8c;
    --bs-light: #f4f7f6;
    --bs-dark: #18333f;
    --bs-primary-rgb: 31, 78, 95;
    --bs-secondary-rgb: 45, 106, 115;
    --bs-success-rgb: 47, 122, 99;
    --bs-info-rgb: 63, 127, 140;
    --bs-warning-rgb: 196, 164, 88;
    --bs-danger-rgb: 177, 77, 77;
    --bs-light-rgb: 244, 247, 246;
    --bs-body-bg: #f4f7f6;
    --bs-body-color: #2f3f46;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--text-color);
    overflow-x: hidden;
}

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

/* Bootstrap Color Overrides */
.btn-primary {
    --bs-btn-bg: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-bg: #173d4a;
    --bs-btn-hover-border-color: #173d4a;
    --bs-btn-active-bg: #14343f;
    --bs-btn-active-border-color: #14343f;
}

.btn-secondary {
    --bs-btn-bg: var(--secondary-color);
    --bs-btn-border-color: var(--secondary-color);
    --bs-btn-hover-bg: #24545c;
    --bs-btn-hover-border-color: #24545c;
    --bs-btn-active-bg: #1e454c;
    --bs-btn-active-border-color: #1e454c;
}

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

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

.text-primary {
    color: var(--primary-color) !important;
}

.navbar-brand {
    color: white !important;
    font-weight: bold;
    font-size: 1.5rem;
}

/* Dashboard Cards */
.dashboard-card {
    transition: transform 0.2s ease-in-out;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.stat-card {
    color: white;
    border-radius: 10px;
}

.stat-card.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #173d4a 100%);
}

.stat-card.secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #24545c 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, var(--tertiary-color) 0%, #8f3f3f 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--quaternary-color) 0%, #a78b4a 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2f6572 100%);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white !important;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #24545c 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-body {
    padding: 2rem;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.product-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: white;
    transition: all 0.2s ease;
    cursor: pointer;
}

.product-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-card.selected {
    border-color: var(--primary-color);
    background-color: rgba(var(--bs-primary-rgb), 0.08);
}

.product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.product-name {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.product-price {
    color: var(--success-color);
    font-size: 1.1rem;
    font-weight: bold;
}

.product-stock {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.low-stock {
    color: var(--danger-color);
    font-weight: bold;
}

/* Sales Cart */
.cart-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.cart-item {
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-total {
    background: var(--light-color);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

/* Receipt Styles */
.receipt {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: 'Courier New', monospace;
    max-width: 400px;
    margin: 0 auto;
}

.receipt-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.receipt-total {
    border-top: 2px solid #000;
    padding-top: 1rem;
    margin-top: 1rem;
    font-weight: bold;
}

/* Tables */
.table-responsive {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    -webkit-overflow-scrolling: touch;
}

.table {
    background: white;
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
}

.btn-group {
    flex-wrap: wrap;
    gap: 0.35rem;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
}

.btn-primary:hover {
    background: #173d4a;
}

/* Forms */
.form-control {
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.form-control,
.form-select,
.btn {
    min-height: 42px;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.2);
}

/* Charts */
.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.chart-container canvas {
    width: 100% !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        margin: 1rem;
    }

    .receipt {
        padding: 1rem;
    }
}

/* Product List Styles */
.product-img-container {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--surface-muted);
    border-radius: 4px;
    overflow: hidden;
}

.product-img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.stock-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-progress-container {
    flex-grow: 1;
}

.stock-badge {
    min-width: 36px;
    text-align: center;
    font-weight: 500;
}

/* Hover effects */
.table-hover tbody tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.06);
}

/* Action buttons */
.btn-action {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 1px;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Sidebar Layout Styles */
.sidebar-layout {
    padding-top: var(--navbar-height);
}

.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    height: calc(100vh - var(--navbar-height));
    width: var(--sidebar-width);
    background: var(--surface-color) !important;
    color: var(--text-color);
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-muted);
}

.sidebar-header h5 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-menu {
    padding: 1rem 0;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #72858d;
    letter-spacing: 0.5px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #445860;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background-color: var(--surface-muted);
    color: var(--primary-color);
    text-decoration: none;
}

.sidebar-item.active {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.sidebar-item i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Sidebar: collapsible hotel group & nested links */
.sidebar-collapse-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.65rem 1rem;
    margin: 0 0 0.25rem 0;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    color: #445860;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-collapse-toggle:hover {
    background-color: var(--surface-muted);
    color: var(--primary-color);
}

.sidebar-collapse-toggle-label {
    display: flex;
    align-items: center;
}

.sidebar-collapse-toggle-label i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.sidebar-collapse-chevron {
    font-size: 0.85rem;
    opacity: 0.55;
    transition: transform 0.2s ease;
}

.sidebar-collapse-toggle.collapsed .sidebar-collapse-chevron {
    transform: rotate(-90deg);
}

.sidebar-nested {
    padding: 0.25rem 0 0.5rem 0;
    border-left: 2px solid var(--border-color);
    margin-left: 1rem;
}

.sidebar-nested-label {
    padding: 0.5rem 1rem 0.25rem 1rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8aa0a7;
}

.sidebar-item-nested {
    padding-left: 0.85rem;
    font-size: 0.9rem;
}

.sidebar-item-nested i {
    font-size: 1rem;
}

.sidebar-item-nested.active {
    font-weight: 500;
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
    background-color: var(--light-color);
    transition: margin-left 0.3s ease;
    overflow-x: hidden;
}

/* Desktop: hamburger collapses sidebar + full-width main */
@media (min-width: 769px) {
    .sidebar-layout #sidebar.sidebar,
    .sidebar-layout .sidebar {
        transform: translateX(0);
    }

    .sidebar-layout.sidebar-collapsed #sidebar.sidebar,
    .sidebar-layout.sidebar-collapsed .sidebar {
        transform: translateX(-100%) !important;
        box-shadow: none;
    }

    .sidebar-layout.sidebar-collapsed .main-content {
        margin-left: 0 !important;
    }
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* Navbar Adjustments */
.navbar {
    height: var(--navbar-height);
    z-index: 1001;
}

.navbar-brand {
    max-width: 45vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar .dropdown-toggle {
    max-width: 42vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile: drawer closed by default; body.sidebar-open reveals it */
/* ═══════════════════════════════════════════════════════
   RESPONSIVE LAYOUT – Mobile-first overhaul
   ═══════════════════════════════════════════════════════ */

/* ── Typography scale ───────────────────────────────── */
@media (max-width: 768px) {
    h1, .h1 { font-size: 1.4rem; line-height: 1.25; }
    h2, .h2 { font-size: 1.2rem; }
    h3, .h3 { font-size: 1.05rem; }
    h4, .h4 { font-size: 0.975rem; }
    h5, .h5 { font-size: 0.9rem; }
}

/* ── Sidebar + layout ───────────────────────────────── */
@media (max-width: 768px) {
    .sidebar-layout #sidebar.sidebar,
    .sidebar-layout .sidebar {
        transform: translateX(-100%) !important;
    }

    .sidebar-layout.sidebar-open #sidebar.sidebar,
    .sidebar-layout.sidebar-open .sidebar {
        transform: translateX(0) !important;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 0.9rem;
    }

    .sidebar-layout .main-content,
    .sidebar-layout.sidebar-collapsed .main-content {
        margin-left: 0;
    }

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

    .dashboard-card {
        margin-bottom: 1rem;
    }

    .card,
    .chart-container,
    .receipt,
    .cart-container {
        border-radius: 0.6rem;
    }

    .card-body {
        padding: 0.9rem;
    }

    .table {
        font-size: 0.88rem;
    }

    .btn-group {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-group.btn-group-qty {
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        width: auto !important;
    }

    .btn-group.btn-group-qty .btn {
        width: auto !important;
        margin-bottom: 0 !important;
    }

    .btn-group.btn-group-actions {
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        width: auto !important;
    }

    .btn-group.btn-group-actions .btn {
        width: auto !important;
        margin-bottom: 0 !important;
    }

    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
        width: 100%;
    }

    .btn,
    .form-control,
    .form-select,
    .input-group-text {
        font-size: 0.95rem;
    }

    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }

    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        max-width: calc(100vw - 1rem);
        width: auto;
    }

    .navbar-brand {
        font-size: 1rem;
        max-width: 40vw;
    }

    .navbar .dropdown-toggle {
        max-width: 32vw;
        font-size: 0.82rem;
        padding: 0.35rem 0.5rem;
    }

    /* Card headers that hold search + controls wrap gracefully */
    .card-header > .d-flex {
        flex-wrap: wrap;
    }

    /* Nav tabs scroll horizontally instead of wrapping */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar { display: none; }
    .nav-tabs .nav-item { white-space: nowrap; }
    .nav-tabs .nav-link { white-space: nowrap; }
}

/* ── Page action header (.page-action-header) ─────────
   Usage: add class to the d-flex justify-content-between
   row that holds an h1 + a primary action button.        */
@media (max-width: 576px) {
    .page-action-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }
    .page-action-header > .btn,
    .page-action-header > a.btn,
    .page-action-header > div > .btn {
        width: 100%;
        text-align: center;
    }
}

/* ── Table: opt-in card layout (.table-cards) ─────────
   Add class="... table-cards" to <table> and
   data-label="Column Name" to every <td>.               */
@media (max-width: 576px) {
    .table-cards thead {
        display: none !important;
    }

    .table-cards,
    .table-cards tbody,
    .table-cards tr,
    .table-cards td {
        display: block !important;
        width: 100%;
    }

    .table-cards tr {
        margin-bottom: 0.6rem;
        border: 1px solid var(--border-color);
        border-radius: 0.4rem;
        background: var(--surface-color);
        overflow: hidden;
    }

    .table-cards td {
        text-align: right;
        padding: 0.45rem 0.75rem 0.45rem 50%;
        position: relative;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
        min-height: 2.1rem;
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
    }

    .table-cards td:last-child {
        border-bottom: none !important;
    }

    .table-cards td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.75rem;
        width: 44%;
        text-align: left;
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--text-color);
        opacity: 0.65;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* First cell = row header */
    .table-cards td:first-child {
        background-color: var(--surface-muted);
        font-weight: 600;
        text-align: left;
        padding-left: 0.75rem;
        justify-content: flex-start;
    }

    .table-cards td:first-child::before {
        display: none;
    }

    /* Action cells span full row */
    .table-cards td.td-actions {
        text-align: left;
        padding-left: 0.75rem;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.35rem;
        background: rgba(0, 0, 0, 0.015);
    }

    .table-cards td.td-actions::before {
        display: none;
    }

    /* Pagination bar inside cards tables stays normal */
    .table-cards + .card-footer {
        display: flex;
    }
}

/* ── Utility: sidebar 100% width on tiny phones ─────── */
@media (max-width: 576px) {
    .sidebar {
        width: 100%;
    }

    .main-content {
        padding: 0.75rem;
    }

    .container,
    .container-fluid {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    /* Hide less important columns on very small screens */
    .d-none-xs {
        display: none !important;
    }

    .navbar .dropdown-toggle {
        max-width: 36vw;
    }

    .navbar-brand {
        max-width: 44vw;
    }

    .sidebar-item {
        padding: 0.72rem 0.9rem;
    }

    .sidebar-section {
        margin-bottom: 1rem;
    }

    /* Filter forms: action buttons full-width on xs */
    .filter-form-actions {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }
    .filter-form-actions .btn {
        width: 100%;
    }
}

/* Super Admin dashboard — compact KPIs and readable panels */
.super-admin-dashboard .super-admin-stat-card .card-body {
    padding: 0.75rem 0.85rem;
}

.super-admin-dashboard .super-admin-kpi-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5c6f76;
    line-height: 1.2;
}

.super-admin-dashboard .super-admin-kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.15;
    margin-top: 0.2rem;
}

.super-admin-dashboard .super-admin-kpi-value--currency {
    font-size: 1.15rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.super-admin-dashboard .super-admin-panel-header {
    font-weight: 600;
    font-size: 0.95rem;
    padding-top: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.super-admin-dashboard .super-admin-tenant-list .list-group-item + .list-group-item {
    border-top: 1px solid var(--border-color) !important;
}

.super-admin-dashboard .super-admin-tenant-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fff;
    font-weight: 600;
    border-bottom-width: 1px;
    border-color: rgba(255, 255, 255, 0.12);
}

.super-admin-dashboard .super-admin-activity-list .list-group-item + .list-group-item {
    border-top: 1px solid var(--border-color) !important;
}

.super-admin-dashboard .super-admin-activity-time {
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
}

@media (min-width: 768px) {
    .super-admin-dashboard .super-admin-stat-card .card-body {
        padding: 1rem 1.1rem;
    }

    .super-admin-dashboard .super-admin-kpi-label {
        font-size: 0.7rem;
    }

    .super-admin-dashboard .super-admin-kpi-value {
        font-size: 1.5rem;
        margin-top: 0.35rem;
    }

    .super-admin-dashboard .super-admin-kpi-value--currency {
        font-size: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .super-admin-dashboard .super-admin-stat-card .card-body {
        padding: 0.65rem 0.7rem;
    }

    .super-admin-dashboard .super-admin-kpi-value {
        font-size: 1.2rem;
    }

    .super-admin-dashboard .super-admin-kpi-value--currency {
        font-size: 1.05rem;
    }

    .super-admin-dashboard .super-admin-panel .card-header {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .super-admin-dashboard .super-admin-tenant-list .list-group-item,
    .super-admin-dashboard .super-admin-activity-list .list-group-item {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }
}

/* Super Admin — mobile / small screens */
.super-admin-layout .navbar > .container-fluid {
    min-width: 0;
}

.super-admin-layout .super-admin-navbar-brand {
    min-width: 0;
}

.super-admin-layout .super-admin-nav-user {
    max-width: min(42vw, 14rem);
}

.super-admin-layout .super-admin-back-btn {
    width: 100%;
}

@media (min-width: 576px) {
    .super-admin-layout .super-admin-back-btn {
        width: auto !important;
    }
}

.super-admin-layout .main-content {
    max-width: 100vw;
    box-sizing: border-box;
}

.super-admin-layout .table-responsive {
    -webkit-overflow-scrolling: touch;
}

.super-admin-layout .tenant-status-select {
    min-width: 8rem;
    max-width: 100%;
}

.super-admin-layout .list-group-item .small,
.super-admin-layout .list-group-item.text-muted {
    word-break: break-word;
}

.super-admin-layout .card-header.d-flex {
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .super-admin-layout .card-header.d-flex.justify-content-between {
        justify-content: flex-start !important;
    }

    .super-admin-layout table .d-flex.gap-1,
    .super-admin-layout table .d-flex.gap-2 {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
    }

    .super-admin-layout table .d-flex.gap-1 .btn,
    .super-admin-layout table .d-flex.gap-2 .btn,
    .super-admin-layout table .d-flex.gap-2 .form-select {
        width: 100%;
        max-width: 100%;
    }

    .super-admin-layout .card-footer.d-flex {
        flex-direction: column;
        align-items: stretch !important;
    }

    .super-admin-layout .card-footer.d-flex form {
        width: 100%;
    }

    .super-admin-layout .card-footer.d-flex .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .super-admin-layout .navbar-brand {
        font-size: 0.92rem;
    }

    .super-admin-layout .plans-form-actions {
        flex-direction: column !important;
    }

    .super-admin-layout .plans-form-actions .btn,
    .super-admin-layout .plans-form-actions a {
        width: 100%;
    }
}

/* Print Styles */
@media print {

    .navbar,
    .sidebar,
    .no-print,
    .sidebar-overlay {
        display: none !important;
    }

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

    .container-fluid {
        margin: 0 !important;
        padding: 0 !important;
    }

    .receipt {
        width: 100% !important;
        max-width: none !important;
        box-shadow: none !important;
        border: none !important;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Status Badges */
.status-active {
    background-color: var(--success-color);
}

.status-inactive {
    background-color: var(--secondary-color);
}

.status-low-stock {
    background-color: var(--danger-color);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #e3ecea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #173d4a;
}

/* ═══════════════════════════════════════════════════════
   SYSTEM-WIDE MOBILE ENHANCEMENTS
   ═══════════════════════════════════════════════════════ */

/* ── Long words and overflow prevention ──────────────── */
.table td, .table th,
.list-group-item,
.card-body p,
.badge {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ── Analytics / Reports card grid ───────────────────── */
@media (max-width: 576px) {
    /* Report KPI cards: 2 per row on small phones */
    .row.g-3 > [class*="col-xl-3"].col-md-6,
    .row.g-4 > [class*="col-xl-3"].col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ── Analytics modal on mobile ───────────────────────── */
@media (max-width: 768px) {
    /* Push analytics modal chart area up to be scrollable */
    #analyticsModal .modal-body,
    #hotelAnalyticsModal .modal-body {
        max-height: 75vh;
        overflow-y: auto;
    }

    /* Drill-down drawer takes full width */
    #analyticsModal .evidence-drawer,
    #hotelAnalyticsModal .evidence-drawer {
        flex-direction: column !important;
        min-width: 0 !important;
        width: 100% !important;
    }
}

/* ── Pagination controls responsive ─────────────────── */
@media (max-width: 576px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.2rem;
    }
    .pagination .page-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* ── Input groups and filter bars ───────────────────── */
@media (max-width: 576px) {
    .input-group {
        flex-wrap: wrap;
    }
    .input-group .form-control,
    .input-group .form-select,
    .input-group .btn {
        flex: 1 0 100%;
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
    .input-group .input-group-text {
        border-radius: 0.375rem !important;
    }
}

/* ── Card header with search + page-size controls ───── */
@media (max-width: 576px) {
    .card-header .d-flex.gap-2 {
        flex-wrap: wrap;
    }
    .card-header input[type="search"],
    .card-header input[type="text"] {
        width: 100%;
        min-width: 0;
    }
}

/* ── Long flex rows with justify-content-between ─────── */
@media (max-width: 576px) {
    .d-flex.justify-content-between.align-items-center {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ── Receipts list on mobile ─────────────────────────── */
@media (max-width: 576px) {
    .receipts-range-bar {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .receipts-range-col {
        width: 100% !important;
    }
    .receipts-range-input {
        width: 100% !important;
    }
}

/* ── List-group item actions ─────────────────────────── */
@media (max-width: 576px) {
    .list-group-item .d-flex.gap-2 {
        flex-wrap: wrap;
    }
    .list-group-item .btn {
        flex: 1 0 auto;
    }
}