:root {
    --bg: #f5f7fb;
    --bg-alt: #eef4ff;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.92);
    --border: rgba(148, 163, 184, 0.22);
    --text: #0f172a;
    --muted: #64748b;
    --primary: #0f766e;
    --primary-strong: #115e59;
    --brand-blue: #11439b;
    --brand-blue-hover: #0d357a;
    --accent: #f59e0b;
    --accent-2: #fb7185;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    --radius-xl: 24px;
    --radius-lg: 18px;

}

[data-theme="dark"] {
    --bg: #07111e;
    --bg-alt: #0f172a;
    --surface: rgba(15, 23, 42, 0.72);
    --surface-strong: rgba(15, 23, 42, 0.94);
    --border: rgba(148, 163, 184, 0.14);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --shadow: 0 20px 60px rgba(2, 6, 23, 0.5);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 28%),
        radial-gradient(circle at right top, rgba(17, 94, 89, 0.18), transparent 26%),
        linear-gradient(180deg, var(--bg-alt), var(--bg));
    color: var(--text);
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

body {
    margin: 0;
}

a {
    text-decoration: none;
}

.glass-card,
.card,
.dataTables_wrapper .dataTables_scroll,
.dataTables_wrapper .table,
.dataTables_wrapper .dataTables_paginate {
    /* Use stronger surface so dropdown is not transparent */
    background: var(--surface-strong) !important;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    backdrop-filter: none;
}

.dropdown-menu.glass-dropdown {
    background: #ffffff !important;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    backdrop-filter: none;
}

.glass-modal {
    background: #ffffff !important;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    backdrop-filter: none;
}

[data-theme="dark"] .glass-modal {
    background: #0f172a !important;
}

/* Ensure dropdown text is readable in light theme even when using
   Bootstrap's `dropdown-menu-dark` helper together with our glass dropdown */
.dropdown-menu.glass-dropdown,
.dropdown-menu.glass-dropdown .dropdown-item,
.dropdown-menu.glass-dropdown .dropdown-item-text {
    color: var(--text) !important;
}

/* Improve compactness and visual weight of profile dropdown */
.dropdown-menu.glass-dropdown {
    min-width: 180px;
    max-width: 260px;
    padding: 0.35rem 0.25rem;
    border-radius: 12px;
    right: 0 !important;
    z-index: 1200;
}

.dropdown-menu.glass-dropdown .dropdown-item,
.dropdown-menu.glass-dropdown .dropdown-item-text {
    padding: 0.6rem 1rem;
    border-radius: 8px;
}

.dropdown-menu.glass-dropdown .dropdown-item:hover,
.dropdown-menu.glass-dropdown .dropdown-item:focus {
    background: rgba(17, 67, 155, 0.06);
    color: var(--text) !important;
}

/* Ensure icon + text layout and visibility */
.dropdown-menu.glass-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text) !important;
}

.dropdown-menu.glass-dropdown .dropdown-item .bi {
    font-size: 1.05rem;
    opacity: 0.9;
    min-width: 20px;
}

.dropdown-menu.glass-dropdown .dropdown-item-text {
    display: block;
    color: var(--muted) !important;
    font-size: 0.95rem;
}

/* Make sure the dropdown overlays above other UI elements */
.dropdown-menu.glass-dropdown {
    z-index: 1400;
}

/* Preserve intended dark theme dropdown colors */
[data-theme="dark"] .dropdown-menu.glass-dropdown,
[data-theme="dark"] .dropdown-menu.glass-dropdown .dropdown-item,
[data-theme="dark"] .dropdown-menu.glass-dropdown .dropdown-item-text {
    color: #e2e8f0 !important;
}

.app-shell {
    overflow-x: hidden;
}

.app-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 1040;
}

.app-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.du-management-page .du-hero,
.du-management-page .du-form-panel,
.du-management-page .du-stat-card,
.du-management-page .du-summary-card,
.du-management-page .du-card,
.du-management-page .du-assignment-card,
.du-management-page .du-empty-state,
.du-management-page .du-toolbar {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 24px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.du-management-page .du-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.du-management-page .du-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.du-management-page .du-card-actions {
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    margin-top: auto;
}


.du-management-page .du-chip-wrap,
.du-management-page .du-mini-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.du-management-page .du-chip,
.du-management-page .du-mini-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(17, 67, 155, 0.08);
    color: #0f172a;
    border: 1px solid rgba(17, 67, 155, 0.14);
    font-size: 0.9rem;
}

.du-management-page .du-mini-chip {
    background: rgba(15, 118, 110, 0.08);
    border-color: rgba(15, 118, 110, 0.14);
}

.du-management-page .du-toggle {
    min-width: 84px;
}

.du-management-page .du-status-pill {
    padding-left: 2.8rem;
}

.du-management-page .du-nozzle-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.du-management-page .du-assignment-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
}

.du-management-page .du-assignment-card .form-control[type="text"],
.du-management-page .du-nozzle-num-input {
    font-size: 0.82rem;
    letter-spacing: 0;
    min-width: 0;
    padding-left: 0.65rem;
    padding-right: 0.4rem;
}

.du-management-page .du-fuel-preview {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}

.du-management-page .du-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.du-management-page .du-empty-icon {
    width: 74px;
    height: 74px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent);
    margin-bottom: 1rem;
}

.du-management-page .du-tip-card {
    border-radius: 18px;
    padding: 1rem;
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.14);
}

.du-management-page .form-control,
.du-management-page .form-select,
.du-sheets-shell .form-control,
.du-sheets-shell .form-select {
    min-height: 48px;
    border-radius: 14px;
}

.du-management-page .form-control:focus,
.du-management-page .form-select:focus,
.du-sheets-shell .form-control:focus,
.du-sheets-shell .form-select:focus {
    border-color: rgba(17, 67, 155, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(17, 67, 155, 0.08);
}

.du-management-page .du-record-summary .du-summary-card {
    background: linear-gradient(135deg, rgba(17, 67, 155, 0.08), rgba(15, 118, 110, 0.08));
}

.du-management-loading .du-card,
.du-management-loading .du-assignment-card,
.du-management-loading .du-form-panel {
    opacity: 0.82;
    pointer-events: none;
}

@media (max-width: 991.98px) {

    .du-management-page .du-grid,
    .du-management-page .du-nozzle-grid {
        grid-template-columns: 1fr;
    }
}

.app-frame {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    background: linear-gradient(180deg, rgba(3, 7, 18, 0.96), rgba(15, 23, 42, 0.94));
    color: #fff;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.sidebar-logo,
.brand-mark,
.avatar-circle,
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo,
.brand-mark {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.34);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 1px;
    /* Gives the logo breathing room inside its beautiful rounded container */
}

.sidebar-brand-simple {
    padding: 0.35rem 0.2rem 0.9rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

.sidebar-brand-tagline {
    color: rgba(226, 232, 240, 0.64);
    font-size: 0.95rem;
    line-height: 1.35;
    margin-top: 0.12rem;
}

.sidebar-nav .sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    color: rgba(226, 232, 240, 0.85);
    border-radius: 16px;
    transition: all 0.22s ease;
    margin-bottom: 0.35rem;
}

.app-sidebar .nav-label {
    color: rgba(203, 213, 225, 0.52) !important;
}

.sidebar-nav .sidebar-link:hover,
.sidebar-nav .sidebar-link.active {
    background: rgba(245, 158, 11, 0.16);
    color: #fff;
    transform: translateX(4px);
}

/* Sidebar Accordion / Expandable Submenus */
.sidebar-group-wrapper {
    margin-bottom: 0.5rem;
}

.sidebar-group-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    color: rgba(226, 232, 240, 0.85);
    border-radius: 16px;
    transition: all 0.22s ease;
    cursor: pointer;
    user-select: none;
}

.sidebar-group-trigger:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.sidebar-group-trigger.active-parent {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 600;
}

.sidebar-group-trigger .chevron-icon {
    font-size: 0.85rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.sidebar-group-trigger.is-open .chevron-icon {
    transform: rotate(90deg);
    opacity: 1;
}

.sidebar-submenu-container {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding 0.25s ease;
    padding-left: 1.25rem;
    padding-right: 0.5rem;
    margin-top: 0.15rem;
}

.sidebar-submenu-container.is-open {
    max-height: 800px;
    opacity: 1;
    padding-bottom: 0.25rem;
    overflow: visible;
}

.sidebar-submenu-container .sidebar-link {
    padding: 0.7rem 1rem;
    border-radius: 12px;
    white-space: nowrap;
}

.sidebar-help-box {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.35);
    padding: 0.9rem 1rem;
    color: rgba(226, 232, 240, 0.7);
    line-height: 1.45;
}

.app-main {
    min-width: 0;
}

.app-content {
    min-width: 0;
    overflow-x: hidden;
}

.app-navbar {
    min-height: 84px;
    background: rgba(255, 255, 255, 0.58);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

[data-theme="dark"] .app-navbar {
    background: rgba(15, 23, 42, 0.72);
}

[data-theme="dark"] .app-navbar .navbar-brand,
[data-theme="dark"] .app-navbar .navbar-brand .fw-bold,
[data-theme="dark"] .app-navbar .btn-icon,
[data-theme="dark"] .app-navbar .btn-profile {
    color: #e6edf7;
}

[data-theme="dark"] .app-navbar .text-muted {
    color: #94a8c4 !important;
}

[data-theme="dark"] .text-muted,
[data-theme="dark"] .text-secondary,
[data-theme="dark"] .text-body-secondary {
    color: #aab5ca !important;
}

[data-theme="dark"] .app-sidebar .nav-label {
    color: rgba(203, 213, 225, 0.52) !important;
}

[data-theme="dark"] .sidebar-brand-tagline {
    color: rgba(226, 232, 240, 0.78);
}

[data-theme="dark"] .sidebar-help-box {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.3);
    color: rgba(226, 232, 240, 0.84);
}

.app-content {
    min-height: calc(100vh - 160px);
}

.app-footer {
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .app-footer {
    background: rgba(15, 23, 42, 0.5);
}

.btn-icon,
.btn-profile {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    min-width: 44px;
    min-height: 44px;
    border-radius: 16px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn-icon:hover,
.btn-profile:hover {
    transform: translateY(-1px);
    background: var(--surface-strong);
    border-color: rgba(100, 116, 139, 0.35);
}

[data-theme="dark"] .btn-icon:hover,
[data-theme="dark"] .btn-profile:hover {
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(226, 232, 240, 0.35);
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: #fff;
    font-weight: 700;
}

.btn-profile {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.8rem;
}

/* Modern compact profile button */
.btn-profile {
    padding: 0.35rem 0.6rem;
    border-radius: 12px;
    min-width: auto;
    background: var(--surface-strong);
    border: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    background: var(--surface-strong);
}

/* Hide Bootstrap default caret (::after) so only the custom chevron icon shows */
.profile-dropdown .btn-profile.dropdown-toggle::after,
.profile-dropdown .btn-profile::after {
    display: none !important;
}

/* Ensure our custom caret is shown on medium+ screens */
.dropdown-caret {
    display: inline-block;
}

.profile-meta .profile-name {
    font-size: 0.95rem;
    line-height: 1;
}

.profile-meta .profile-role {
    font-size: 0.78rem;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    font-weight: 700;
}

/* Dropdown card styling and animations */
.profile-dropdown {
    position: relative;
}

.dropdown-menu.glass-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    max-width: 320px;
    padding: 0.35rem;
    border-radius: 14px;
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
    transform-origin: top right;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 180ms ease, transform 180ms cubic-bezier(.2, .9, .2, 1);
    pointer-events: none;
    z-index: 2200;
}

[data-theme="dark"] .dropdown-menu.glass-dropdown {
    background: #0f172a !important;
}

/* Visible state when Bootstrap applies .show */
.dropdown-menu.glass-dropdown.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dropdown-header {
    padding: 0.6rem 1rem;
}

.dropdown-item {
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
}

.dropdown-item i.bi {
    margin-right: 0.7rem;
    font-size: 1.05rem;
    width: 18px;
    text-align: center;
}

.dropdown-item span {
    flex: 1;
}

.dropdown-item:hover {
    background: rgba(17, 67, 155, 0.06);
}

/* Ensure dropdown does not get clipped on small screens */
@media (max-width: 576px) {
    .dropdown-menu.glass-dropdown {
        right: 8px;
        left: 8px;
        min-width: auto;
        max-width: calc(100% - 16px);
        top: calc(100% + 6px);
    }

    .profile-meta {
        display: none !important;
    }

    .dropdown-caret {
        display: none !important;
    }
}

.btn-brand {
    background-color: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #fff;
}

.btn-brand:hover,
.btn-brand:focus {
    background-color: var(--brand-blue-hover);
    border-color: var(--brand-blue-hover);
    color: #fff;
}

.hero-card,
.stats-card,
.chart-card,
.table-card,
.module-card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.stats-card {
    padding: 1.5rem 1.25rem;
    position: relative;
    overflow: hidden;
    min-height: 140px;
}

a.stats-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.stats-card-link:hover {
    transform: translateY(-2px);
    border-color: rgba(17, 67, 155, 0.18);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16);
}

.stats-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 118, 110, 0.08);
    color: var(--primary);
    font-size: 1.15rem;
}

.stats-value {
    display: inline-block;
    font-size: clamp(1.3rem, 1.8vw, 1.75rem);
    font-weight: 800;
    line-height: 1.1;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.stats-card-money .stats-value {
    font-size: clamp(1.15rem, 1.5vw, 1.45rem);
}

.stats-card .d-flex>div:first-child {
    min-width: 0;
    flex: 1;
}

.stats-card-money .d-flex {
    gap: 0.9rem !important;
}

.stats-card-money .stats-icon {
    width: 48px;
    height: 48px;
}

/* Stats Card Colorful Text & Icons */
.stats-card.card-indigo .stats-value {
    color: #4f46e5 !important;
}

.stats-card.card-indigo .stats-icon {
    background: rgba(79, 70, 229, 0.09) !important;
    color: #4f46e5 !important;
}

a.stats-card-link.card-indigo:hover {
    border-color: rgba(79, 70, 229, 0.45) !important;
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.12) !important;
}

.stats-card.card-teal .stats-value {
    color: #0d9488 !important;
}

.stats-card.card-teal .stats-icon {
    background: rgba(13, 148, 136, 0.09) !important;
    color: #0d9488 !important;
}

a.stats-card-link.card-teal:hover {
    border-color: rgba(13, 148, 136, 0.45) !important;
    box-shadow: 0 15px 35px rgba(13, 148, 136, 0.12) !important;
}

.stats-card.card-blue .stats-value {
    color: #2563eb !important;
}

.stats-card.card-blue .stats-icon {
    background: rgba(37, 99, 235, 0.09) !important;
    color: #2563eb !important;
}

a.stats-card-link.card-blue:hover {
    border-color: rgba(37, 99, 235, 0.45) !important;
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.12) !important;
}

.stats-card.card-purple .stats-value {
    color: #7c3aed !important;
}

.stats-card.card-purple .stats-icon {
    background: rgba(124, 58, 237, 0.09) !important;
    color: #7c3aed !important;
}

a.stats-card-link.card-purple:hover {
    border-color: rgba(124, 58, 237, 0.45) !important;
    box-shadow: 0 15px 35px rgba(124, 58, 237, 0.12) !important;
}

.stats-card.card-orange .stats-value {
    color: #ea580c !important;
}

.stats-card.card-orange .stats-icon {
    background: rgba(234, 88, 12, 0.09) !important;
    color: #ea580c !important;
}

a.stats-card-link.card-orange:hover {
    border-color: rgba(234, 88, 12, 0.45) !important;
    box-shadow: 0 15px 35px rgba(234, 88, 12, 0.12) !important;
}

.stats-card.card-green .stats-value {
    color: #16a34a !important;
}

.stats-card.card-green .stats-icon {
    background: rgba(22, 163, 74, 0.09) !important;
    color: #16a34a !important;
}

a.stats-card-link.card-green:hover {
    border-color: rgba(22, 163, 74, 0.45) !important;
    box-shadow: 0 15px 35px rgba(22, 163, 74, 0.12) !important;
}

.stats-card.card-rose .stats-value {
    color: #e11d48 !important;
}

.stats-card.card-rose .stats-icon {
    background: rgba(225, 29, 72, 0.09) !important;
    color: #e11d48 !important;
}

a.stats-card-link.card-rose:hover {
    border-color: rgba(225, 29, 72, 0.45) !important;
    box-shadow: 0 15px 35px rgba(225, 29, 72, 0.12) !important;
}

.settings-reset-card,
.settings-info-card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.settings-info-card {
    display: grid;
    gap: 1rem;
}

.settings-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.95rem;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--primary-strong);
    border: 1px solid rgba(245, 158, 11, 0.18);
    font-weight: 600;
    white-space: nowrap;
}

.settings-info-item {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.password-input-group .form-control {
    border-right: 0;
}

.password-toggle-btn {
    min-width: 56px;
}

.password-strength-card {
    padding: 1rem 1rem 1.05rem;
    border-radius: 18px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.password-strength-track {
    height: 10px;
    background: rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    overflow: hidden;
}

.password-strength-bar {
    border-radius: 999px;
    transition: width 0.2s ease, background-color 0.2s ease;
}

.password-strength-bar.is-weak {
    background: #ef4444;
}

.password-strength-bar.is-fair {
    background: #f59e0b;
}

.password-strength-bar.is-good {
    background: #0ea5e9;
}

.password-strength-bar.is-strong {
    background: #10b981;
}

[data-theme="dark"] .settings-info-item,
[data-theme="dark"] .password-strength-card {
    background: rgba(30, 41, 59, 0.58);
    border-color: rgba(148, 163, 184, 0.22);
}

[data-theme="dark"] .settings-badge {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.26);
    color: #f8fafc;
}

.min-w-0 {
    min-width: 0 !important;
}

.page-title {
    font-weight: 800;
    letter-spacing: -0.03em;
}

.page-subtitle {
    color: var(--muted);
}

.module-toolbar,
.module-filters,
.module-actions,
.dashboard-section {
    margin-bottom: 1.25rem;
}

.app-action-toolbar {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 0.6rem;
    justify-content: flex-start;
    align-items: center;
    width: max-content;
    max-width: 100%;
    margin-left: auto;
    margin-bottom: 0;
    overflow: visible;
}

.app-action-toolbar>.btn.btn-outline-secondary,
.app-action-toolbar>.dropdown>.btn.btn-outline-secondary {
    background-color: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #fff;
}

.app-action-toolbar>.btn.btn-outline-secondary:hover,
.app-action-toolbar>.btn.btn-outline-secondary:focus,
.app-action-toolbar>.dropdown>.btn.btn-outline-secondary:hover,
.app-action-toolbar>.dropdown>.btn.btn-outline-secondary:focus {
    background-color: var(--brand-blue-hover);
    border-color: var(--brand-blue-hover);
    color: #fff;
}

.app-action-toolbar>.btn,
.app-action-toolbar>.dropdown,
.app-action-toolbar>.bulk-actions {
    flex: 0 0 auto;
    min-width: 0;
}

.app-action-toolbar>.btn,
.app-action-toolbar>.dropdown>.btn,
.app-action-toolbar>.bulk-actions>.btn {
    min-height: 38px;
    border-radius: 7px;
    padding: 0.5rem 0.8rem;
    font-size: 0.92rem;
    line-height: 1.2;
    white-space: nowrap;
}

/* Slightly tighter buttons inside the module header so they all fit one row */
.module-toolbar .app-action-toolbar>.btn,
.module-toolbar .app-action-toolbar>.dropdown>.btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    gap: 0.4rem;
}

.module-toolbar .app-action-toolbar {
    justify-content: flex-end;
    flex-wrap: nowrap !important;
    width: auto;
    margin-left: 0;
}

.module-toolbar-title {
    flex: 1 1 0;
    min-width: 0;
}

.module-toolbar-title .page-title {
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.module-toolbar-btns {
    flex: 0 0 auto;
}

@media (max-width: 767.98px) {
    .module-toolbar .app-action-toolbar {
        flex-wrap: wrap !important;
        justify-content: flex-start;
    }

    .module-toolbar-title .page-title {
        white-space: normal;
    }
}

.app-action-toolbar .bi {
    margin-right: 0.45rem !important;
}

.app-action-toolbar .dropdown-menu {
    min-width: 100%;
}

@media (max-width: 991.98px) {
    .app-action-toolbar {
        justify-content: start;
        margin-left: 0;
        flex-wrap: wrap !important;
    }
}

@media (max-width: 575.98px) {
    .app-action-toolbar {
        width: 100%;
        max-width: 100%;
        gap: 0.4rem;
        flex-wrap: wrap !important;
    }

    .app-action-toolbar>.btn,
    .app-action-toolbar>.dropdown,
    .app-action-toolbar>.bulk-actions {
        flex: 1 1 auto;
    }

    .app-action-toolbar>.dropdown>.btn,
    .app-action-toolbar>.bulk-actions>.btn {
        width: 100%;
    }

    .app-action-toolbar>.btn,
    .app-action-toolbar>.dropdown>.btn,
    .app-action-toolbar>.bulk-actions>.btn {
        min-height: 42px;
        padding: 0.55rem 0.45rem;
        font-size: 0.86rem;
    }

    .app-action-toolbar .bi {
        margin-right: 0.3rem !important;
    }

    /* Responsive Stats Card Scaling */
    .stats-card {
        padding: 1rem 0.85rem !important;
        min-height: 105px !important;
    }

    .stats-card .stats-value {
        font-size: 1.35rem !important;
    }

    .stats-card-money .stats-value {
        font-size: 1.25rem !important;
    }
}

.dataTables_wrapper .table {
    margin-bottom: 0 !important;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

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

/* Prevent table header/left-column overlap across module tables */
.table-card .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* When DataTables takes over with scrollX, neutralize the outer table-responsive
   so only the DataTables scroll body scrolls */
.table-card .dataTables_wrapper {
    overflow: visible;
}

.table-card .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* Make the DataTables header match the scroll width */
.table-card .dataTables_scrollHead {
    overflow: hidden !important;
}

/* Ensure the inner table is wide enough to trigger scrolling */
.table-card .dataTables_scrollBody table {
    min-width: max-content;
}

.table-card table.dashboard-table {
    width: 100%;
    min-width: 500px;
    border-collapse: separate;
}

.table-card th,
.table-card td {
    white-space: nowrap !important;
    vertical-align: middle;
    padding: 1rem 0.75rem;
}

.table-card td .badge {
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

/* Specific column adjustments for dashboard tables */
[data-dashboard-pending-approvals-body] td:nth-child(2),
[data-dashboard-recent-sales-body] td:nth-child(3),
.table-card thead th:nth-child(2) {
    white-space: normal !important;
    min-width: 150px;
    max-width: 250px;
}

.table-card td.text-wrap-cell {
    white-space: normal !important;
}

.privacy-policy-table th,
.privacy-policy-table td {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.privacy-policy-table {
    table-layout: fixed;
}

.table-card thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-strong);
}

.module-shell .table-card {
    position: relative;
}

.module-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

[data-theme="dark"] .module-loading-overlay {
    background: rgba(18, 18, 18, 0.6);
}

.module-shell.is-loading .dataTables_wrapper,
.module-shell.is-loading .table-responsive {
    opacity: 0.4;
    visibility: visible;
    pointer-events: none;
}

.module-shell.is-loading .module-loading-overlay {
    display: flex;
}

.module-shell.is-loading .table-card {
    min-height: 360px;
}

.table-card th.sticky-col,
.table-card td.sticky-col {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--surface-strong);
}

/* Sticky Actions Column */
.table-card th.sticky-actions {
    position: sticky;
    right: 0;
    z-index: 4;
    background: var(--surface-strong) !important;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.05) !important;
}

.table-card td.sticky-actions {
    position: sticky;
    right: 0;
    z-index: 3;
    background: #fff !important;
    box-shadow: -6px 0 10px -4px rgba(0, 0, 0, 0.12) !important;
}

[data-theme="dark"] .table-card td.sticky-actions {
    background: #0f172a !important;
}

.table tr:nth-of-type(even) td.sticky-actions {
    background: #f8f9fa !important;
}

[data-theme="dark"] .table tr:nth-of-type(even) td.sticky-actions {
    background: #1e293b !important;
}

.table-hover tbody tr:hover td.sticky-actions {
    background: #f1f5f9 !important;
}

[data-theme="dark"] .table-hover tbody tr:hover td.sticky-actions {
    background: #1e293b !important;
}

.table-card .day-col {
    min-width: 54px;
    max-width: 120px;
    text-align: center;
}

.table-card .name-col,
.table-card .attendant_name-col,
.table-card .full_name-col,
.table-card .account_name-col,
.table-card .note-col,
.table-card .notes-col {
    min-width: 180px;
    max-width: 360px;
    white-space: normal !important;
}

#attendanceTable {
    table-layout: fixed;
    width: 100% !important;
    min-width: 860px;
}

#attendanceTable th,
#attendanceTable td {
    overflow: hidden;
    text-overflow: ellipsis;
}

#attendanceTable th:nth-child(1),
#attendanceTable td:nth-child(1) {
    width: 135px;
    min-width: 135px;
}

#attendanceTable th:nth-child(2),
#attendanceTable td:nth-child(2) {
    width: 150px;
    min-width: 150px;
}

#attendanceTable th:nth-child(3),
#attendanceTable td:nth-child(3),
#attendanceTable th:nth-child(4),
#attendanceTable td:nth-child(4) {
    width: 190px;
    min-width: 190px;
}

#attendanceTable th:nth-child(5),
#attendanceTable td:nth-child(5) {
    width: 115px;
    min-width: 115px;
}

#attendanceTable th:nth-child(6),
#attendanceTable td:nth-child(6) {
    width: 90px;
    min-width: 90px;
}

#attendanceTable td:nth-child(5) .badge {
    max-width: 100%;
}

#attendanceTable_wrapper {
    min-width: 0;
}

#attendanceTable_wrapper .row {
    --bs-gutter-x: 0.75rem;
}

#attendanceTable_wrapper .dataTables_scrollBody {
    -webkit-overflow-scrolling: touch;
}

.table> :not(caption)>*>* {
    background: transparent;
    color: var(--text);
    vertical-align: middle;
}

[data-theme="dark"] .dataTables_wrapper .table,
[data-theme="dark"] .table {
    background: rgba(15, 23, 42, 0.5) !important;
    color: #e2e8f0;
    --bs-table-bg: rgba(15, 23, 42, 0.68);
    --bs-table-color: #dde6f3;
    --bs-table-border-color: rgba(148, 163, 184, 0.24);
    --bs-table-striped-bg: rgba(30, 41, 59, 0.62);
    --bs-table-striped-color: #e6edf8;
    --bs-table-hover-bg: rgba(51, 65, 85, 0.72);
    --bs-table-hover-color: #ffffff;
}

[data-theme="dark"] .table thead th {
    color: #b6c3d8;
}

[data-theme="dark"] .table> :not(caption)>*>* {
    color: #dde6f3;
    border-color: rgba(148, 163, 184, 0.24);
}

[data-theme="dark"] table.dataTable>thead>tr>th,
[data-theme="dark"] table.dataTable>thead>tr>td {
    background-color: rgba(15, 23, 42, 0.88) !important;
    color: #b8c6dc !important;
    border-bottom-color: rgba(148, 163, 184, 0.28) !important;
}

[data-theme="dark"] table.dataTable>tbody>tr>td,
[data-theme="dark"] table.dataTable>tbody>tr>th {
    background-color: rgba(15, 23, 42, 0.68) !important;
    color: #e2e8f0 !important;
    border-bottom-color: rgba(148, 163, 184, 0.22) !important;
}

[data-theme="dark"] table.dataTable.table-striped>tbody>tr:nth-of-type(odd)>* {
    background-color: rgba(30, 41, 59, 0.56) !important;
    color: #e6edf8 !important;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-theme="dark"] .dataTables_wrapper .dataTables_filter label {
    color: #a9bad3;
}

[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    color: #e2e8f0 !important;
    background: rgba(15, 23, 42, 0.65) !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
}

.badge-soft-success {
    background: rgba(16, 185, 129, 0.16);
    color: #10b981;
}

.badge-soft-danger {
    background: rgba(239, 68, 68, 0.16);
    color: #ef4444;
}

.badge-soft-warning {
    background: rgba(245, 158, 11, 0.16);
    color: #f59e0b;
}

.badge-soft-info {
    background: rgba(59, 130, 246, 0.16);
    color: #60a5fa;
}

.badge-soft-purple {
    background: rgba(168, 85, 247, 0.16);
    color: #a855f7;
}

.badge-soft-secondary {
    background: rgba(100, 116, 139, 0.16);
    color: #64748b;
}

.app-loader {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(2, 6, 23, 0.45);
    z-index: 2000;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.app-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-card {
    padding: 1.5rem 1.75rem;
    border-radius: 22px;
    text-align: center;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(245, 247, 251, 0.15) 0%, rgba(238, 244, 255, 0.22) 100%), url('../img/image-1.png') no-repeat center center;
    background-size: cover;
    position: relative;
    overflow-y: auto;
}

[data-theme="dark"] .auth-shell {
    background: linear-gradient(135deg, rgba(7, 17, 30, 0.12) 0%, rgba(15, 23, 42, 0.25) 100%), url('../img/image-1.png') no-repeat center center;
    background-size: cover;
}

@media (min-width: 992px) {
    .auth-shell {
        display: flex;
        justify-content: center;
        align-items: flex-end;
        padding: 0 2rem 1.1rem 2rem;
        background-size: 100% 100%;
        background-position: center center;
    }

    [data-theme="dark"] .auth-shell {
        background-size: 100% 100%;
        background-position: center center;
    }
}

.auth-layout {
    width: min(360px, 100%);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Single-line login card (phone + password + button in one row, bottom-center). */
.auth-layout--inline {
    width: auto;
    max-width: 100%;
}

.auth-layout--inline .auth-panel {
    padding: 0.85rem 2rem;
    background: rgba(255, 255, 255, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
}

/* Logo + brand pinned to the top-left corner, in a compact glass card. */
.auth-topleft-brand {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    z-index: 5;
    padding: 0.45rem 1rem 0.45rem 0.5rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 22px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18), 0 0 40px rgba(17, 67, 155, 0.05);
}

.auth-topleft-brand .auth-logo-badge {
    width: 56px;
    height: 56px;
}

.auth-inline-form {
    display: flex;
    align-items: flex-end;
    gap: 1.1rem;
    flex-wrap: wrap;
}

.auth-inline-field {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: 230px;
}

.auth-inline-field .form-label {
    color: #1f2937 !important;
}

.auth-inline-form .custom-input-group {
    width: 100%;
}

.auth-inline-form .btn-login {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.7rem 1.6rem;
}

.auth-aside {
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    color: white;
    background: linear-gradient(135deg, rgba(3, 7, 18, 0.92), rgba(15, 118, 110, 0.92)), radial-gradient(circle at top right, rgba(245, 158, 11, 0.28), transparent 28%);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 640px;
}

.auth-panel {
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18), 0 0 40px rgba(17, 67, 155, 0.05);
    padding: 1.75rem 1.5rem;
    display: grid;
    align-items: center;
}

[data-theme="dark"] .auth-panel {
    background: rgba(15, 23, 42, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 40px rgba(15, 118, 110, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.auth-logo-badge {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(17, 67, 155, 0.12);
    border: 1.5px solid rgba(17, 67, 155, 0.1);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-logo-badge:hover {
    transform: scale(1.06) rotate(3deg);
    box-shadow: 0 15px 30px rgba(17, 67, 155, 0.2), 0 0 20px rgba(15, 118, 110, 0.15);
    border-color: rgba(17, 67, 155, 0.25);
}

.auth-logo-img {
    height: 52px;
    width: auto;
    object-fit: contain;
}

.custom-input-group {
    background: rgba(255, 255, 255, 0.72) !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

[data-theme="dark"] .custom-input-group {
    background: rgba(15, 23, 42, 0.45) !important;
}

.custom-input-group:focus-within {
    border-color: var(--brand-blue) !important;
    box-shadow: 0 0 0 4px rgba(17, 67, 155, 0.15), 0 4px 12px rgba(17, 67, 155, 0.05) !important;
}

[data-theme="dark"] .custom-input-group:focus-within {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.25), 0 4px 12px rgba(15, 118, 110, 0.1) !important;
}

.custom-input-group.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15), 0 4px 12px rgba(220, 53, 69, 0.05) !important;
}

[data-theme="dark"] .custom-input-group.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25), 0 4px 12px rgba(239, 68, 68, 0.1) !important;
}


.custom-input-group .form-control {
    background: transparent !important;
    border: none !important;
    padding: 0.75rem 1rem 0.75rem 0.25rem !important;
    font-size: 0.95rem !important;
    color: var(--text) !important;
}

.custom-input-group .form-control:focus {
    box-shadow: none !important;
}

.custom-input-group .input-group-text {
    background: transparent !important;
    border: none !important;
    padding-left: 1.1rem !important;
    padding-right: 0.6rem !important;
    color: var(--muted) !important;
}

.btn-toggle-password {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    max-height: 38px;
    z-index: 10;
    background: transparent;
    border: none;
    padding: 0 1.1rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s ease;
}

#crudModal .btn-toggle-password {
    max-height: 34px;
}

.btn-toggle-password:hover {
    color: var(--text);
}

.btn-login {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--primary) 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 0.8rem 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(17, 67, 155, 0.2);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 67, 155, 0.3), 0 0 15px rgba(15, 118, 110, 0.25);
    background: linear-gradient(135deg, var(--brand-blue-hover) 0%, var(--primary-strong) 100%) !important;
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(17, 67, 155, 0.2);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--muted);
}


.auth-form-wrap {
    width: min(100%, 420px);
    margin: 0 auto;
}

.auth-layout--inline .auth-form-wrap {
    width: 100%;
    max-width: none;
}

.auth-brand-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
    display: block;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.18);
    font-weight: 700;
}

.auth-feature-list {
    display: grid;
    gap: 1rem;
}

.auth-feature-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    align-items: start;
    padding: 1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

.auth-feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(245, 158, 11, 0.18);
    color: #fde68a;
    flex: 0 0 auto;
}

.auth-support-card {
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
}

.glass-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.chart-card canvas {
    min-height: 280px;
}

.empty-state {
    padding: 2.5rem 1.5rem;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.28);
}

.form-control,
.form-select,
.input-group-text,
.flatpickr-input {
    background-color: rgba(255, 255, 255, 0.78) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .input-group-text,
[data-theme="dark"] .flatpickr-input {
    background-color: rgba(15, 23, 42, 0.82) !important;
    color: var(--text) !important;
}

[data-theme="dark"] .form-label {
    color: #dde6f3 !important;
    font-weight: 500;
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .form-select option {
    color: #94a8c4 !important;
}

[data-theme="dark"] .form-control {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .form-select {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .modal-content {
    background-color: rgba(15, 23, 42, 0.96) !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    color: #e2e8f0;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: rgba(148, 163, 184, 0.22) !important;
    color: #e2e8f0;
}

[data-theme="dark"] .modal-header .btn-close {
    filter: invert(0.8);
}

[data-theme="dark"] .modal-body {
    color: #e2e8f0;
}

[data-theme="dark"] .modal-content .text-muted {
    color: #94a8c4 !important;
}

[data-theme="dark"] .modal-footer {
    border-top-color: rgba(148, 163, 184, 0.22) !important;
}

.modal-content .text-muted {
    color: #64748b !important;
}

.modal-content .btn-close {
    filter: none;
}

.btn-action-view {
    .btn-close-white {
        --bs-btn-close-color: #0f172a;
    }

    [data-theme="dark"] .btn-close-white {
        --bs-btn-close-color: #e2e8f0;
    }

    --bs-btn-color: #334155;
    --bs-btn-border-color: rgba(100, 116, 139, 0.5);
    --bs-btn-hover-color: #0f172a;
    --bs-btn-hover-bg: rgba(148, 163, 184, 0.16);
    --bs-btn-hover-border-color: #64748b;
    --bs-btn-active-color: #0f172a;
    --bs-btn-active-bg: rgba(148, 163, 184, 0.2);
    --bs-btn-active-border-color: #64748b;
    --bs-btn-disabled-color: #334155;
    --bs-btn-disabled-bg: rgba(148, 163, 184, 0.1);
    --bs-btn-disabled-border-color: rgba(100, 116, 139, 0.4);
    opacity: 1;
}

.btn-action-view:disabled,
.btn-action-view.disabled {
    opacity: 1;
}

.row-actions {
    flex-wrap: nowrap !important;
    white-space: nowrap;
    align-items: center;
}

.row-actions .btn {
    white-space: nowrap;
    flex: 0 0 auto;
}

.table td.text-end.text-nowrap,
.table th.text-end.text-nowrap {
    white-space: nowrap;
}

/* Bulk selection checkbox styling */
.table th.checkbox-column,
.table td.checkbox-column {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    text-align: center;
    vertical-align: middle;
    padding-left: 0.75rem !important;
    padding-right: 0 !important;
}

.table th.checkbox-column::before,
.table th.checkbox-column::after {
    display: none !important;
    /* Hide DataTables sorting arrows */
}

.table .form-check {
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: auto;
}

.table .form-check-input {
    margin-top: 0;
    cursor: pointer;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 4px;
}

[data-theme="dark"] .btn-action-view {
    --bs-btn-color: #dbe6f5;
    --bs-btn-border-color: rgba(226, 232, 240, 0.5);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: rgba(226, 232, 240, 0.12);
    --bs-btn-hover-border-color: rgba(226, 232, 240, 0.75);
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: rgba(226, 232, 240, 0.18);
    --bs-btn-active-border-color: rgba(226, 232, 240, 0.75);
    --bs-btn-disabled-color: #dbe6f5;
    --bs-btn-disabled-bg: rgba(148, 163, 184, 0.18);
    --bs-btn-disabled-border-color: rgba(226, 232, 240, 0.38);
}

@media (max-width: 1199.98px) {
    .app-frame {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(86vw, 320px);
        max-width: 320px;
        height: 100dvh;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-navbar {
        min-height: 72px;
    }

    .app-content {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .hero-card,
    .stats-card,
    .chart-card,
    .table-card,
    .module-card {
        border-radius: 22px;
    }
}

@media (max-width: 991.98px) {
    .auth-layout {
        grid-template-columns: 1fr;
    }

    .auth-aside {
        min-height: auto;
    }
}

@media (max-width: 575.98px) {
    .app-navbar {
        min-height: 74px;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        gap: 0.5rem;
    }

    /* Keep navbar items on a single line and allow brand to shrink */
    .app-navbar {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
    }

    .app-navbar .navbar-brand {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    /* Ensure the right-side profile area doesn't wrap below on small screens */
    .app-navbar .ms-auto {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-left: 0 !important;
    }

    /* Reduce avatar size slightly to fit narrow widths */
    .app-navbar .avatar-circle {
        width: 36px;
        height: 36px;
    }

    .app-navbar .ms-auto {
        margin-left: auto !important;
        width: auto;
        justify-content: flex-end;
    }

    .app-navbar .btn-profile {
        width: auto;
        max-width: 100%;
    }

    .auth-panel,
    .auth-aside {
        padding: 1.25rem;
        border-radius: 22px;
    }

    .stats-card {
        min-height: 126px;
    }

    .stats-value {
        font-size: clamp(1.25rem, 6vw, 1.55rem);
    }

    .stats-card-money .stats-value {
        font-size: clamp(1.15rem, 5vw, 1.35rem);
    }

    .module-toolbar,
    .module-filters,
    .hero-card,
    .table-card,
    .glass-card,
    .card {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .table-card .table-responsive,
    .dataTables_wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        width: 100% !important;
        text-align: left !important;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        margin-bottom: 0.75rem;
    }

    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        width: 100% !important;
        max-width: 100%;
    }

    .table-card table,
    .dataTables_wrapper .table {
        width: max-content;
        min-width: 720px;
        table-layout: auto;
    }

    .table-card th,
    .table-card td {
        white-space: nowrap;
    }

    .sidebar-nav .sidebar-link {
        padding: 0.75rem 0.85rem;
        border-radius: 14px;
    }
}

/* Ensure profile dropdown is not clipped on small screens */
@media (max-width: 575.98px) {
    .profile-dropdown .dropdown-menu {
        position: fixed !important;
        right: 10px !important;
        top: 62px !important;
        left: auto !important;
        transform: none !important;
        margin: 0 !important;
        min-width: 140px !important;
        z-index: 1600 !important;
        box-shadow: 0 12px 30px rgba(2, 6, 23, 0.16) !important;
        border-radius: 12px !important;
    }

    .profile-dropdown .dropdown-menu .dropdown-header,
    .profile-dropdown .dropdown-menu .dropdown-item {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Custom Premium Logo Badge Styles */
.auth-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #ffffff;
    border: 1.5px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.02);
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-logo-badge:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 24px 48px rgba(245, 158, 11, 0.15), 0 8px 24px rgba(15, 23, 42, 0.04);
}

.auth-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    /* Safe padding for logo inside badge */
    transition: transform 0.3s ease;
}

.auth-logo-badge:hover .auth-logo-img {
    transform: scale(1.03);
}

.du-sheets-shell {
    display: grid;
    gap: 1rem;
}

.du-sheets-shell>.hero-card,
.du-sheets-shell>.glass-card,
.du-sheets-shell>.table-card,
.du-sheets-shell>.module-card,
.du-sheets-shell>div {
    margin: 0 !important;
}

.du-sheets-shell .table {
    font-size: 1rem;
    table-layout: auto;
    width: 100%;
}

.du-sheets-shell .table th,
.du-sheets-shell .table td {
    padding: 0.95rem 0.8rem;
    white-space: nowrap;
}

.du-sheets-shell .table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.du-sheets-shell .table .btn-sm {
    padding: 0.45rem 0.7rem;
    font-size: 0.9rem;
}

.du-sheets-shell .badge {
    padding: 0.45em 0.8em;
    font-size: 0.85rem;
}

.du-sheets-shell .table-responsive {
    overflow-x: auto;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.du-sheets-shell .table th:first-child,
.du-sheets-shell .table td:first-child {
    padding-left: 1.1rem;
}

.du-sheets-shell .table th:last-child,
.du-sheets-shell .table td:last-child {
    padding-right: 1.1rem;
}

.du-sheets-shell .table th:nth-child(1) {
    width: 64px;
}

.du-sheets-shell .table th:nth-child(2) {
    width: 120px;
}

.du-sheets-shell .table th:nth-child(3) {
    width: 130px;
}

.du-sheets-shell .table th:nth-child(4) {
    width: 92px;
}

.du-sheets-shell .table th:nth-child(10) {
    width: 150px;
}

@media (max-width: 1399.98px) {
    .du-sheets-shell .table-responsive {
        overflow-x: auto;
    }
}

.du-page-root {
    min-height: 420px;
}

.du-sheets-shell[data-du-page="view"] .du-page-root {
    min-height: 0;
}

.du-sheets-shell[data-du-page="view"] .row.g-3,
.du-sheets-shell[data-du-page="view"] .row.g-4 {
    --bs-gutter-y: 1rem;
}

.du-sheets-shell[data-du-page="view"] .du-section-card {
    height: auto;
}

.du-sheets-shell[data-du-page="view"] .du-sheet-info-card {
    min-height: 0;
}

.du-sheets-shell[data-du-page="view"] .du-info-grid {
    gap: 0.75rem;
}

.du-sheets-shell[data-du-page="view"] .du-info-item {
    min-height: 82px;
}

.du-sheets-shell[data-du-page="view"] .hero-card .app-action-toolbar {
    flex-wrap: wrap !important;
    justify-content: flex-end;
    width: 100%;
}

.du-sheets-shell[data-du-page="view"] .hero-card .app-action-toolbar>.btn {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.du-sheets-shell[data-du-page="view"] .du-report-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-right: 0;
    margin-left: 0;
    align-items: stretch;
}

.du-sheets-shell[data-du-page="view"] .du-report-detail-grid>[class*="col-"] {
    width: 100%;
    max-width: 100%;
    padding-right: 0;
    padding-left: 0;
}

.du-sheets-shell[data-du-page="view"] .du-report-entry-grid>[class*="col-"] {
    display: block !important;
    width: 100%;
    max-width: 100%;
    padding-right: 0;
    padding-left: 0;
    margin-bottom: 0;
}

.du-sheets-shell[data-du-page="view"] .du-report-entry-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.du-sheets-shell[data-du-page="view"] .du-report-detail-grid .du-section-card {
    margin-bottom: 0 !important;
}

.du-sheets-shell[data-du-page="view"] .du-report-entry-grid .col-md-6 > .du-section-card:not(:last-child) {
    margin-bottom: 1rem !important;
}

.du-sheets-shell[data-du-page="view"] .detail-row:last-child {
    margin-bottom: 0 !important;
}

@media (max-width: 991.98px) {

    .du-sheets-shell[data-du-page="view"] .du-section-card,
    .du-sheets-shell[data-du-page="view"] .du-preview-card {
        border-radius: 18px;
    }
}

@media (max-width: 575.98px) {

    .du-sheets-shell[data-du-page="view"] .du-section-card,
    .du-sheets-shell[data-du-page="view"] .du-preview-card {
        padding: 1rem !important;
    }

    .du-sheets-shell[data-du-page="view"] .du-info-grid {
        grid-template-columns: 1fr;
    }

    .du-sheets-shell[data-du-page="view"] .du-info-item {
        min-height: 0;
    }
}

.du-report-sidebar {
    position: sticky;
    top: 1.25rem;
    align-self: start;
}

.du-sticky {
    position: sticky;
    top: 1.25rem;
}

.du-section-card,
.du-preview-card,
.nozzle-card,
.repeat-row,
.du-stat-box {
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.du-section-card {
    overflow: hidden;
}

.du-preview-card {
    border-style: dashed;
}

.du-stat-box {
    padding: 1rem;
    height: 100%;
}

.du-stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    margin-top: 0.35rem;
}

.du-summary-pill {
    padding: 0.85rem 0.95rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid var(--border);
}

.du-sheet-info-card {
    position: relative;
    overflow: hidden;
}

.bank-statements-shell {
    display: grid;
    gap: 1.25rem;
}

.bank-toolbar,
.bank-filter-card,
.bank-history-card,
.bank-account-card {
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.bank-toolbar {
    position: sticky;
    top: 1rem;
    z-index: 5;
}

.bank-sticky {
    position: sticky;
    top: 1rem;
    z-index: 4;
}

.bank-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.bank-account-card {
    display: block;
    padding: 1.2rem;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.bank-account-card:hover,
.bank-account-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(17, 67, 155, 0.22);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.12);
}

.bank-account-card .bank-account-holder {
    font-size: 1 rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.bank-account-card .bank-account-name {
    font-size: 1.55rem;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.bank-account-card .bank-account-number {
    font-size: 0.98rem;
    line-height: 1.3;
}

.bank-mini-metric {
    border-radius: 16px;
    padding: 0.8rem 0.9rem;
    background: rgba(248, 250, 252, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.bank-list-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.bank-skeleton-card,
.bank-skeleton-table {
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(90deg, rgba(226, 232, 240, 0.45), rgba(248, 250, 252, 0.92), rgba(226, 232, 240, 0.45));
    background-size: 220% 100%;
    animation: bank-skeleton-wave 1.5s ease-in-out infinite;
    min-height: 220px;
}

.bank-skeleton-table {
    min-height: 120px;
    padding: 1rem;
}

.bank-skeleton-line {
    height: 14px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    margin-bottom: 0.75rem;
}

.bank-skeleton-line:last-child {
    margin-bottom: 0;
}

.bank-skeleton-card {
    min-height: 260px;
}

.bank-transaction-row {
    border-left: 3px solid transparent;
}

.bank-transaction-row.is-credit {
    border-left-color: #16a34a;
}

.bank-transaction-row.is-debit {
    border-left-color: #dc2626;
}

.bank-statement-table tbody tr:hover {
    background: rgba(17, 67, 155, 0.03);
}

.bank-statements-shell[data-bank-statements-page="detail"] .hero-card .bank-action-bar {
    flex-wrap: wrap !important;
    justify-content: flex-end;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.bank-statements-shell[data-bank-statements-page="detail"] .hero-card .bank-action-bar>.btn {
    flex: 0 1 auto;
    min-width: 0;
}

@media (max-width: 767.98px) {

    .bank-statements-shell[data-bank-statements-page="detail"] .hero-card .row,
    .bank-statements-shell[data-bank-statements-page="detail"] .hero-card [class*="col-"] {
        min-width: 0;
    }

    .bank-statements-shell[data-bank-statements-page="detail"] .hero-card .page-title,
    .bank-statements-shell[data-bank-statements-page="detail"] .hero-card .page-subtitle {
        overflow-wrap: anywhere;
    }

    .bank-statements-shell[data-bank-statements-page="detail"] .hero-card .bank-action-bar {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: flex-start;
        width: 100%;
    }

    .bank-statements-shell[data-bank-statements-page="detail"] .hero-card .bank-action-bar>.btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .bank-statements-shell[data-bank-statements-page="detail"] .hero-card .bank-action-bar {
        grid-template-columns: 1fr;
    }

    .bank-statements-shell[data-bank-statements-page="detail"] .hero-card .bank-action-bar>.btn {
        width: 100%;
    }
}

@keyframes bank-skeleton-wave {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

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

.du-info-item {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.7);
    padding: 0.7rem 0.75rem;
}

.du-nozzle-accordion {
    display: grid;
    gap: 0.85rem;
}

.du-accordion-item {
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.du-nozzle-accordion .accordion-button {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
    box-shadow: none;
    padding: 1rem 1.1rem;
}

.du-nozzle-accordion .accordion-button:not(.collapsed) {
    color: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(241, 245, 249, 0.95));
}

.du-nozzle-accordion .accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

.payment-summary-card .du-summary-pill-value[data-difference-tone="danger"] {
    color: #dc2626;
}

.payment-summary-card .du-summary-pill-value[data-difference-tone="success"] {
    color: #059669;
}

.du-stat-value[data-difference-tone="danger"],
.du-summary-pill-value[data-difference-tone="danger"] [data-difference] {
    color: #dc2626;
}

.du-stat-value[data-difference-tone="success"],
.du-summary-pill-value[data-difference-tone="success"] [data-difference] {
    color: #059669;
}

.du-summary-pill-value {
    font-weight: 800;
    font-size: 1rem;
    margin-top: 0.35rem;
}

.du-metric-card {
    border-radius: 18px;
    padding: 0.9rem 1rem;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.du-form-shell {
    display: grid;
    gap: 1.25rem;
}

.repeat-row {
    overflow: hidden;
}

.nozzle-card {
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nozzle-card:hover,
.repeat-row:hover {
    transform: translateY(-2px);
}

.du-skeleton-table {
    display: grid;
    gap: 0.85rem;
}

.du-skeleton-line {
    height: 0.85rem;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.16) 0%, rgba(148, 163, 184, 0.28) 50%, rgba(148, 163, 184, 0.16) 100%);
    background-size: 200% 100%;
    animation: du-shimmer 1.5s infinite linear;
}

@keyframes du-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.du-loading .app-content {
    cursor: progress;
}

.du-loading .du-section-card,
.du-loading .module-card,
.du-loading .table-card {
    opacity: 0.96;
}

.badge-soft-info {
    background: rgba(59, 130, 246, 0.16);
    color: #3b82f6;
}

.badge-soft-secondary {
    background: rgba(100, 116, 139, 0.16);
    color: #64748b;
}

.du-report-grid {
    display: grid;
    gap: 1.25rem;
}

.du-report-section {
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.detail-row {
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.shifts-page .shifts-hero,
.shifts-page .shift-stat-card,
.shifts-page .shift-card,
.shifts-page .shifts-empty-state,
.shifts-page .shifts-modal {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.shifts-page .shifts-hero {
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 34%),
        radial-gradient(circle at bottom left, rgba(148, 163, 184, 0.12), transparent 30%),
        rgba(255, 255, 255, 0.92);
}

.shifts-page .shift-stat-card {
    border-radius: 22px;
    padding: 1.25rem 1.35rem;
}

.shifts-page .shift-stat-value {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.shifts-page .shifts-grid-wrap {
    position: relative;
}

.shifts-page .shifts-list-shell {
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.shifts-page .shifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.1rem;
}

/* Attendance grid improvements */
.attendance-scroll,
.table-card .table-responsive {
    overflow-x: auto;
    scroll-behavior: smooth;
}

.attendance-scroll table,
.table-card table {
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
}

.attendance-scroll {
    position: relative;
}

.attendance-scroll col.name-col,
.table-card col.name-col {
    width: 200px !important;
}

.attendance-scroll col.day-col,
.table-card col.day-col {
    width: 64px;
    min-width: 64px;
}

.attendance-scroll col.total-col,
.table-card col.total-col {
    width: 110px;
    min-width: 110px;
}

.attendance-scroll th.day-col,
.attendance-scroll td.day-col,
.table-card th.day-col,
.table-card td.day-col {
    padding: 8px 6px;
    text-align: center;
}

.attendance-scroll th.sticky-col,
.attendance-scroll td.sticky-col,
.table-card th.sticky-col,
.table-card td.sticky-col {
    position: sticky;
    left: 0;
    z-index: 11;
    background: var(--surface-strong);
    box-shadow: 6px 0 12px rgba(2, 6, 23, 0.04);
    min-width: 260px;
    max-width: 260px;
    width: 260px;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}

.attendance-scroll thead th,
.table-card thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--surface-strong);
}

/* Split table layout: fixed left column + scrollable right table */
.attendance-split {
    display: flex;
}

.attendance-fixed {
    flex: 0 0 260px;
    overflow: auto;
}

.attendance-fixed .attendance-fixed-table {
    border-right: 0;
}

.attendance-fixed thead th {
    position: sticky;
    top: 0;
    z-index: 10;
}

.attendance-main {
    flex: 1 1 auto;
    overflow: auto;
}

.attendance-main table {
    min-width: 900px;
}

/* Keep both areas the same max-height on large screens */
@media (min-width: 1400px) {

    .attendance-fixed,
    .attendance-main {
        max-height: 74vh;
    }
}

/* Ensure the sticky left column sits above the header cells when overlapping */
.attendance-scroll thead th.sticky-col,
.table-card thead th.sticky-col {
    z-index: 12;
}

/* Add a right border to the sticky name column to separate from date area */
.attendance-scroll th.sticky-col,
.table-card th.sticky-col {
    border-right: 1px solid rgba(148, 163, 184, 0.06);
}

/* Prevent scrollbar overlapping final columns */
.attendance-scroll {
    padding-bottom: 8px;
}

.attendance-scroll {
    padding-right: 8px;
}

/* Ensure day headers have visible min width */
.attendance-scroll th.day-col,
.attendance-scroll td.day-col {
    min-width: 64px;
}

/* Ensure total columns remain visible at end */
.attendance-scroll th.total-col,
.attendance-scroll td.total-col {
    min-width: 110px;
}

.day-cell {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    font-weight: 700;
    color: var(--text);
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.06);
    font-size: 0.85rem;
}

.legend-symbol {
    display: inline-grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 6px;
    font-weight: 700;
}

/* Legend color mapping to match day cells */
.legend-chip[data-status="present"] .legend-symbol {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border-radius: 8px;
}

.legend-chip[data-status="absent"] .legend-symbol {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
    border-radius: 8px;
}

.legend-chip span:last-child {
    color: var(--muted);
    margin-left: 0.5rem;
}

.day-symbol {
    font-size: 0.95rem;
    line-height: 1;
}

.day-symbol .bi {
    font-size: 1rem;
}

.day-cell .bi {
    vertical-align: middle;
}

.day-cell[data-status="present"],
.day-cell[data-status="late"],
.day-cell[data-status="leave"],
.day-cell[data-status="half-day"] {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.day-cell[data-status="absent"] {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
}

.day-cell.is-empty {
    background: transparent;
    color: var(--muted);
    font-weight: 600;
}

/* Center header text in date columns */
.table-card thead th.day-col span {
    display: block;
    font-size: 0.8rem;
}

/* Ensure first column sticky header overlaps correctly */
.table-card thead th.sticky-col {
    left: 0;
    z-index: 6;
}

@media (max-width: 767.98px) {

    .table-card .table-responsive,
    .dataTables_wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        width: 100% !important;
        text-align: left !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        margin-bottom: 0.75rem;
    }

    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        width: 100% !important;
        max-width: 100%;
    }

    .table-card table,
    .dataTables_wrapper .table {
        table-layout: auto;
        width: max-content;
        min-width: 760px;
    }

    .table-card th,
    .table-card td {
        white-space: nowrap;
    }

    .table-card col.name-col {
        width: 160px;
    }

    .table-card col.day-col {
        width: 48px;
    }

    .table-card col.total-col {
        width: 76px;
    }
}

.shifts-page .shift-card {
    border-radius: 22px;
    padding: 1.15rem 1.15rem 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.shifts-page .shift-card:hover {
    transform: translateY(-3px);
    border-color: rgba(148, 163, 184, 0.26);
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.12);
}

.shifts-page .shift-card-skeleton {
    min-height: 192px;
}

.shifts-page .shift-time-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: #334155;
    border: 1px solid rgba(148, 163, 184, 0.18);
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
}

.shifts-page .shift-time-copy {
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.shifts-page .shifts-list-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.shifts-page .shifts-pagination .btn {
    min-width: 86px;
}

.shifts-page .shifts-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    border-radius: 24px;
}

.shifts-page .shifts-empty-icon {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    font-size: 2rem;
}

.shifts-page .shifts-alert {
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(239, 68, 68, 0.08);
}

.shifts-page .shifts-modal {
    border-radius: 24px;
}

.shifts-page .shifts-modal .form-control {
    min-height: 48px;
    border-radius: 14px;
}

.shifts-page .shifts-modal .form-control:focus {
    border-color: rgba(17, 67, 155, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(17, 67, 155, 0.08);
}

.shifts-page .shifts-fab {
    position: fixed;
    right: 1.15rem;
    bottom: calc(1.15rem + env(safe-area-inset-bottom, 0px));
    z-index: 1060;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    box-shadow: 0 18px 40px rgba(17, 67, 155, 0.3);
}

.shifts-page.is-loading .shift-card {
    opacity: 0.82;
    pointer-events: none;
}

[data-theme="dark"] .shifts-page .shifts-hero,
[data-theme="dark"] .shifts-page .shift-stat-card,
[data-theme="dark"] .shifts-page .shift-card,
[data-theme="dark"] .shifts-page .shifts-list-shell,
[data-theme="dark"] .shifts-page .shifts-empty-state,
[data-theme="dark"] .shifts-page .shifts-modal {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(148, 163, 184, 0.14);
}

[data-theme="dark"] .shifts-page .shift-time-badge {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.22);
}

[data-theme="dark"] .shifts-page .shift-time-copy {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.14);
}

[data-theme="dark"] .shifts-page .shifts-empty-icon {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
}

@media print {

    .app-sidebar,
    .app-navbar,
    .app-footer,
    .btn,
    .bank-toolbar,
    .bank-filter-card,
    .bank-action-bar,
    .bank-entry-modal,
    .du-sticky,
    .du-page-root [data-du-print],
    .du-page-root [data-du-edit-link],
    .du-page-root [data-du-view-link] {
        display: none !important;
    }

    .app-frame,
    .app-main,
    .app-content {
        display: block !important;
        min-height: auto !important;
    }

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

    .du-section-card,
    .du-report-section,
    .nozzle-card,
    .repeat-row,
    .du-stat-box {
        box-shadow: none !important;
        background: #fff !important;
    }
}

/* Hide table headers when a module table contains only the empty-state placeholder */
.table-card:has(tbody .empty-state) table thead,
.table-card table.is-empty thead {
    visibility: hidden;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.table-card:has(tbody .empty-state) table thead th,
.table-card table.is-empty thead th {
    display: none;
}

@media (max-width: 1199.98px) {

    .du-report-sidebar,
    .bank-toolbar,
    .bank-sticky,
    .du-sticky {
        position: static;
    }

    .bank-card-grid,
    .bank-list-skeleton-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 767.98px) {
    .module-shell.is-loading .table-card {
        min-height: 300px;
    }

    .du-info-grid {
        grid-template-columns: 1fr;
    }

    .du-nozzle-accordion .accordion-button {
        padding: 0.9rem 0.95rem;
    }

    .du-summary-pill {
        padding: 0.7rem 0.8rem;
    }

    .bank-card-grid,
    .bank-list-skeleton-grid {
        grid-template-columns: 1fr;
    }
}

.ledger-history-shell {
    max-width: 100%;
}

.ledger-history-shell .hero-card .app-action-toolbar {
    flex-wrap: wrap !important;
    justify-content: flex-end;
    width: 100%;
}

.ledger-history-shell .hero-card .app-action-toolbar>.btn {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.ledger-entry-modal .modal-content {
    border-radius: var(--radius-xl);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.ledger-entry-modal .form-label {
    font-weight: 600;
}

.ledger-entry-account-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(148, 163, 184, 0.08);
    padding: 0.9rem 1rem;
}

.ledger-entry-amount-field .input-group-text {
    color: #334155;
    font-weight: 700;
}

.ledger-entry-type-toggle .btn {
    min-height: 42px;
    font-weight: 700;
}

.ledger-entry-type-toggle .btn-check:checked+.btn {
    color: #fff;
}

.ledger-entry-type-toggle #ledgerEntryCredit:checked+.btn {
    background: #16a34a;
    border-color: #16a34a;
}

.ledger-entry-type-toggle #ledgerEntryDebit:checked+.btn {
    background: #dc2626;
    border-color: #dc2626;
}

.ledger-entry-payment-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    min-height: 38px;
    align-items: center;
}

.ledger-entry-payment-mode .form-check-input {
    margin-top: 0.2rem;
}

.ledger-history-shell .table-card {
    min-width: 0;
    overflow: hidden;
}

.ledger-history-shell .ledger-table-heading {
    gap: 1rem;
    min-width: 0;
}

.ledger-history-shell .ledger-table-heading>div:first-child {
    min-width: 0;
}

.ledger-history-shell .ledger-table-heading h5,
.ledger-history-shell .ledger-table-heading .small {
    overflow-wrap: anywhere;
}

.ledger-history-shell .ledger-table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.ledger-history-shell .ledger-history-table {
    width: 100%;
    min-width: 760px;
    table-layout: fixed;
}

.ledger-history-shell .ledger-history-table th,
.ledger-history-shell .ledger-history-table td {
    padding: 0.95rem 0.7rem;
    vertical-align: middle;
}

.ledger-history-shell .ledger-history-table th {
    font-size: 0.78rem;
}

.ledger-history-shell .ledger-history-table td {
    font-size: clamp(0.9rem, 1.6vw, 1rem);
}

.ledger-history-shell .ledger-history-table .badge {
    white-space: nowrap;
}

.ledger-history-shell .ledger-statement-table th:nth-child(1),
.ledger-history-shell .ledger-statement-table td:nth-child(1) {
    width: 165px;
    white-space: nowrap;
}

.ledger-history-shell .ledger-statement-table th:nth-child(2),
.ledger-history-shell .ledger-statement-table td:nth-child(2) {
    width: 125px;
    white-space: nowrap;
}

.ledger-history-shell .ledger-statement-table th:nth-child(3),
.ledger-history-shell .ledger-statement-table td:nth-child(3) {
    min-width: 240px;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    padding-right: 1.5rem !important;
}

.ledger-history-shell .ledger-statement-table th:nth-child(4),
.ledger-history-shell .ledger-statement-table td:nth-child(4) {
    width: 190px;
    white-space: nowrap;
    padding-left: 0.5rem !important;
}

.ledger-history-shell .ledger-statement-table th:nth-child(5),
.ledger-history-shell .ledger-statement-table td:nth-child(5) {
    width: 150px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ledger-history-shell .ledger-statement-table th:nth-child(6),
.ledger-history-shell .ledger-statement-table td:nth-child(6) {
    width: 110px;
    white-space: nowrap;
}

.ledger-history-shell .ledger-sales-table th:nth-child(1),
.ledger-history-shell .ledger-sales-table td:nth-child(1) {
    width: 140px;
    white-space: nowrap;
}

.ledger-history-shell .ledger-sales-table th:nth-child(2),
.ledger-history-shell .ledger-sales-table td:nth-child(2) {
    width: 120px;
    white-space: nowrap;
}

.ledger-history-shell .ledger-sales-table th:nth-child(3),
.ledger-history-shell .ledger-sales-table td:nth-child(3) {
    width: 200px;
    white-space: nowrap;
}

.ledger-history-shell .ledger-sales-table th:nth-child(4),
.ledger-history-shell .ledger-sales-table td:nth-child(4) {
    width: 120px;
    white-space: nowrap;
}

.ledger-history-shell .ledger-sales-table th:nth-child(5),
.ledger-history-shell .ledger-sales-table td:nth-child(5) {
    width: 110px;
    white-space: nowrap;
}

.ledger-history-shell .ledger-sales-table th:nth-child(6),
.ledger-history-shell .ledger-sales-table td:nth-child(6) {
    width: 135px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ledger-history-shell .ledger-sales-table th:nth-child(7),
.ledger-history-shell .ledger-sales-table td:nth-child(7) {
    width: 140px;
    white-space: nowrap;
}

@media (max-width: 767.98px) {

    .ledger-history-shell .hero-card .d-inline-flex,
    .ledger-history-shell [data-ledger-filter-form] .d-flex {
        width: 100%;
    }

    .ledger-history-shell .hero-card .btn,
    .ledger-history-shell [data-ledger-filter-form] .btn {
        flex: 1 1 auto;
    }

    .ledger-history-shell .ledger-table-heading {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .ledger-history-shell .ledger-table-heading .badge {
        align-self: flex-start;
    }

    .ledger-history-shell .ledger-history-table {
        min-width: 720px;
    }

    .ledger-history-shell .ledger-history-table th,
    .ledger-history-shell .ledger-history-table td {
        padding: 0.8rem 0.6rem;
    }
}

@media (max-width: 575.98px) {

    .ledger-history-shell .hero-card .d-inline-flex,
    .ledger-history-shell [data-ledger-filter-form] .d-flex {
        flex-direction: column;
    }

    .ledger-history-shell .hero-card .btn,
    .ledger-history-shell [data-ledger-filter-form] .btn {
        width: 100%;
    }
}

/* Enable horizontal table scrolling on mobile/tablet viewports instead of stacking columns */
@media (max-width: 991.98px) {
    .module-shell .table-card table {
        table-layout: auto !important;
        width: auto !important;
        min-width: 100% !important;
    }
}

@media (max-width: 767.98px) {

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        width: 100% !important;
        text-align: center !important;
        margin: 0.5rem 0 !important;
        display: block !important;
    }

    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter label {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 100% !important;
    }

    .dataTables_wrapper .dataTables_filter label {
        margin: 0 !important;
        padding: 0 1rem;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .dataTables_wrapper .dataTables_length select {
        width: auto !important;
        margin: 0 0.5rem !important;
        display: inline-block !important;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center !important;
        float: none !important;
        margin: 0.5rem 0 !important;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        width: 100% !important;
    }
}

/* Make all page header cards smaller and consistent */
.hero-card.p-4.p-lg-5.mb-4,
.module-toolbar.p-4.p-lg-5.mb-4,
.dashboard-section.p-4.p-lg-5.mb-4,
.shifts-hero.p-4.p-lg-5.mb-4,
.du-hero.p-4.p-lg-5.mb-4 {
    padding: 1.25rem 1.5rem !important;
    margin-bottom: 1rem !important;
}

@media (max-width: 991.98px) {

    .hero-card.p-4.p-lg-5.mb-4,
    .module-toolbar.p-4.p-lg-5.mb-4,
    .dashboard-section.p-4.p-lg-5.mb-4,
    .shifts-hero.p-4.p-lg-5.mb-4,
    .du-hero.p-4.p-lg-5.mb-4 {
        padding: 1rem 1.25rem !important;
        margin-bottom: 0.75rem !important;
    }
}

/* Clickable table rows in Khatabook */
.clickable-row {
    cursor: pointer;
}

/* Khatabook (Ledgers) Table Specific UI Styling */
.module-ledgers .table-card {
    border-radius: 20px !important;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05) !important;
    border: 1px solid var(--border) !important;
    background: var(--surface-strong) !important;
}

.module-ledgers #ledgersTable {
    background: var(--surface-strong) !important;
    width: 100% !important;
    table-layout: auto !important;
}

/* Hide any phantom DataTables scrollbar-compensation columns */
.module-ledgers .dataTables_scrollHeadInner thead th:empty,
.module-ledgers .dataTables_scrollHead thead th:empty {
    display: none !important;
    width: 0 !important;
    padding: 0 !important;
    border: none !important;
}


.module-ledgers #ledgersTable thead th {
    background: rgba(17, 67, 155, 0.02) !important;
    padding: 1.15rem 1.25rem !important;
    border-bottom: 2px solid var(--border) !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
}

.module-ledgers #ledgersTable tbody tr {
    transition: all 0.2s ease;
}

.module-ledgers #ledgersTable tbody tr td {
    padding: 1.25rem 1.25rem !important;
    border-bottom: 1px solid var(--border) !important;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.module-ledgers #ledgersTable th:first-child,
.module-ledgers #ledgersTable td:first-child {
    min-width: 200px !important;
    white-space: normal !important;
}

/* Address column — keep compact with truncated chip */
.module-ledgers #ledgersTable th:nth-child(3),
.module-ledgers #ledgersTable td:nth-child(3) {
    min-width: 160px !important;
    max-width: 200px !important;
    white-space: nowrap;
}

/* Phone column */
.module-ledgers #ledgersTable th:nth-child(2),
.module-ledgers #ledgersTable td:nth-child(2) {
    min-width: 130px !important;
    white-space: nowrap;
}

/* GST / PAN columns */
.module-ledgers #ledgersTable th:nth-child(4),
.module-ledgers #ledgersTable td:nth-child(4),
.module-ledgers #ledgersTable th:nth-child(5),
.module-ledgers #ledgersTable td:nth-child(5) {
    min-width: 120px !important;
    white-space: nowrap;
}

/* Balance column */
.module-ledgers #ledgersTable th:nth-child(6),
.module-ledgers #ledgersTable td:nth-child(6) {
    min-width: 110px !important;
    white-space: nowrap;
    text-align: right;
}

/* Actions column */
.module-ledgers #ledgersTable th:last-child,
.module-ledgers #ledgersTable td:last-child {
    min-width: 200px !important;
    white-space: nowrap;
}

/* Address chip */
.ledger-address-chip {
    background: #f1f5f9;
    color: #0f172a;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    display: inline-flex !important;
}

.module-ledgers #ledgersTable td:first-child a {
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

.module-ledgers #ledgersTable tbody tr:hover td {
    background-color: rgba(17, 67, 155, 0.03) !important;
}

.module-ledgers #ledgersTable tbody tr:hover td:first-child {
    border-left-color: var(--brand-blue) !important;
}

[data-theme="dark"] .module-ledgers .table-card {
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.3) !important;
}

[data-theme="dark"] .module-ledgers #ledgersTable thead th {
    background: rgba(255, 255, 255, 0.01) !important;
}

/* ==========================================
   VAT Summary Premium UI Redesign
   ========================================== */
.vat-summary-page .premium-hero-card {
    background: var(--surface-strong) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    box-shadow: var(--shadow) !important;
    position: relative;
    overflow: hidden;
}

.vat-summary-page .premium-hero-card::before {
    display: none !important;
}

.vat-summary-page .premium-hero-card .page-title {
    color: var(--text) !important;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.vat-summary-page .premium-hero-card .page-subtitle {
    color: var(--muted) !important;
    font-size: 0.95rem;
}

/* Hero card action buttons */
/* Let buttons fall back to standard blue branding */

/* Premium Stats Cards */
.vat-summary-page .premium-card {
    background: var(--surface-strong);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-xl);
    padding: 1.15rem 1rem !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.03), 0 0 20px rgba(17, 67, 155, 0.01) !important;
    min-height: 120px;
}

.vat-summary-page .premium-card .stats-value {
    font-size: clamp(1.2rem, 1.7vw, 1.55rem) !important;
}

.vat-summary-page .premium-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -8px rgba(15, 23, 42, 0.12), 0 0 30px rgba(17, 67, 155, 0.04) !important;
    border-top-color: rgba(15, 118, 110, 0.2) !important;
    border-right-color: rgba(15, 118, 110, 0.2) !important;
    border-bottom-color: rgba(15, 118, 110, 0.2) !important;
}

.vat-summary-page .premium-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vat-summary-page .premium-card:hover .premium-icon-wrap {
    transform: scale(1.1) rotate(6deg);
}

/* Left highlights for stats cards */
.vat-summary-page .card-vat-payable {
    border-left: 4px solid var(--primary) !important;
}

.vat-summary-page .card-profit-loss {
    border-left: 4px solid #10b981 !important;
}

.vat-summary-page .card-purchases-vat {
    border-left: 4px solid #3b82f6 !important;
}

.vat-summary-page .card-excise-paid {
    border-left: 4px solid #f59e0b !important;
}

.vat-summary-page .card-cess-paid {
    border-left: 4px solid #ef4444 !important;
}

.vat-summary-page .card-purchase-value {
    border-left: 4px solid #6366f1 !important;
}

.vat-summary-page .card-fuel-sold {
    border-left: 4px solid #0ea5e9 !important;
}

/* Premium gradient hovers for VAT stats cards */
/* .vat-summary-page .card-vat-payable:hover {
    background: linear-gradient(135deg, var(--surface-strong), rgba(15, 118, 110, 0.04)) !important;
}
.vat-summary-page .card-profit-loss:hover {
    background: linear-gradient(135deg, var(--surface-strong), rgba(16, 185, 129, 0.04)) !important;
}
.vat-summary-page .card-fuel-sold:hover {
    background: linear-gradient(135deg, var(--surface-strong), rgba(14, 165, 233, 0.04)) !important;
}
.vat-summary-page .card-purchases-vat:hover {
    background: linear-gradient(135deg, var(--surface-strong), rgba(59, 130, 246, 0.04)) !important;
}
.vat-summary-page .card-excise-paid:hover {
    background: linear-gradient(135deg, var(--surface-strong), rgba(245, 158, 11, 0.04)) !important;
}
.vat-summary-page .card-cess-paid:hover {
    background: linear-gradient(135deg, var(--surface-strong), rgba(239, 68, 68, 0.04)) !important;
}
.vat-summary-page .card-purchase-value:hover {
    background: linear-gradient(135deg, var(--surface-strong), rgba(99, 102, 241, 0.04)) !important;
} */

/* Premium Form Input, Select, and Button Styling for VAT Summary & DIP Page */
.vat-summary-page .form-control,
.vat-summary-page .form-select,
.dip-page .form-control,
.dip-page .form-select {
    border-radius: 12px !important;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vat-summary-page .form-control:focus,
.vat-summary-page .form-select:focus,
.dip-page .form-control:focus,
.dip-page .form-select:focus {
    border-color: var(--brand-blue) !important;
    box-shadow: 0 0 0 4px rgba(17, 67, 155, 0.12) !important;
    background: var(--surface);
}

[data-theme="dark"] .vat-summary-page .form-control:focus,
[data-theme="dark"] .vat-summary-page .form-select:focus,
[data-theme="dark"] .dip-page .form-control:focus,
[data-theme="dark"] .dip-page .form-select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18) !important;
}

.vat-summary-page .btn,
.dip-page .btn {
    border-radius: 12px !important;
    padding: 0.6rem 1.25rem !important;
    font-size: 0.95rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.vat-summary-page .btn:active,
.dip-page .btn:active {
    transform: scale(0.98);
}

/* Soft background variations for icon containers */
.bg-primary-soft {
    background-color: rgba(15, 118, 110, 0.08) !important;
}

.bg-success-soft {
    background-color: rgba(16, 185, 129, 0.08) !important;
}

.bg-info-soft {
    background-color: rgba(59, 130, 246, 0.08) !important;
}

.bg-warning-soft {
    background-color: rgba(245, 158, 11, 0.08) !important;
}

.bg-danger-soft {
    background-color: rgba(239, 68, 68, 0.08) !important;
}

.bg-indigo-soft {
    background-color: rgba(99, 102, 241, 0.08) !important;
}

/* Premium Table Redesign */
.vat-summary-page .table-card table thead th {
    background: var(--surface-strong) !important;
    color: var(--muted) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border) !important;
    padding: 1.1rem 0.85rem;
}

.vat-summary-page .table-card table tbody tr {
    transition: background-color 0.2s ease;
}

.vat-summary-page .table-card table tbody tr:hover {
    background-color: rgba(15, 118, 110, 0.03) !important;
}

.vat-summary-page .table-card table {
    table-layout: auto !important;
}

.vat-summary-page .table-card table tbody td {
    padding: 1.1rem 0.85rem;
    border-bottom: 1px solid var(--border);
}

.vat-summary-page .table-card table th,
.vat-summary-page .table-card table td {
    white-space: nowrap !important;
}

/* Mobile optimizations */
@media (max-width: 575.98px) {
    .vat-summary-page .premium-card {
        padding: 1rem 0.85rem !important;
        min-height: 105px !important;
    }

    .vat-summary-page .premium-icon-wrap {
        width: 38px;
        height: 38px;
        border-radius: 9px;
        font-size: 1.05rem;
    }

    .vat-summary-page .premium-card .stats-value {
        font-size: 1.35rem !important;
    }
}

/* Compact styling for CRUD modal forms */
#crudModal .modal-body {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

#crudModal .form-label {
    margin-bottom: 0.2rem;
    font-size: 0.82rem;
    font-weight: 600;
}

#crudModal .form-control,
#crudModal .form-select,
#crudModal .input-group-text {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

#crudModal .form-text {
    margin-top: 0.1rem;
    font-size: 0.72rem;
    line-height: 1.25;
}

#crudModal .col-md-3,
#crudModal .col-md-4,
#crudModal .col-md-6,
#crudModal .col-md-12 {
    margin-bottom: 0.5rem !important;
}

#crudModal .row.g-3 {
    --bs-gutter-y: 0.5rem !important;
}

/* Image Preview Styling */
.hover-scale {
    transition: transform 0.2s ease-in-out;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.cursor-pointer {
    cursor: pointer;
}

/* SweetAlert Image Preview Modal Improvements */
.swal2-popup {
    max-width: 90vw !important;
}

.max-vh-75 {
    max-height: 70vh !important;
    object-fit: contain;
}

/* Tank-wise Split UI Custom Styles */
.tank-split-card {
    border-radius: 16px !important;
    transition: all 0.3s ease;
}

.multi-tank-row {
    transition: all 0.2s ease;
}

.multi-tank-row .form-select,
.multi-tank-row .form-control {
    border-radius: 12px !important;
    background-color: var(--surface-strong) !important;
    border: 1px solid var(--border) !important;
    transition: all 0.15s ease-in-out;
}

.multi-tank-row .form-select:focus,
.multi-tank-row .form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.15rem rgba(15, 118, 110, 0.15) !important;
}

.btn-remove-tank {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    color: #ef4444 !important;
    background: transparent;
    border: none;
    transition: all 0.2s ease;
}

.btn-remove-tank:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    transform: scale(1.08);
}

.btn-add-tank {
    border-radius: 999px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    padding: 0.5rem 1.25rem !important;
    color: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
    transition: all 0.2s ease;
}

.btn-add-tank:hover {
    background-color: var(--brand-blue) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(17, 67, 155, 0.15);
}

.summary-pill {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.16) !important;
    color: #059669 !important;
    font-weight: 700;
}

[data-theme="dark"] .summary-pill {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
}

@media (min-width: 768px) {
    .split-toggle-container {
        height: 48px;
        display: inline-flex !important;
        align-items: center !important;
        margin-top: 0 !important;
        padding-left: 0 !important;
    }

    .split-toggle-container .form-check-input {
        margin-top: 0 !important;
        margin-left: 0 !important;
        margin-right: 8px !important;
        float: none !important;
    }

    .split-toggle-container .form-check-label {
        padding-top: 0 !important;
    }
}

/* Fix text overlap in Bank accounts listing table */
.module-banks #banksTable {
    table-layout: auto !important;
}

.module-banks #banksTable td[data-label="Bank"],
.module-banks #banksTable td[data-label="Account Holder"],
.module-banks #banksTable td[data-label="Branch"] {
    white-space: normal !important;
    word-break: break-word;
    min-width: 160px;
}