/* SCRT - Store Cash Reconciliation Tool - Theme CSS */
/* ============================================= */
/* Design tokens live in static/css/tokens.css. Consume only — never redefine. */

/* Global Styles */
* {
    font-family: var(--font-primary);
}

body {
    background-color: var(--content-bg);
    color: #212529;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global Bootstrap Dropdown Fix - Ensure dropdowns always overlay content */
.dropdown {
    position: relative !important;
}

.dropdown-menu {
    position: absolute !important;
    z-index: 9999 !important; /* Increased from 1050 to ensure it's above everything */
    display: none;
}

.dropdown-menu.show {
    display: block !important;
}

/* Ensure proper dropdown positioning - let Bootstrap handle positioning */
.dropdown-menu[data-bs-popper] {
    top: 100%;
    left: auto;
    right: 0;
    margin-top: 0.125rem;
}

/* Prevent any parent containers from clipping dropdowns */
.card, .card-header, .card-body {
    overflow: visible !important;
}

/* Remove z-index from cards to prevent stacking issues */
.card {
    z-index: auto !important;
}

.card:hover {
    z-index: auto !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #212529;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Dashboard Header Styles */
/* CORE TENET: All page headers use consistent black text (#212529) for readability and visual consistency */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    color: #212529; /* Standard black for all headers */
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    color: #6c757d;
    font-size: 1.125rem;
    margin-bottom: 0;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #212529; /* Standard black for all headers - matching dashboard-title */
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title i {
    font-size: 1.75rem;
    opacity: 0.8;
}

.page-subtitle {
    color: #6C757D;
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

/* Enhanced page content area */
.page-content-area {
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
}

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

/* Sidebar Modernization */
.app-sidebar {
    background: var(--sidebar-bg);
    width: 260px;
    transition: all var(--transition-normal);
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.app-sidebar.collapsed {
    width: 70px;
}

.sidebar-brand {
    padding: 1rem;
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    justify-content: flex-start;
}

.sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: var(--napa-yellow);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--napa-blue);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--napa-yellow);
    white-space: nowrap;
    line-height: 1;
}

.app-sidebar.collapsed .sidebar-brand {
    justify-content: center;
}

.app-sidebar.collapsed .brand-text {
    display: none;
}

/* Navigation Menu */
.app-sidebar .nav {
    padding: 1rem 0;
}

.nav-section-title {
    padding: 0.75rem 1.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    text-align: left;
}

.app-sidebar.collapsed .nav-section-title {
    display: none;
}

.app-sidebar .nav {
    padding: 0;
}

/* aria-tooltips.js wraps every title="" element in <span class="tt-wrap">
   (inline-block, shrinks to content). Sidebar nav-links carry title= for
   the collapsed-mode tooltip, so they get wrapped — which made the yellow
   active pill end up variable width based on label length (Dashboard 174px
   vs Drawer Actions 202px in a 250px sidebar). Force the wrap to block
   inside the sidebar so all pills are uniform. */
.app-sidebar .tt-wrap {
    display: block;
}

.app-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1.25rem;
    margin: 0 0.5rem 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.app-sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: white;
}

.app-sidebar .nav-link.active {
    background: var(--napa-yellow);
    color: var(--napa-blue);
    font-weight: 600;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    padding-left: 1.25rem;
    border-radius: 6px;
}

/* Removed the blue bar on active nav items for cleaner look with full rounded corners */

.app-sidebar .nav-link .nav-icon {
    font-size: 1.25rem;
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.app-sidebar .nav-link .nav-text {
    margin-left: 0.75rem;
}

.app-sidebar.collapsed .nav-link {
    justify-content: center;
    margin: 0 0.25rem 0.25rem;
}

.app-sidebar.collapsed .nav-link .nav-text {
    display: none;
}

/* Collapsible Sub-menus */
.app-sidebar .collapse .nav-link.sub-nav-link {
    padding-left: 3rem;
    font-size: 0.875rem;
}

.app-sidebar .collapse .nav-link.sub-nav-link .nav-icon {
    font-size: 1rem;
}

/* Main Content Area */
.main-content {
    background-color: var(--content-bg);
}

/* Header Modernization */
.app-header {
    background: white;
    padding: 1rem 2rem 1rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 1020; /* Higher than content (1000) but lower than modals (1050) */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

/* Ensure page content doesn't overlap header */
.page-content-area {
    position: relative;
    z-index: 1;
}

/* Fix for any absolutely positioned elements in content */
.page-content-area .card,
.page-content-area .drawer-info-header,
.page-content-area .page-header,
.page-content-area [style*="position: relative"],
.page-content-area [style*="position: absolute"] {
    z-index: auto !important;
    position: relative !important;
}

.header-left .breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6C757D;
}

/* Store Selector */
.store-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--content-bg);
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
    margin-right: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.store-selector:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.store-selector .store-icon {
    color: var(--napa-blue);
    font-size: 1rem;
}

.store-selector .store-text {
    font-weight: 600;
    font-size: 0.875rem;
    color: #212529;
}

.store-selector .store-change {
    color: #6c757d;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.store-selector.active .store-change {
    transform: rotate(180deg);
}

/* Store Dropdown */
.store-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: auto;
    right: 0px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
    min-width: 320px;
    max-width: 400px;
    max-height: 400px;
    overflow: hidden;
    display: none;
    z-index: 1000;
}

.store-selector.active .store-dropdown {
    display: block;
}

.store-search {
    padding: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.store-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.store-search input:focus {
    outline: none;
    border-color: var(--napa-blue);
    box-shadow: 0 0 0 3px rgba(10, 0, 148, 0.1);
}

.store-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.25rem;
}

/* Custom scrollbar for store list */
.store-list::-webkit-scrollbar {
    width: 6px;
}

.store-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.store-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.store-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.store-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.store-item:hover {
    background: var(--scrt-yellow);
    color: var(--scrt-dark-blue);
}

.store-item:hover .store-name {
    color: var(--scrt-dark-blue);
}

.store-item:hover .store-address {
    color: #444;
}

.store-item.active {
    background: #FFF9E6; /* Light yellow background */
    color: #533001; /* Dark brown text */
    border-left: 3px solid #FFC836; /* Yellow accent border */
}

.store-item .store-info {
    flex: 1;
}

.store-item .store-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #212529;
    margin-bottom: 0.125rem;
}

.store-item .store-address {
    font-size: 0.75rem;
    color: #6c757d;
}

.store-item .check-icon {
    color: var(--napa-blue);
    font-size: 1rem;
    display: none;
}

.store-item.active .check-icon {
    display: block;
}

/* User Menu */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--napa-blue), #2b2ba0);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--napa-blue), #2b2ba0);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

/* Cards */
.card {
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    transition: all var(--transition-base);
    position: relative; /* Establish positioning context */
}

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

.card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--napa-blue);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 1.125rem;
    color: #212529;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Remove position: relative to prevent trapping dropdowns */
}

.card-header .d-flex {
    gap: 0.5rem;
}

.card-header .dropdown {
    display: inline-block;
    position: relative; /* Keep dropdown positioning context */
}

/* Ensure dropdowns in card headers appear above everything */
.card-header .dropdown-menu {
    position: absolute !important;
    z-index: 9999 !important;
}

.card-body {
    padding: 1.5rem;
}

/* Dashboard KPI Cards - Enhanced Integration with modern-components.css */
.dashboard-stats .stat-card {
    text-align: center;
    padding: 1.75rem;
    height: 100%;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.dashboard-stats .stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

/* Icon styling for dashboard stats */
.dashboard-stats .stat-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--scrt-yellow) 0%, #FFD863 100%);
    color: var(--scrt-blue);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.25rem;
    box-shadow: 0 4px 8px rgba(255, 200, 54, 0.3);
    transition: all 0.3s ease;
}

.dashboard-stats .stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.dashboard-stats .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--scrt-blue);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.dashboard-stats .stat-label {
    color: #6C757D;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-stats .stat-change {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
}

.dashboard-stats .stat-change.positive {
    color: var(--success-green);
    background: rgba(40, 167, 69, 0.1);
}

.dashboard-stats .stat-change.negative {
    color: var(--danger-red);
    background: rgba(220, 53, 69, 0.1);
}

/* Tables - moved to consolidated section below */

/* Table base styling */
.table-responsive .table {
    margin-bottom: 0;
    min-width: 100%;
}

/* Fix for table row shifting - matching UI mockup */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--content-bg);
    border-bottom: 2px solid #DEE2E6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #6C757D;
    padding: 12px;
}

.table tbody td {
    padding: 16px 12px;
    vertical-align: middle;
}

/* Remove hover effect to match UI mockup */
.table tbody tr {
    background-color: white;
}

/* Remove all table hover effects */
.table tbody tr:hover {
    background-color: white;
}

/* Active Drawers Table Specific Fix - moved to consolidated section below */

#dashboard-page .table {
    table-layout: fixed;
    width: 100%;
}

#dashboard-page .table th:nth-child(1) { width: 10%; }  /* Drawer ID */
#dashboard-page .table th:nth-child(2) { width: 25%; }  /* Employee */
#dashboard-page .table th:nth-child(3) { width: 12%; }  /* Status */
#dashboard-page .table th:nth-child(4) { width: 12%; }  /* Morning Count */
#dashboard-page .table th:nth-child(5) { width: 12%; }  /* Current Total */
#dashboard-page .table th:nth-child(6) { width: 12%; }  /* Variance */
#dashboard-page .table th:nth-child(7) { width: 17%; }  /* Actions */

/* Status Badges */
.badge {
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    font-size: 0.75rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: #D4EDDA;
    color: #155724;
}

.badge-warning {
    background: #FFF3CD;
    color: #856404;
}

.badge-danger {
    background: #F8D7DA;
    color: #721C24;
}

.badge-info {
    background: #D1ECF1;
    color: #0C5460;
}

.badge-primary {
    background: rgba(0, 20, 137, 0.1);
    color: var(--napa-blue);
}

/* Forms - Enhanced Styling */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/*
 * Form input + select baseline (Variant A — "stronger border + light fill").
 *
 * Previous: `1px solid #CED4DA` border + `#FFFFFF` fill — reads as static
 * text against most card backgrounds (e.g. the Safe Count "Count Type"
 * dropdown was barely distinguishable from surrounding labels).
 *
 * Variant A: 1.5px medium-gray border + `#f8f9fa` fill so the control
 * always reads as "interactive input" at a glance. On hover the fill
 * lifts to pure white + border darkens; on focus the brand-blue ring
 * appears.
 *
 * Explicitly NOT applied to the bill/coin denomination grid — the
 * `.cash-input-item input` selector in `static/css/safe_count.css` has
 * higher specificity and keeps the card-as-affordance treatment.
 */
.form-control, .form-select {
    border: 1.5px solid #ADB5BD;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
    background-color: #f8f9fa;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Variant A chevron — darker stroke + bumped weight so the dropdown
   arrow doesn't get lost against the lighter fill. The right-padding
   reserves space for the 16px chevron + a comfortable gap so the
   arrow never overlaps the selected option text (matters most when
   `width: auto` shrinks the box to fit the option). */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23212529' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

.form-select-sm {
    padding-right: 2rem;
    background-position: right 0.75rem center;
}

/* Hover — fill lifts to white, border darkens. */
.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) {
    border-color: #6C757D;
    background-color: #FFFFFF;
}

/* Focus — NAPA-blue border + soft outer ring. */
.form-control:focus, .form-select:focus {
    border-color: var(--scrt-blue);
    background-color: #FFFFFF;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 0.2rem rgba(10, 0, 148, 0.15);
    outline: 0;
}

.form-control::placeholder {
    color: #6C757D;  /* Darker placeholder for better contrast */
    font-weight: 400;
}

/* Disabled state - clearly different from active inputs */
.form-control:disabled, .form-select:disabled {
    background-color: #F8F9FA;
    border-color: #DEE2E6;
    color: #6C757D;
    box-shadow: none;
    cursor: not-allowed;
}

/* Optional: Enhanced visibility class for critical inputs */
.form-control-enhanced {
    border-width: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-control-enhanced:hover:not(:focus):not(:disabled) {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-control-enhanced:focus {
    border-width: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 0.2rem rgba(10, 0, 148, 0.15);
}

/* Variant A input-group: the whole group is one bordered pill so the
   addon icon and the input read as a single control. Border lives on
   the parent; the children are borderless. Avoids the 1.5px/2px border
   mismatch that left a visible seam between the lavender icon box and
   the gray-bordered input. */
.input-group {
    position: relative;
    border: 1.5px solid #ADB5BD;
    border-radius: 0.75rem;
    background-color: #F8F9FA;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.input-group:hover:not(:focus-within) {
    border-color: #6C757D;
    background-color: #FFFFFF;
}

.input-group:focus-within {
    border-color: var(--scrt-blue);
    background-color: #FFFFFF;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 0.2rem rgba(10, 0, 148, 0.15);
}

.input-group-text {
    background-color: var(--scrt-light-blue-bg);
    border: 0;
    border-radius: 0;
    font-size: 0.9375rem;
    color: var(--scrt-blue);
    font-weight: 600;
    padding: 0.75rem 1rem;
}

.input-group .form-control,
.input-group .form-select {
    border: 0;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
}

.input-group .form-control:focus,
.input-group .form-select:focus {
    border: 0;
    background-color: transparent;
    box-shadow: none;
    /* Focus ring is rendered by the parent .input-group:focus-within above */
}

/* Custom checkbox and radio styles */
.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: var(--scrt-blue);
    border-color: var(--scrt-blue);
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(10, 0, 148, 0.1);
}

/* Buttons - Enhanced with Modern Styling */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
}

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

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--scrt-blue) 0%, var(--scrt-light-blue) 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(10, 0, 148, 0.15);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--scrt-dark-blue) 0%, var(--scrt-blue) 100%);
    color: white;
    box-shadow: 0 8px 16px rgba(10, 0, 148, 0.25);
}

.btn-warning {
    background: linear-gradient(135deg, var(--scrt-yellow) 0%, #FFD863 100%);
    color: var(--scrt-dark-blue);
    box-shadow: 0 4px 6px rgba(255, 200, 54, 0.2);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #F4B400 0%, var(--scrt-yellow) 100%);
    color: var(--scrt-dark-blue);
    box-shadow: 0 8px 16px rgba(255, 200, 54, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-green) 0%, #5CB85C 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(40, 167, 69, 0.15);
}

.btn-success:hover {
    box-shadow: 0 8px 16px rgba(40, 167, 69, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-red) 0%, #E57373 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(220, 53, 69, 0.15);
}

.btn-danger:hover {
    box-shadow: 0 8px 16px rgba(220, 53, 69, 0.25);
}

.btn-outline-primary {
    color: var(--scrt-blue);
    border: 2px solid var(--scrt-blue);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--scrt-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(10, 0, 148, 0.2);
}

/* Small button specific styling to prevent shifting */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    border-width: 1px !important;
}

/* Ensure outline buttons have consistent borders */
.btn-outline-primary,
.btn-outline-secondary {
    border-width: 1px !important;
}

/* Prevent any transform or scale on hover */
.btn:hover {
    transform: none !important;
}

/* Ensure table buttons maintain exact size */
.table .btn {
    min-width: 80px;
    text-align: center;
}

/* Table responsive scrolling - proper implementation.
   Default state is `overflow-x: clip` (no scroll context at all). The shim in
   static/js/responsive-table-overflow.js measures each table at load + on
   resize and adds `.has-x-overflow` when content actually exceeds the
   container, which then promotes the element back to `overflow-x: auto`.
   This kills the false-positive horizontal scrollbar flash on hover that
   appeared whenever subpixel layout caused scrollWidth to exceed clientWidth
   by a fraction of a pixel. */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: clip;
    overflow-y: visible; /* Allow dropdowns to escape vertically */
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.table-responsive.has-x-overflow {
    overflow-x: auto;
}

.table-responsive > .table {
    margin-bottom: 0;
}

/* Remove any overflow indicators or arrows */
.table-responsive::after,
.table-responsive::before {
    display: none !important;
    content: none !important;
}

/* Ensure no arrows appear on table cells */
.table-responsive table td::after,
.table-responsive table th::after,
.table-responsive table tr::after {
    display: none !important;
    content: none !important;
}

/* Custom scrollbar styling for tables. Higher-contrast thumb so the bar is
   visible against the white card backgrounds where these tables live (the
   previous #6c757d on #f8f9fa pair was too faint to spot at 8px). Firefox
   gets the equivalent via scrollbar-width / scrollbar-color. */
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: #0A0094 #e9ecef;
}

.table-responsive::-webkit-scrollbar {
    height: 10px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #0A0094;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #07006e;
}

/* Dashboard page exception - keep overflow visible for dropdowns */
#dashboard-page .active-drawers-section .table-responsive {
    overflow: visible !important;
}

/* Hide any Bootstrap table responsive indicators */
.table-responsive .table td:last-child::after,
.table-responsive .table th:last-child::after {
    display: none !important;
}

/* Remove any text overflow indicators */
.table td, .table th {
    overflow: hidden;
    text-overflow: clip;
}

/* Mobile specific adjustments */
@media (max-width: 767.98px) {
    .table-responsive {
        border: 1px solid #dee2e6;
        border-radius: 0.25rem;
    }
}

/* Remove all hover effects from table rows globally */
.table tbody tr,
.table tbody tr:hover,
.table-hover tbody tr:hover,
.table-striped tbody tr:nth-of-type(odd),
.table-striped tbody tr:nth-of-type(even) {
    background-color: transparent !important;
    transition: none !important;
}

/* Force white background on all table rows */
.table tbody tr td {
    background-color: white !important;
}

/* Specific fix for drawer actions table */
.drawer-actions-table {
    max-height: none !important;
    height: auto !important;
}

.drawer-actions-table::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for Firefox */
.drawer-actions-table {
    scrollbar-width: none;
}

/* Hide scrollbar for IE/Edge */
.drawer-actions-table {
    -ms-overflow-style: none;
}

/* Ensure consistent table cell sizing */
.table td, .table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

/* Fix any potential box-sizing issues */
.table * {
    box-sizing: border-box;
}

/* Drawer Count Forms */
.denomination-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.denomination-item {
    background: var(--content-bg);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #E9ECEF;
}

.denomination-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
}

.denomination-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.total-display {
    background: var(--napa-yellow);
    color: var(--napa-blue);
    padding: 1.25rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Variance Display */
.variance-card {
    border: 2px solid;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all var(--transition-fast);
}

.variance-card.balanced {
    border-color: var(--success-green);
    background: #D4EDDA;
}

.variance-card.over {
    border-color: var(--info-blue);
    background: #D1ECF1;
}

.variance-card.short {
    border-color: var(--danger-red);
    background: #F8D7DA;
}

/* Safe Count Section */
.safe-status {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.safe-status-item {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.safe-status-item h6 {
    color: #6C757D;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.safe-status-item .h3 {
    margin-bottom: 0.25rem;
}

/* Loading Indicators */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 0.2em;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
}

.toast {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-header {
    background: var(--napa-blue);
    color: white;
    border-radius: 8px 8px 0 0;
}

.toast-header .btn-close {
    filter: invert(1);
}

/* Alert Improvements */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
}

.alert-success {
    background: #D4EDDA;
    color: #155724;
}

.alert-danger {
    background: #F8D7DA;
    color: #721C24;
}

.alert-warning {
    background: #FFF3CD;
    color: #856404;
}

.alert-info {
    background: #D1ECF1;
    color: #0C5460;
}

/* Quick Actions - Enhanced Style */
.quick-action-card {
    text-align: center;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    background: white;
    border-radius: 1rem;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

/* Radial-gradient overlay removed (2026-05-26) — was competing with the
   left-strip ::before in components.css and with the cleaner ring-border
   hover decided on in docs/mockups/dashboard_hover/. The hover rule below
   loses the cascade to components.css (which !importants border-color
   #0A0094 + a darker shadow), so this block is now effectively a dead
   ruleset that ran only when components.css was unloaded. Left here as a
   single hover-state rule for cascade-fallback safety. */

.quick-action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--scrt-light-blue-bg);
}

/* Commented out - This was causing icons to be invisible
.quick-action-icon {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--scrt-blue) 0%, var(--scrt-light-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.25rem;
    transition: transform 0.3s ease;
}
*/

.quick-action-card:hover .quick-action-icon {
    transform: scale(1.1);
}

.quick-action-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 0.5rem;
}

.quick-action-description {
    font-size: 0.875rem;
    color: var(--color-gray-600);
    margin-bottom: 0;
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Fix for Bootstrap fade/show conflicts */
.fade.show {
    opacity: 1 !important;
}

/* Carve-out: modal backdrops are intentionally translucent so the dialog
   feels layered over the dimmed page. The blanket `.fade.show` rule above
   was forcing them to fully opaque black, which read as a "broken modal"
   (page entirely black, dialog barely distinguishable). */
.modal-backdrop.fade.show {
    opacity: var(--bs-backdrop-opacity, 0.5) !important; /* allow-important: overrides the broader .fade.show !important rule above */
}

/* Ensure main content is always visible */
.page-content-area {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Sidebar hamburger trigger (tablet only) */
.sidebar-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--napa-blue, #0A0094);
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.5rem 0.6rem;
    margin-right: 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}
.sidebar-hamburger:hover,
.sidebar-hamburger:focus-visible {
    background: rgba(10, 0, 148, 0.08);
    outline: none;
}

.header-left {
    display: flex;
    align-items: center;
}

/* Backdrop shown when the off-canvas sidebar is open on tablet */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        height: 100%;
        z-index: 1000;
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }

    .sidebar-hamburger {
        display: inline-flex;
    }

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

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

    .safe-status {
        flex-direction: column;
    }

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

/* Print Styles */
@media print {
    .app-sidebar,
    .app-header,
    .btn,
    .alert {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #DEE2E6 !important;
    }
    
    .page-content-area {
        padding: 0 !important;
    }
}

/* Additional fixes and utilities consolidated from other files */

/* Main content scroll fix */
.page-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    z-index: 1; /* Below header */
}

/* Store selection visibility fix */
.page-content-area .row.justify-content-center {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.page-content-area .col-md-6 {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Custom Popup Styles for Modals */
.custom-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    animation: fadeIn 0.2s ease;
}

.custom-popup.show {
    display: block !important;
}

.custom-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.custom-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    z-index: 2;
    animation: slideIn 0.3s ease;
}

.custom-popup-header {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-popup-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.custom-popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.custom-popup-close:hover {
    opacity: 1;
}

.custom-popup-body {
    padding: 1.5rem;
}

.custom-popup-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.page-content-area .card {
    position: relative !important;
    z-index: 1000 !important;
    background-color: white !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.page-content-area .card-body,
.page-content-area .card-header {
    position: relative !important;
    z-index: 1001 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Remove any overlays */
.page-content-area::before,
.page-content-area::after,
.card::before,
.card::after {
    display: none !important;
}

/* Text utilities */
.text-danger {
    color: #dc3545 !important;
}

.text-primary {
    color: #0d6efd !important;
}

.text-success {
    color: #198754 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-muted {
    color: #6c757d !important;
}

.text-center {
    text-align: center !important;
}

.text-end {
    text-align: right !important;
}

.fw-bold {
    font-weight: 600 !important;
}

.small {
    font-size: 0.8125rem;
}

/* Petty Cash Widget Breakdown */
.petty-cash-breakdown {
    background-color: rgba(248, 249, 250, 0.5);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
}

.petty-cash-breakdown .border-bottom {
    border-color: rgba(0, 0, 0, 0.1) !important;
}

.petty-cash-breakdown span {
    line-height: 1.5;
}

.petty-cash-breakdown .text-danger {
    font-weight: 500;
}

/*
   CSS-Driven Animation for a Flicker-Free Experience
   ====================================================
*/

/*
 * Initial state for elements that will be animated.
 * They start invisible and slightly moved down.
 * The 'will-change' property is a performance optimization hint for browsers.
*/
.card, .stat-card, .quick-action-card {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    will-change: opacity, transform;
}

/*
 * Final (visible) state. When the '.fade-in' class is added by JavaScript,
 * the element smoothly transitions to full opacity and its original position.
*/
.card.fade-in,
.stat-card.fade-in,
.quick-action-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/*
 * CRITICAL: Ensure static or stateful components are NEVER animated.
 * This rule overrides the initial animation state for any element that
 * should always be visible immediately.
*/
.active-drawers-static,
#active-drawers-section,
.active-drawers-static .card,
#active-drawers-section .card {
    opacity: 1 !important;
    transform: none !important;
}

/* Training Mode Indicator */
.training-mode-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.training-mode-indicator .badge {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.training-mode-indicator .badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: #FFD336 !important; /* Slightly brighter on hover */
}

/* Standardized Export Button Styles */
/* Use class="btn-export" for all export buttons across the application */
.btn-export {
    background: linear-gradient(135deg, var(--success-green) 0%, #5CB85C 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.15);
}

.btn-export:hover {
    background: linear-gradient(135deg, #28A745 0%, #4A994A 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.25);
}

.btn-export:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.15);
}

/* Export dropdown specific styles */
.btn-export.dropdown-toggle::after {
    margin-left: 0.5rem;
}

/* Small variant for inline/table use */
.btn-export.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* Export dropdown container - ensure proper positioning context */
.export-dropdown {
    position: relative !important;
    display: inline-block;
}

/* Export dropdown menu styling */
.export-dropdown .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    z-index: 9999 !important; /* Match global dropdown z-index */
    min-width: 180px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-radius: 0.5rem;
    padding: 0.25rem;
    margin-top: 0.25rem;
}

.export-dropdown .dropdown-item {
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.export-dropdown .dropdown-item:hover {
    background-color: var(--scrt-light-blue-bg);
    color: var(--scrt-blue);
}

.export-dropdown .dropdown-item i {
    width: 1.25rem;
    text-align: center;
}

/* Training Scenario Cards - Vertically Distributed Layout */
.training-scenario-card {
    height: 100%;
    min-height: 280px; /* Ensure minimum height for proper spacing */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.training-scenario-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.training-scenario-card .card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
}

/* Top Section - Level Badge */
.training-scenario-card .badge {
    align-self: flex-start;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.375rem 0.75rem;
}

/* Middle Section - Title and Description */
.training-scenario-card .card-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    margin: 0.5rem 0;
}

.training-scenario-card .card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #212529;
}

.training-scenario-card .card-text {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Bottom Section - Start Training Button */
.training-scenario-card .card-action {
    margin-top: auto;
    padding-top: 1rem;
}

.training-scenario-card .btn {
    width: 100%;
    padding: 0.625rem 1rem;
    font-weight: 500;
    text-transform: none;
    transition: all 0.2s ease;
}

.training-scenario-card .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(10, 0, 148, 0.2); /* NAPA blue shadow */
}