/* style.css - Premium Municipal Waste Portal Custom Styling */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #0c2b5c; /* Deep Royal Navy Blue */
    --primary-light: #1e4585;
    --primary-dark: #071c3e;
    --success-color: #1b5e20; /* Darker Eco Green */
    --success-light: #2e7d32;
    --accent-color: #a67c33; /* Royal Gold/Bronze */
    --accent-light: #d4af37; /* Bright Gold */
    --light-bg: #f4f6f9;
    --card-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.05), 0 2px 6px -2px rgba(0, 0, 0, 0.03);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(226, 232, 240, 0.8);
    --text-main: #1e293b;
    --text-muted: #475569;
    --font-heading: 'Sarabun', sans-serif; /* Highly Formal Thai Gov Font */
    --font-body: 'Sarabun', sans-serif;
    --border-radius: 8px; /* More formal, less bubbly */
    --transition-speed: 0.25s;
}

html {
    height: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--light-bg);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ให้ main content ขยายเต็มพื้นที่ ดัน footer ลงล่างสุด */
main, .main-content {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* Font Size Zoom classes */
html.small-font {
    font-size: 14px;
}
html.large-font {
    font-size: 18px;
}
html.large-font h1, html.large-font h2, html.large-font h3, html.large-font h4, html.large-font h5, html.large-font h6 {
    font-size: 120% !important;
}

/* High Contrast mode classes */
html.high-contrast body {
    background-color: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
}
html.high-contrast .gov-top-bar {
    background-color: #000000 !important;
    border-bottom: 2px solid #ffffff !important;
}
html.high-contrast :not(.btn-contrast, .btn-contrast *, .gov-top-bar, .gov-top-bar *, .btn-zoom, .btn-zoom *) {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}
html.high-contrast a, html.high-contrast .nav-link {
    color: #00ff00 !important;
}
html.high-contrast .btn-primary-premium, html.high-contrast .btn-success-premium, html.high-contrast .btn-premium {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
}

/* --- Thai Government Top Bar Accent --- */
.gov-top-bar {
    background-color: #0b1a30;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.8rem;
    border-bottom: 2px solid var(--accent-color);
}

.gov-flag-label {
    display: flex;
    align-items: center;
}

.flag-stripe-container {
    display: inline-flex;
    height: 11px;
    width: 20px;
    margin-right: 8px;
    border-radius: 1px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.flag-stripe {
    flex: 1;
}

.flag-stripe.red-stripe { background-color: #D80027; }
.flag-stripe.white-stripe { background-color: #FFFFFF; }
.flag-stripe.blue-stripe { background-color: #002B7F; flex: 2; }

.btn-zoom {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 2px;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 4px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    font-weight: bold;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.btn-zoom:hover, .btn-zoom.active {
    background-color: var(--accent-color) !important;
    color: #ffffff !important;
    border-color: var(--accent-color) !important;
}

.btn-contrast {
    cursor: pointer;
    color: #ffffff;
    font-size: 0.8rem;
}

.btn-contrast:hover {
    color: var(--accent-light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--primary-dark);
}

/* --- Header & Navigation --- */
.municipal-header {
    background: #ffffff;
    border-bottom: 2px solid #e2e8f0;
    padding: 15px 0;
}

.logo-section img {
    height: 60px;
    object-fit: contain;
}

.dept-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.2;
}

.muni-title {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

/* Custom Navbar Links */
.navbar-custom {
    background-color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    padding: 0.8rem 1rem;
}

.navbar-custom .nav-link {
    color: var(--text-main);
    font-family: var(--font-heading);
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
    margin: 0 2px;
}

.navbar-custom .nav-link:hover {
    color: var(--primary-color);
    background-color: #f1f5f9;
}

.navbar-custom .nav-link.active {
    color: #ffffff !important;
    background-color: var(--primary-color);
}

/* --- Clean & Elegant Dropdown Navigation --- */
.navbar-custom .dropdown-menu,
.dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 0.4rem !important;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.03) !important;
    margin-top: 0.4rem !important;
    min-width: 200px !important;
}

.navbar-custom .dropdown-item,
.dropdown-item {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: 8px !important;
    padding: 0.55rem 0.9rem !important;
    color: #334155 !important;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: background-color 0.15s ease, color 0.15s ease !important;
    margin-bottom: 2px;
}

.navbar-custom .dropdown-item:last-child,
.dropdown-item:last-child {
    margin-bottom: 0;
}

.navbar-custom .dropdown-item i,
.dropdown-item i {
    color: var(--primary-color);
    font-size: 1.05rem;
    transition: color 0.15s ease !important;
}

.navbar-custom .dropdown-item:hover,
.dropdown-item:hover,
.navbar-custom .dropdown-item:focus,
.dropdown-item:focus {
    background-color: #f1f5f9 !important;
    color: var(--primary-color) !important;
}

.navbar-custom .dropdown-item:hover i,
.dropdown-item:hover i {
    color: var(--primary-color) !important;
}

.navbar-custom .dropdown-item.active,
.dropdown-item.active {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 600;
}

.navbar-custom .dropdown-item.active i,
.dropdown-item.active i {
    color: #ffffff !important;
}

/* Badge styling inside dropdowns - Clean & Subtle */
.dropdown-menu .badge,
.navbar-custom .badge {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    padding: 0.25em 0.55em !important;
    border-radius: 50rem !important;
}

/* --- Main Layout Sections --- */
.section-tab {
    display: none;
}

.section-tab.active {
    display: block;
    animation: fadeIn 0.15s ease-out;
}

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

/* --- Card Styles & Layout (Home Screen) --- */
.feature-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    height: 100%;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(30, 58, 138, 0.12);
}

.feature-card .card-img-wrapper {
    position: relative;
    height: 220px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.feature-card .card-img-wrapper svg,
.feature-card .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.feature-card:hover .card-img-wrapper svg,
.feature-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.feature-card .card-body {
    padding: 1.5rem;
    text-align: center;
}

.feature-card .card-title {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0;
}

/* Hero Section */
.hero-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--border-radius);
    color: #ffffff;
    padding: 3rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: '';
    position: absolute;
    right: -10%;
    bottom: -30%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.hero-banner h1 {
    font-weight: 700;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #ffffff !important;
}

.hero-banner p {
    font-weight: 300;
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    color: #ffffff !important;
}

/* --- Stats Badges --- */
.stat-box {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    border-left: 5px solid var(--primary-color);
    transition: transform var(--transition-speed) ease;
}

.stat-box:hover {
    transform: scale(1.02);
}

.stat-box.success {
    border-left-color: var(--success-color);
}

.stat-box.warning {
    border-left-color: var(--accent-color);
}

.stat-icon {
    font-size: 2.5rem;
    margin-right: 1.2rem;
    color: var(--primary-color);
    opacity: 0.8;
}

.stat-box.success .stat-icon {
    color: var(--success-color);
}

.stat-box.warning .stat-icon {
    color: var(--accent-color);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

/* --- Forms & Inputs --- */
.card-premium {
    background: #ffffff;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 2rem;
}

.form-label-premium {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #cbd5e1;
    font-size: 0.95rem;
    transition: all var(--transition-speed) ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(12, 43, 92, 0.12);
}

/* --- Input Group Style Fix --- */
.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text,
.input-group > .btn {
    border-radius: 0 !important;
}

.input-group > :first-child:not(.dropdown-menu) {
    border-top-left-radius: var(--border-radius) !important;
    border-bottom-left-radius: var(--border-radius) !important;
}

.input-group > :last-child:not(.dropdown-toggle) {
    border-top-right-radius: var(--border-radius) !important;
    border-bottom-right-radius: var(--border-radius) !important;
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group > :not(:last-child):not(.dropdown-toggle) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.btn-premium {
    font-family: var(--font-heading);
    font-weight: 500;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
}

.btn-primary-premium,
.btn-primary-premium:hover,
.btn-primary-premium:focus,
.btn-primary-premium:active,
.btn-primary-premium.active {
    color: #ffffff !important;
}

.btn-primary-premium {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-primary-premium:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(12, 43, 92, 0.15);
}

.btn-success-premium,
.btn-success-premium:hover,
.btn-success-premium:focus,
.btn-success-premium:active,
.btn-success-premium.active {
    color: #ffffff !important;
}

.btn-success-premium {
    background-color: var(--success-color);
    border: 1px solid var(--success-color);
}

.btn-success-premium:hover {
    background-color: var(--success-light);
    border-color: var(--success-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 94, 32, 0.15);
}

/* --- Tables --- */
.table-premium {
    background: #ffffff;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid #cbd5e1;
    box-shadow: var(--card-shadow);
}

.table-premium th {
    background-color: var(--primary-color);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 600;
    border-bottom: 2px solid var(--accent-color);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    white-space: nowrap;
}

.table-premium td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.table-premium tr:last-child td {
    border-bottom: none;
}

/* --- Badges --- */
.badge-eco {
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.8rem;
}

/* --- Footer --- */
.muni-footer {
    background-color: var(--primary-dark);
    color: rgba(255, 255, 255, 0.85);
    padding: 2.5rem 0 1.8rem 0;
    font-size: 0.95rem;
    margin-top: 4rem;
}

.muni-footer h5 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.15rem;
}

.muni-footer p {
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin-bottom: 0;
}

.muni-footer p i {
    color: #ffffff;
}

.muni-footer hr {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 2rem !important;
    margin-bottom: 1.2rem !important;
}

.muni-footer a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.2s ease;
}

.muni-footer a:hover {
    color: #ffffff;
}

/* --- Modal/Receipt Print Design --- */
.receipt-container {
    padding: 20px;
    font-family: var(--font-body);
}

.receipt-header {
    text-align: center;
    border-bottom: 2px dashed #cbd5e1;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.receipt-logo {
    height: 50px;
    margin-bottom: 10px;
}

.receipt-title {
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.receipt-body table {
    width: 100%;
    margin-top: 15px;
    margin-bottom: 15px;
}

.receipt-body th {
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    padding: 5px 0;
}

.receipt-body td {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.receipt-footer {
    text-align: center;
    border-top: 2px dashed #cbd5e1;
    padding-top: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* สำหรับสั่งพิมพ์ (Print Stylesheet) */
@media print {
    body * {
        visibility: hidden;
    }
    #printReceiptModal, #printReceiptModal * {
        visibility: visible;
    }
    #printReceiptModal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .btn-print-hide {
        display: none !important;
    }
}

/* --- Login / Register Split Page Design --- */
.auth-container {
    max-width: 950px;
    margin: 5rem auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    display: flex;
}

.auth-sidebar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-right: 4px solid var(--accent-color);
    color: #ffffff;
    padding: 4.5rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 45%;
    position: relative;
    box-shadow: inset -10px 0 20px -10px rgba(0, 0, 0, 0.3);
}

/* --- Official Thai Government Style Elements --- */
.official-divider {
    height: 2px;
    background: linear-gradient(to right, transparent, var(--accent-color) 15%, var(--accent-color) 85%, transparent);
    margin: 1.75rem 0;
    opacity: 0.85;
}

.text-gold-accent {
    color: #e5c158 !important; /* Elegant Royal Gold */
    font-weight: 600;
    letter-spacing: 0.5px;
}

.official-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9) !important;
    text-align: justify;
    text-indent: 2.5em;
    margin-bottom: 0;
    font-family: var(--font-body);
}

.auth-form-wrapper {
    padding: 4rem 3.5rem;
    width: 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-toggle-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.auth-toggle-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
        margin: 2rem 1rem;
    }
    .auth-sidebar, .auth-form-wrapper {
        width: 100%;
        padding: 2rem 1.5rem !important;
    }
    .auth-sidebar {
        border-right: none !important;
        border-bottom: 4px solid var(--accent-color) !important;
        text-align: center !important;
    }
    .official-text {
        text-indent: 0 !important;
        text-align: center !important;
    }
}

/* --- Offcanvas Mobile Drawer Custom Styling --- */
@media (max-width: 991.98px) {
    .navbar-custom .offcanvas {
        background-color: #f8fafc; /* Light gray base matching screen mockup */
        width: 290px; /* Sleek width */
        border-right: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.08);
    }
    
    .navbar-custom .offcanvas-header {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        background-color: #ffffff;
        padding: 1.2rem;
    }
    
    .navbar-custom .offcanvas-body {
        padding: 1.5rem 1rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .navbar-custom .navbar-nav {
        gap: 0.5rem;
        width: 100%;
    }
    
    .navbar-custom .nav-link {
        margin: 0 !important;
        padding: 0.8rem 1.2rem !important;
        font-size: 1rem;
        color: #334155;
        border-radius: 10px;
        display: flex;
        align-items: center;
        transition: all 0.2s ease;
    }
    
    .navbar-custom .nav-link:hover {
        background-color: rgba(30, 58, 138, 0.06);
        color: var(--primary-color);
        transform: translateX(4px);
    }
    
    .navbar-custom .nav-link.active {
        background-color: var(--primary-color) !important;
        color: #ffffff !important;
        box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
    }
    
    /* Custom Styling for profile segment in mobile menu drawer */
    .navbar-custom .user-profile-sidebar {
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        padding-top: 1.2rem;
        margin-top: 1.5rem;
        width: 100%;
    }
}

/* --- Premium User Profile Pill & Compact Logout Button --- */
.user-profile-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 4px 14px 4px 6px;
    border-radius: 50px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.profile-pill:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.12);
}

.profile-avatar.admin-avatar {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--success-light) 100%);
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.12);
}

.profile-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}

.profile-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}

.profile-role-badge {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--primary-color);
}

.profile-role-badge.admin-role {
    color: var(--success-color);
}

/* Compact and Sleek Logout Button */
.btn-logout-sleek {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0 12px;
    height: 32px;
    border-radius: 50px;
    border: 1px solid #fecaca; /* red-200 */
    background-color: #fef2f2; /* red-50 */
    color: #dc2626; /* red-600 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-logout-sleek:hover {
    background-color: #dc2626; /* red-600 */
    border-color: #dc2626;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.12);
}

@media (max-width: 991.98px) {
    .user-profile-wrapper {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 12px;
        padding-top: 1.2rem;
        margin-top: 1.2rem;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }
    
    .profile-pill {
        width: 100%;
        background-color: transparent;
        border: none;
        padding: 0;
    }
    
    .profile-pill:hover {
        background-color: transparent;
    }
    
    .btn-logout-sleek {
        width: 100%;
        height: 38px;
        font-size: 0.85rem;
    }
}

/* --- Large Avatar Styling for Profile Page --- */
.avatar-large-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    padding: 5px;
    background-color: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.avatar-large {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* --- Pagination Component Styles --- */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.pagination-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    margin-right: 5px;
}
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--primary-color);
    background-color: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    user-select: none;
}
.pagination-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    color: #ffffff;
}
.pagination-btn.active {
    background-color: #ffffff;
    border-color: var(--primary-color);
    color: var(--primary-color);
    pointer-events: none;
    box-shadow: 0 0 0 2px rgba(12, 43, 92, 0.1);
}

/* --- Extra Mobile Responsive Tweaks for Small Viewports --- */
@media (max-width: 576px) {
    .alert.d-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
    }
    .alert.d-flex button, .alert.d-flex a {
        width: 100% !important;
    }
    .card-premium {
        padding: 1.25rem 1rem !important;
    }
    .hero-banner {
        padding: 1.5rem !important;
    }
    .hero-banner h1 {
        font-size: 1.6rem !important;
    }
    .hero-banner p {
        font-size: 0.95rem !important;
    }
}

/* --- Withdrawn Grayed Out Table Row --- */
.table-premium tr.row-withdrawn td,
.table-premium tr.row-withdrawn td * {
    color: #94a3b8 !important;
    background-color: #f8fafc !important;
    text-decoration: none;
}

/* --- Modal Custom Tweaks --- */
.modal-header.text-white .modal-title,
.modal-header.text-white .modal-title i {
    color: #ffffff !important;
}

/* ================= COOKIE CONSENT STYLES ================= */
.cookie-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 28, 62, 0.5); /* Semi-transparent Royal Navy */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed);
}
.cookie-consent-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    background: #071c3e; /* Deep Royal Navy Blue */
    color: #ffffff;
    border-top: 3px solid #a67c33; /* Municipal Gold Accent Border */
    box-shadow: 0 -8px 32px rgba(7, 28, 62, 0.4);
    z-index: 2000;
    padding: 24px 50px 24px 30px;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s;
    font-family: var(--font-body);
}
.cookie-consent-banner.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.cookie-consent-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.cookie-consent-left {
    flex: 1;
}

.cookie-consent-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 220px;
    flex-shrink: 0;
}

.cookie-consent-body {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.65;
    margin-bottom: 0;
}
.cookie-consent-body a {
    color: #d4af37; /* Gold Accent Links */
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}
.cookie-consent-body a:hover {
    color: #ffffff;
}

.cookie-switches-toggle-link {
    display: inline-block;
    color: #d4af37;
    text-decoration: underline;
    font-size: 0.88rem;
    font-weight: 600;
    margin-top: 12px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: color 0.2s;
}
.cookie-switches-toggle-link:hover {
    color: #ffffff;
}

.cookie-switches-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}
.cookie-switches-container.show {
    max-height: 100px;
    margin-top: 16px;
    padding-top: 8px;
}

.cookie-switch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.86rem;
    color: #ffffff;
}

.cookie-switch-item .form-check-input {
    width: 2.8em;
    height: 1.4em;
    background-color: #1a355e;
    border-color: #244b85;
    cursor: pointer;
    margin-top: 0;
}
.cookie-switch-item .form-check-input:checked {
    background-color: #d4af37; /* Municipal Gold switch */
    border-color: #d4af37;
}
.cookie-switch-item .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25);
    border-color: #d4af37;
}

.cookie-consent-right .btn-cookie-action {
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 9px 16px;
    text-align: center;
    width: 100%;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    border: none;
}
.cookie-consent-right .btn-cookie-action:active {
    transform: scale(0.98);
}

/* Save button - White outline / light slate */
#btnCookieSave {
    background-color: #ffffff;
    color: var(--primary-color);
}
#btnCookieSave:hover {
    background-color: #f1f5f9;
}

/* Accept all - Premium gold gradient */
#btnCookieAcceptAll {
    background: linear-gradient(135deg, #d4af37 0%, #a67c33 100%);
    color: #ffffff;
}
#btnCookieAcceptAll:hover {
    background: linear-gradient(135deg, #e5c158 0%, #b88d44 100%);
}

/* Reject button - Transparent with white border */
#btnCookieRejectNonEssential {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}
#btnCookieRejectNonEssential:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
}

.cookie-consent-close {
    position: absolute;
    top: 16px;
    right: 20px;
    cursor: pointer;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.2s, color 0.2s;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cookie-consent-close:hover {
    transform: scale(1.1);
    color: #ffffff;
}

.cookie-consent-badge {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 46px;
    height: 46px;
    background: var(--primary-color);
    color: #ffffff;
    border: 2px solid var(--accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(12, 43, 92, 0.3);
    z-index: 1998;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s, opacity 0.3s ease, visibility 0.3s;
    opacity: 0;
    transform: scale(0);
    visibility: hidden;
}
.cookie-consent-badge.show {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
}
.cookie-consent-badge:hover {
    transform: scale(1.1) rotate(25deg);
    background-color: var(--primary-light);
}
.cookie-consent-badge i {
    font-size: 1.3rem;
}

/* Responsive adjust for tablet/mobile */
@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 45px 24px 24px 24px;
    }
    .cookie-consent-container {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    .cookie-consent-right {
        width: 100%;
    }
    .cookie-switches-container {
        flex-direction: column;
        gap: 12px;
    }
    .cookie-switches-container.show {
        max-height: 180px;
    }
    .cookie-consent-badge {
        bottom: 16px;
        left: 16px;
        width: 42px;
        height: 42px;
    }

    /* Prevent buttons from squishing into circles or wrapping text weirdly on mobile */
    .btn,
    .btn-sm,
    .btn-premium,
    a.btn {
        white-space: nowrap !important;
        max-width: 100%;
    }

    /* Action button containers on card headers */
    .card-header-actions,
    .d-flex.align-items-center.gap-2 {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    /* Audit Log and Reports export button groups */
    #tab-audit-logs .d-flex,
    #tab-reports .d-flex,
    .card-premium .d-flex {
        flex-wrap: wrap;
    }

    /* Audit Log Filter Form on Mobile */
    #audit-log-filter-form {
        display: flex;
        flex-direction: column;
        gap: 0.75rem !important;
    }

    #audit-log-filter-form .col-md-3,
    #audit-log-filter-form .col-md-2,
    #audit-log-filter-form .col-md-1,
    #audit-log-filter-form .col-md-auto {
        width: 100% !important;
    }

    /* Audit log reset button style on mobile */
    #btn-reset-audit-filter {
        width: 100% !important;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.5rem 1rem !important;
        border-radius: 8px !important;
        background-color: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
    }
}

/* High Contrast Mode adaptations */
html.high-contrast .cookie-consent-banner {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
    box-shadow: none !important;
}
html.high-contrast .cookie-consent-body,
html.high-contrast .cookie-consent-body a,
html.high-contrast .cookie-switches-toggle-link,
html.high-contrast .cookie-switch-item {
    color: #ffff00 !important;
}
html.high-contrast .cookie-consent-right .btn-cookie-action {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
    box-shadow: none !important;
}
html.high-contrast .cookie-consent-badge {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
    box-shadow: none !important;
}
html.high-contrast .cookie-consent-badge i {
    color: #ffff00 !important;
}
html.high-contrast .cookie-switch-item .form-check-input:checked {
    background-color: #ffff00 !important;
    border-color: #ffff00 !important;
}

/* Hover Utilities */
a.hover-primary {
    transition: color 0.2s ease;
}
a.hover-primary:hover {
    color: var(--primary-color) !important;
}


