/* ==========================================================================
   Financial Book System - Warm & Earthy Browns Premium Stylesheet
   All custom styles are stored here to keep PHP files clean.
   ========================================================================== */

/* Theme Colors and CSS Variables */
:root {
    --transition-speed: 0.25s;
    --border-radius-lg: 14px;
    --border-radius-md: 8px;
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.05), 0 1px 8px rgba(0, 0, 0, 0.02);
    --hover-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 3px 10px rgba(0, 0, 0, 0.03);
    
    /* Global Earth Theme */
    --earth-primary: #8c6239;
    --earth-dark: #3e2c22;
    --earth-deep-cocoa: #31221a;
    --earth-brand: #2d1f18;
    --earth-footer: #221610;
    --earth-sand: #d9c3b0;
    --earth-gold: #a67c52;
    --earth-cream: #fdfbf9;
    
    /* Type 1 - เงินแผ่นดิน (Sienna Terracotta Brown Accents) */
    --t1-primary: #a0522d;
    --t1-primary-hover: #8b4513;
    --t1-light-bg: #fbf6f2;
    --t1-border: rgba(160, 82, 45, 0.25);
    
    /* Type 2 - เงินรายได้ (Earthy Bronze Brown Accents) */
    --t2-primary: #8c6239;
    --t2-primary-hover: #704f2e;
    --t2-light-bg: #faf6f0;
    --t2-border: rgba(140, 98, 57, 0.25);
}

/* Base Layout Updates & Improvements */
body {
    background-color: #f7f5f2;
    font-family: 'Inter', 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #3d2b1f;
}

/* Premium Card Wrapper */
.fbook-card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition-speed) ease, transform var(--transition-speed) ease;
    background: #ffffff;
    margin-bottom: 2rem;
    overflow: hidden;
}

.fbook-card:hover {
    box-shadow: var(--hover-shadow);
}

.fbook-card .card-header {
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1.5rem 2rem;
}

.fbook-card .card-header h3 {
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: #1a202c;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fbook-card .card-body {
    padding: 2rem;
}

.fbook-card .card-footer {
    background: #fafbfc;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    padding: 1.25rem 2rem;
}

/* Typography Details */
.form-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a68b75;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 0.3rem;
}

/* Custom Interactive Forms Styling */
.form-group label {
    font-weight: 600;
    color: #5c4a3c;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    transition: color var(--transition-speed) ease;
}

.fbook-input {
    border: 1.5px solid #e2dcd5;
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1rem !important;
    height: auto !important;
    font-size: 0.95rem;
    color: #2d1f18;
    background-color: #ffffff;
    transition: all var(--transition-speed) ease;
}

.fbook-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(140, 98, 57, 0.15);
    border-color: #8c6239;
}

.fbook-input::placeholder {
    color: #cbd5e0;
}

/* Readonly fields display */
.fbook-input-readonly {
    background-color: #faf8f5 !important;
    border-color: #e2dcd5 !important;
    color: #8c7365 !important;
    font-weight: 600;
    cursor: not-allowed;
}

#inputDate[readonly] {
    background-color: #ffffff !important;
    cursor: pointer !important;
}

.input-group-append-custom {
    border: 1.5px solid #e2dcd5 !important;
    border-left: none !important;
    border-top-right-radius: var(--border-radius-md) !important;
    border-bottom-right-radius: var(--border-radius-md) !important;
    padding: 0.75rem 1rem !important;
}

.datepicker-trigger {
    cursor: pointer !important;
}

/* Textarea styling */
textarea.fbook-input {
    min-height: 100px;
    resize: vertical;
}

/* Type 1 Accents (Sienna Terracotta - เงินแผ่นดิน) */
.type-1-accent {
    --accent-color: var(--t1-primary);
    --accent-color-hover: var(--t1-primary-hover);
    --accent-bg: var(--t1-light-bg);
}

.type-1-accent .card-header {
    border-top: 4px solid var(--t1-primary);
}

.type-1-accent h3 {
    color: var(--t1-primary) !important;
}

.type-1-accent .fbook-input:focus {
    box-shadow: 0 0 0 3px rgba(160, 82, 45, 0.15);
    border-color: var(--t1-primary);
}

.type-1-accent .btn-premium:not(.btn-premium-secondary):not(.btn-premium-danger) {
    background-color: var(--t1-primary) !important;
    border-color: var(--t1-primary) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(160, 82, 45, 0.2) !important;
}

.type-1-accent .btn-premium:not(.btn-premium-secondary):not(.btn-premium-danger):hover,
.type-1-accent .btn-premium:not(.btn-premium-secondary):not(.btn-premium-danger):focus {
    background-color: var(--t1-primary-hover) !important;
    border-color: var(--t1-primary-hover) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3) !important;
}

/* Type 2 Accents (Earthy Bronze - เงินรายได้) */
.type-2-accent {
    --accent-color: var(--t2-primary);
    --accent-color-hover: var(--t2-primary-hover);
    --accent-bg: var(--t2-light-bg);
}

.type-2-accent .card-header {
    border-top: 4px solid var(--t2-primary);
}

.type-2-accent h3 {
    color: var(--t2-primary) !important;
}

.type-2-accent .fbook-input:focus {
    box-shadow: 0 0 0 3px rgba(140, 98, 57, 0.15);
    border-color: var(--t2-primary);
}

.type-2-accent .btn-premium:not(.btn-premium-secondary):not(.btn-premium-danger) {
    background-color: var(--t2-primary) !important;
    border-color: var(--t2-primary) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(140, 98, 57, 0.2) !important;
}

.type-2-accent .btn-premium:not(.btn-premium-secondary):not(.btn-premium-danger):hover,
.type-2-accent .btn-premium:not(.btn-premium-secondary):not(.btn-premium-danger):focus {
    background-color: var(--t2-primary-hover) !important;
    border-color: var(--t2-primary-hover) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(112, 79, 46, 0.3) !important;
}

/* Custom Live Receipt / Preview Card */
.receipt-preview-container {
    background: #ffffff;
    border: 1px dashed #d9c3b0;
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.receipt-preview-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background-color: var(--accent-color, #a67c52);
}

.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f3ece4;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.receipt-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent-color, #a67c52);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.receipt-badge {
    background-color: var(--accent-bg, #faf6f0);
    color: var(--accent-color, #8c6239);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    border: 1px solid rgba(140, 98, 57, 0.15);
}

.receipt-row {
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
}

.receipt-label {
    color: #8c7365;
    font-weight: 500;
}

.receipt-value {
    color: #3d2b1f;
    font-weight: 600;
    text-align: right;
    max-width: 65%;
    word-break: break-all;
}

.receipt-value.empty {
    color: #cbd5e0;
    font-style: italic;
    font-weight: 400;
}

.receipt-amount-box {
    background: var(--accent-bg, #faf6f0);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    text-align: center;
    margin-top: 1.5rem;
    border: 1px solid rgba(140, 98, 57, 0.1);
}

.receipt-amount-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-color, #3d2b1f);
}

.receipt-amount-txt {
    font-size: 0.75rem;
    color: #8c7365;
    margin-top: 0.25rem;
    font-weight: 600;
}

/* Premium Form Validation Feedback */
.was-validated .fbook-input:invalid {
    border-color: #e53e3e !important;
    background-image: none !important;
}

.was-validated .fbook-input:invalid:focus {
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15) !important;
}

.was-validated .fbook-input:valid {
    border-color: #38a169 !important;
    background-image: none !important;
}

.was-validated .fbook-input:valid:focus {
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.15) !important;
}

.invalid-feedback-custom {
    color: #e53e3e;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: none;
}

.was-validated .fbook-input:invalid ~ .invalid-feedback-custom {
    display: block;
}

.fbook-input.is-invalid {
    border-color: #e53e3e !important;
}

.fbook-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15) !important;
}

.fbook-input.is-invalid ~ .invalid-feedback-custom {
    display: block;
}

/* Character Warning Badge */
.char-warning-badge {
    background-color: #feebc8;
    color: #dd6b20;
    border: 1px solid #fbd38d;
    padding: 0.4rem 0.75rem;
    border-radius: var(--border-radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    animation: fadeIn 0.2s ease;
}

/* Form Action Buttons */
.fbook-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.fbook-actions-row {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    margin-top: 2rem;
    width: 100%;
}

.fbook-actions-row .btn-issue-custom {
    flex: 70 70 0%;
    width: 0%;
}

.fbook-actions-row .btn-reset-custom {
    flex: 30 30 0%;
    width: 0%;
}

.btn-premium {
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all var(--transition-speed) ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(140, 98, 57, 0.08);
    background-color: var(--earth-primary);
    border: 1.5px solid var(--earth-primary);
    color: #ffffff !important;
}

.btn-premium:hover {
    background-color: var(--earth-dark);
    border-color: var(--earth-dark);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(140, 98, 57, 0.15);
}

.btn-premium-secondary {
    background-color: #f3ece4;
    border: 1.5px solid #d9c3b0;
    color: #5c4a3c !important;
    box-shadow: 0 4px 6px rgba(140, 98, 57, 0.04);
}

.btn-premium-secondary:hover {
    background-color: #e2dcd5;
    border-color: #cbd5e0;
    color: #3d2b1f !important;
}

.btn-premium-danger {
    background-color: #fff5f5;
    border: 1.5px solid #feb2b2;
    color: #c53030 !important;
    box-shadow: 0 4px 6px rgba(197, 48, 48, 0.08);
}

.btn-premium-danger:hover {
    background-color: #fed7d7;
    border-color: #feb2b2;
    color: #9b2c2c !important;
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(197, 48, 48, 0.15);
}

/* Modal Confirm Submit Button Overrides */
#previewModal #btnConfirmSubmit {
    font-weight: 700;
}
.type-1-accent #btnConfirmSubmit {
    background-color: var(--t1-primary) !important;
    border-color: var(--t1-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(160, 82, 45, 0.25) !important;
}
.type-1-accent #btnConfirmSubmit:hover {
    background-color: var(--t1-primary-hover) !important;
    border-color: var(--t1-primary-hover) !important;
    color: #ffffff !important;
}
.type-2-accent #btnConfirmSubmit {
    background-color: var(--t2-primary) !important;
    border-color: var(--t2-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(140, 98, 57, 0.25) !important;
}
.type-2-accent #btnConfirmSubmit:hover {
    background-color: var(--t2-primary-hover) !important;
    border-color: var(--t2-primary-hover) !important;
    color: #ffffff !important;
}

/* Sidebar and Navbar Earth Theme Overrides */
.bg-dark, .navbar-dark.bg-dark, .sb-topnav {
    background-color: var(--earth-dark) !important;
}

.sb-sidenav-dark {
    background-color: var(--earth-deep-cocoa) !important;
}

.sb-sidenav-dark .sb-sidenav-footer {
    background-color: var(--earth-footer) !important;
    color: var(--earth-sand) !important;
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link {
    color: var(--earth-sand) !important;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(166, 124, 82, 0.12) !important;
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link.active {
    color: #ffffff !important;
    background-color: var(--earth-gold) !important;
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link .sb-nav-link-icon {
    color: var(--earth-gold) !important;
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link.active .sb-nav-link-icon {
    color: #ffffff !important;
}

.sb-sidenav-menu-heading {
    color: #8c6e58 !important;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.navbar-brand {
    color: #ffffff !important;
    font-weight: 700;
}

/* Premium Preview Modal Styling */
.preview-modal-invoice {
    background-color: var(--earth-cream);
    border: 1.5px solid #e2dcd5;
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
}

.preview-modal-invoice .invoice-header {
    border-bottom: 2px solid #e2dcd5;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.preview-modal-invoice .invoice-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--earth-dark);
}

.preview-modal-invoice .invoice-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    border-bottom: 1px dashed #e2dcd5;
    padding-bottom: 0.5rem;
}

.preview-modal-invoice .invoice-label {
    color: #8c7365;
    font-weight: 600;
    font-size: 0.9rem;
}

.preview-modal-invoice .invoice-value {
    color: #3d2b1f;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: right;
}

.preview-modal-invoice .invoice-amount-box {
    background-color: #faf6f0;
    border: 1.5px solid #d9c3b0;
    border-radius: var(--border-radius-md);
    padding: 1rem;
    text-align: center;
    margin-top: 1.5rem;
}

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

/* Local Login Page Custom Styles */
.local-login-card {
    border-top: 4px solid var(--earth-primary) !important;
}

.local-login-title {
    color: var(--earth-primary) !important;
}

.input-prepend-custom {
    border: 1.5px solid #e2dcd5 !important;
    border-right: none !important;
    border-top-left-radius: var(--border-radius-md) !important;
    border-bottom-left-radius: var(--border-radius-md) !important;
}

.input-no-left-radius {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* Search Page Premium UI Styles */
.search-info-card {
    background: #fdfbf9;
    border: 1px solid #e9e2db;
    border-left: 5px solid #a67c52;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 15px rgba(166, 124, 82, 0.05);
    margin-bottom: 1.5rem;
}

.search-info-card .card-body {
    padding: 1.25rem 1.75rem;
}

.search-info-card h5 {
    color: #3e2c22;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.search-info-card ul {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.search-info-card li {
    font-size: 0.9rem;
    color: #5c4a3c;
    margin-bottom: 0.4rem;
}

.search-info-card li strong {
    color: #3e2c22;
}

.filter-card {
    border-top: 4px solid var(--earth-primary) !important;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-item {
    flex: 1 1 200px;
}

.filter-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 0.5rem;
}

.fbook-badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 50px;
}

.fbook-badge-type-1 {
    background-color: #fff5f5;
    color: var(--t1-primary);
    border: 1px solid var(--t1-border);
}

.fbook-badge-type-2 {
    background-color: #f0fdf4;
    color: var(--t2-primary);
    border: 1px solid var(--t2-border);
}

/* DataTable Customizations */
div.dataTables_wrapper div.dataTables_filter input {
    border: 1.5px solid #e2dcd5;
    border-radius: var(--border-radius-md);
    padding: 0.375rem 0.75rem;
    outline: none;
    transition: all var(--transition-speed) ease;
}

div.dataTables_wrapper div.dataTables_filter input:focus {
    box-shadow: 0 0 0 3px rgba(140, 98, 57, 0.15);
    border-color: #8c6239;
}

/* Style DataTable Buttons (Excel export) - Compact & Elegant */
.dt-button.buttons-excel {
    background-color: #27af60 !important;
    border: 1px solid #219653 !important;
    color: white !important;
    border-radius: 6px !important;
    padding: 0.35rem 0.85rem !important;
    font-size: 0.825rem !important;
    font-weight: 700 !important;
    transition: all var(--transition-speed) ease !important;
    box-shadow: 0 2px 4px rgba(39, 175, 96, 0.1) !important;
    
    /* Prevent full width stretching */
    width: auto !important;
    display: inline-flex !important;
    flex: 0 0 auto !important;
}

.dt-button.buttons-excel:hover {
    background-color: #219653 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(39, 175, 96, 0.15) !important;
}

/* Edit Modifications Container */
.edit-changes-summary {
    background-color: #fffaf0;
    border: 1px solid #feebc8;
    border-left: 5px solid #dd6b20;
    border-radius: var(--border-radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

/* Custom Alert Modal Styling */
.fbook-modal-content {
    border-radius: 16px;
    border: none;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
}

.custom-alert-btn {
    background-color: var(--earth-primary) !important;
    border-color: var(--earth-primary) !important;
}

.animate-pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Summary Cards in Search Results */
.summary-box-type-1 {
    background-color: var(--t1-light-bg);
    border: 1px solid rgba(160, 82, 45, 0.1);
    border-left: 5px solid var(--t1-primary);
    border-radius: var(--border-radius-md);
    padding: 1rem 1.25rem;
}

.summary-box-type-2 {
    background-color: var(--t2-light-bg);
    border: 1px solid rgba(140, 98, 57, 0.1);
    border-left: 5px solid var(--t2-primary);
    border-radius: var(--border-radius-md);
    padding: 1rem 1.25rem;
}

.summary-box-total {
    background-color: #fafbfc;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #4a5568;
    border-radius: var(--border-radius-md);
    padding: 1rem 1.25rem;
}

.summary-box-title {
    color: #718096;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.5rem;
}

.summary-box-body {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.summary-box-count {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2d3748;
}

.summary-box-amount {
    font-size: 1.25rem;
    font-weight: 800;
}

.summary-box-amount-1 {
    color: var(--t1-primary);
}

.summary-box-amount-2 {
    color: var(--t2-primary);
}

.summary-box-amount-total {
    color: #2d3748;
}

/* ==========================================================================
   Dashboard Premium Styles
   ========================================================================== */
.dashboard-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #f3ece4;
    color: var(--earth-primary);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 2px solid #ffffff;
}

.dashboard-user-row {
    transition: background-color var(--transition-speed) ease;
}
.dashboard-user-row:hover {
    background-color: #faf8f5;
}

.dashboard-progress {
    height: 6px;
    border-radius: 50px;
    background-color: #edf2f7;
    overflow: hidden;
}

.dashboard-progress-bar-1 {
    background-color: var(--t1-primary);
}

.dashboard-progress-bar-2 {
    background-color: var(--t2-primary);
}

.dashboard-recent-activity-item {
    padding: 0.85rem 1rem;
    border-left: 4px solid var(--accent-color, #a67c52);
    background-color: #ffffff;
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-recent-activity-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(166, 124, 82, 0.08);
}

/* Premium Custom Alert & Confirm Modals */
#customAlertModal .fbook-modal-content,
#customConfirmModal .fbook-modal-content {
    background: #ffffff;
    border: 1px solid rgba(166, 124, 82, 0.15);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(92, 74, 60, 0.18);
    overflow: hidden;
}

#customAlertModal .modal-header,
#customConfirmModal .modal-header {
    background-color: #faf7f2 !important;
    border-bottom: 1px solid rgba(166, 124, 82, 0.08) !important;
    padding: 1.25rem 1.75rem !important;
}

#customAlertModal .modal-footer,
#customConfirmModal .modal-footer {
    background-color: #faf7f2 !important;
    border-top: 1px solid rgba(166, 124, 82, 0.05) !important;
    padding: 1.25rem 1.75rem !important;
}

#customAlertModal .modal-body,
#customConfirmModal .modal-body {
    padding: 2.5rem 2rem !important;
}

/* Modal close button */
.fbook-modal-content .close {
    font-size: 1.5rem;
    color: #8c6239;
    opacity: 0.6;
    transition: all 0.2s ease;
    text-shadow: none;
    outline: none !important;
}

.fbook-modal-content .close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* Modal text colors and spacing */
#customAlertMessage, #customConfirmMessage {
    font-size: 1.25rem;
    color: #3d2b1f !important;
    font-weight: 700 !important;
    margin-top: 0.75rem;
    line-height: 1.5;
}

#customAlertSubtext, #customConfirmSubtext {
    font-size: 0.9rem;
    color: #8c7664 !important;
    margin-top: 0.5rem;
}

/* Custom fade scale entrance animation */
.modal.animate-fade-in.fade .modal-dialog {
    transform: scale(0.95) translateY(15px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.modal.animate-fade-in.show .modal-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Animate Pulse Custom */
.animate-pulse {
    animation: customPulse 2s infinite ease-in-out;
}

@keyframes customPulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 8px 16px rgba(0,0,0,0.12));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
    }
}

.fbook-modal-content .text-primary {
    color: var(--earth-primary) !important;
}

/* DataTable Buttons layout spacing - Right Aligned */
.dt-buttons {
    margin-bottom: 1.5rem !important;
    display: flex !important;
    justify-content: flex-end !important;
    width: 100% !important;
    gap: 0.5rem !important;
}

/* ==========================================================================
   Success Receipt Card Styles
   ========================================================================== */
.success-receipt-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    border: none;
    overflow: hidden;
    max-width: 700px;
    margin: 2rem auto;
    position: relative;
    border-top: 5px solid #27af60;
    animation: fadeIn 0.4s ease-out;
}

.success-header {
    text-align: center;
    padding: 2.5rem 2rem 1.5rem;
    background-color: #f7faf8;
    border-bottom: 1px solid #edf2f0;
}

.success-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #e6f7ed;
    color: #27af60;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 10px rgba(39, 175, 96, 0.15);
}

.success-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.success-subtitle {
    font-size: 0.9rem;
    color: #718096;
}

.receipt-details-grid {
    padding: 2rem;
    background: #ffffff;
}

.receipt-grid-row {
    display: flex;
    justify-content: space-between;
    padding: 0.85rem 0;
    border-bottom: 1px dashed #edf2f7;
    font-size: 0.95rem;
}

.receipt-grid-row:last-child {
    border-bottom: none;
}

.receipt-grid-label {
    color: #718096;
    font-weight: 600;
}

.receipt-grid-value {
    color: #2d3748;
    font-weight: 700;
    text-align: right;
    max-width: 65%;
    word-break: break-word;
}

.receipt-grid-value.ref-highlight {
    color: #27af60;
    font-size: 1.15rem;
}

.receipt-grid-amount-box {
    background-color: #f0fdf4;
    border: 1px solid #d1fae5;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    margin: 1rem 2rem;
}

.receipt-grid-amount-val {
    font-size: 2.2rem;
    font-weight: 900;
    color: #219653;
}

.receipt-grid-amount-txt {
    font-size: 0.85rem;
    color: #1b8044;
    margin-top: 0.35rem;
    font-weight: 700;
}

.countdown-box {
    text-align: center;
    padding: 1rem 2rem;
    background-color: #fafbfc;
    border-top: 1px solid #edf2f7;
}

.countdown-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 0.75rem;
}

.countdown-progress-bar-container {
    height: 4px;
    background-color: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    max-width: 300px;
    margin: 0 auto;
}

.countdown-progress-bar {
    height: 100%;
    background-color: #27af60;
    width: 100%;
    transition: width 0.1s linear;
}

.success-actions-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 2rem 2.5rem;
    background-color: #fafbfc;
}

/* ==========================================================================
   Premium Footer Styles
   ========================================================================== */
.fbook-footer {
    background-color: #ffffff !important;
    border-top: 1px solid rgba(140, 98, 57, 0.1) !important;
    padding: 1.25rem 0 !important;
    color: #8c7365;
    font-size: 0.825rem;
    box-shadow: 0 -4px 12px rgba(140, 98, 57, 0.02);
}

.footer-copyright {
    font-weight: 500;
    color: #7a6659;
}

.footer-copyright .brand-text {
    font-weight: 700;
    color: var(--earth-primary);
}

.footer-links {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-link {
    color: #8c7365 !important;
    text-decoration: none !important;
    font-weight: 600;
    transition: color var(--transition-speed) ease, transform 0.2s ease;
}

.footer-link:hover {
    color: var(--earth-primary) !important;
    transform: translateY(-1px);
}

.footer-separator {
    display: inline-block;
    width: 4px;
    height: 4px;
    background-color: var(--earth-sand);
    border-radius: 50%;
    margin: 0 0.25rem;
}

/* ==========================================================================
   Access Denied Card Styles
   ========================================================================== */
.access-denied-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    border: none;
    overflow: hidden;
    margin: 2rem auto;
    position: relative;
    border-top: 5px solid #e53e3e;
    animation: fadeIn 0.4s ease-out;
}

.denied-header {
    text-align: center;
    padding: 2.5rem 2rem 1.5rem;
    background-color: #fff5f5;
    border-bottom: 1px solid #fed7d7;
}

.denied-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #ffe5e5;
    color: #e53e3e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 10px rgba(229, 62, 62, 0.15);
}

.denied-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.denied-subtitle {
    font-size: 0.9rem;
    color: #718096;
    line-height: 1.5;
}

.denied-body {
    padding: 2rem;
    background: #ffffff;
}

.denied-actions {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* ==========================================================================
   Premium User Dropdown Styles
   ========================================================================== */
.fbook-user-dropdown-menu {
    border: 1px solid rgba(140, 98, 57, 0.12) !important;
    border-radius: 14px !important;
    min-width: 240px !important;
    margin-top: 0.5rem !important;
    overflow: hidden !important;
    padding: 0 !important;
    box-shadow: 0 15px 40px rgba(92, 74, 60, 0.15) !important;
    background-color: #ffffff !important;
}

.dropdown-user-header {
    background-color: #faf8f5;
    border-bottom: 1px solid rgba(140, 98, 57, 0.08);
}

.user-avatar-circle {
    width: 45px;
    height: 45px;
    background-color: #f3ece4;
    color: var(--earth-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(140, 98, 57, 0.1);
}

.dropdown-user-name {
    color: #3d2b1f;
    font-size: 0.9rem;
}

.dropdown-user-role {
    display: block;
    margin-top: 0.25rem;
}

.dropdown-item-premium {
    border-radius: 8px !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
    transition: all var(--transition-speed) ease !important;
}

.dropdown-item-premium:hover {
    background-color: #fff5f5 !important;
}

/* ==========================================================================
   Premium Navbar User Toggle Pill Styles
   ========================================================================== */
.fbook-nav-user-toggle {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-radius: 50px !important;
    padding: 0.35rem 1rem !important;
    margin-right: 0.5rem;
    transition: all var(--transition-speed) ease !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

.fbook-nav-user-toggle:hover, .fbook-nav-user-toggle:focus {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: var(--earth-sand) !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

.user-nav-avatar {
    width: 26px;
    height: 26px;
    background-color: var(--earth-gold);
    color: #ffffff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-nav-name {
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    margin-right: 0.25rem;
    color: #ffffff !important;
}

/* Custom caret color matching */
.fbook-nav-user-toggle.dropdown-toggle::after {
    color: var(--earth-sand) !important;
    margin-left: 0.5rem;
    vertical-align: middle;
}
