/* ============================================
   MODERN ADMIN DASHBOARD DESIGN SYSTEM
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   DESIGN TOKENS - MODERN ADMIN DASHBOARD COLOR SYSTEM
   ============================================ */
:root {
    /* Primary Colors - #1890FF Blue (Ant Design / modern UI) */
    --primary-50: #e6f7ff;
    --primary-100: #bae7ff;
    --primary-200: #91d5ff;
    --primary-300: #69c0ff;
    --primary-400: #40a9ff;
    --primary-500: #1890ff;
    --primary-600: #096dd9;
    --primary-700: #0050b3;
    --primary-800: #003a8c;
    --primary-900: #002766;
    
    /* Accent Colors - Main blue is #1890ff */
    --accent-blue: #1890ff;
    --accent-teal: #14b8a6;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    
    /* Semantic Colors - Soft & Refined */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-bg: #fef2f2;
    --info: #1890ff;
    --info-light: #e6f7ff;
    --info-bg: #e6f7ff;
    
    /* Neutral Colors - Clean Grays */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-sidebar: #1e293b;
    --bg-sidebar-dark: #0f172a;
    
    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --text-inverse: #ffffff;
    --text-muted: #6b7280;
    
    /* Border Colors */
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --border-dark: #9ca3af;
    
    /* Shadows - Subtle & Refined */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    
    /* Spacing - Compact */
    --spacing-xs: 0.125rem;
    --spacing-sm: 0.375rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Typography - Compact */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.6875rem;
    --font-size-sm: 0.8125rem;
    --font-size-base: 0.9375rem;
    --font-size-lg: 1rem;
    --font-size-xl: 1.125rem;
    --font-size-2xl: 1.25rem;
    --font-size-3xl: 1.5rem;
    --font-size-4xl: 1.875rem;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-700);
    text-decoration: none;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
    margin-left: 250px;
    transition: all var(--transition-slow);
    min-height: 100vh;
    padding: var(--spacing-lg);
    background-color: var(--bg-secondary);
}

.main-content header {
    background: var(--bg-primary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-lg);
}

.main-content header h2 {
    margin: 0;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================
   CARDS - MODERN DESIGN
   ============================================ */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.card-header {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.card-header-secondary {
    background: linear-gradient(135deg, var(--gray-700), var(--gray-800));
}

.card-header-success {
    background: linear-gradient(135deg, var(--success), #059669);
}

.card-header-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

.card-header-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
}

.card-body {
    padding: var(--spacing-md);
}

.card-footer {
    background: var(--bg-tertiary);
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-light);
}

/* ============================================
   BUTTONS - MODERN STYLES
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.4;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.25);
}

.btn-primary,
.btn-app-main {
    background: var(--accent-blue);
    color: var(--text-inverse);
    border-color: var(--accent-blue);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: var(--font-size-sm);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.15), 0 1px 2px rgba(24, 144, 255, 0.1);
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.btn-primary:hover,
.btn-app-main:hover {
    background: #096dd9;
    color: var(--text-inverse);
    border-color: #096dd9;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3), 0 2px 4px rgba(24, 144, 255, 0.2);
    transform: translateY(-2px);
}

.btn-primary:active,
.btn-app-main:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-secondary:hover {
    background: var(--gray-200);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: var(--text-inverse);
    border-color: var(--success);
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: #059669;
    color: var(--text-inverse);
    border-color: #059669;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
    border-color: var(--danger);
    box-shadow: 0 1px 2px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: #dc2626;
    color: var(--text-inverse);
    border-color: #dc2626;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.25);
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning);
    color: var(--text-inverse);
    border-color: var(--warning);
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    background: #d97706;
    color: var(--text-inverse);
    border-color: #d97706;
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.25);
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: transparent;
    color: var(--accent-blue);
    border-color: var(--border-medium);
    border-width: 1px;
}

.btn-outline-primary:hover {
    background: var(--gray-50);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.btn-outline-primary.active {
    background: var(--accent-blue);
    color: var(--text-inverse);
    border-color: var(--accent-blue);
}

.btn-outline-custom {
    background: transparent;
    color: var(--accent-blue);
    border: 2px solid var(--accent-blue);
    font-weight: 600;
}

.btn-outline-custom:hover,
.btn-outline-custom.active {
    background: var(--accent-blue);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

/* Secondary Outline Button - Neutral Utility Actions */
.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-medium);
    border-width: 1px;
}

.btn-outline-secondary:hover {
    background: var(--gray-50);
    color: var(--text-primary);
    border-color: var(--border-dark);
}

.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: var(--font-size-sm);
}

/* ============================================
   UNIFIED BUTTON COLOR SYSTEM
   ============================================
   
   DESIGN PRINCIPLES:
   1. PRIMARY ACTIONS (Add, Create, Save): Blue (#1890ff)
      - Used for: "Add New Vehicle", "New Invoice", "Create", "Save"
      - Creates visual hierarchy and consistency
   
   2. SECONDARY ACTIONS (Filters, Reset): Neutral Gray
      - Used for: "Apply Filters", "Reset", utility actions
      - Subtle, non-competing with primary actions
   
   3. EDIT/VIEW ACTIONS: Blue accent (subtle)
      - Used for: Edit icons, View icons
      - Consistent with primary color but lighter
   
   4. DELETE ACTIONS: Red (danger)
      - Used for: Delete icons, destructive actions
      - Standard semantic color for clarity
   
   5. SUCCESS ACTIONS: Green (only for confirmations)
      - Used for: "Mark as Available", positive confirmations
      - Reserved for success states only
   ============================================ */

/* ============================================
   PRIMARY ACTION BUTTONS (Add, Create, Save)
   ============================================ */
.btn-record-add {
    background: var(--accent-blue);
    color: var(--text-inverse);
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.15), 0 1px 2px rgba(24, 144, 255, 0.1);
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    position: relative;
    overflow: hidden;
    min-width: 100px;
    white-space: nowrap;
}

.btn-record-add::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-record-add:hover {
    background: #096dd9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3), 0 2px 4px rgba(24, 144, 255, 0.2);
}

.btn-record-add:hover::before {
    left: 100%;
}

.btn-record-add:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

.btn-record-add i {
    color: var(--text-inverse);
    font-size: 0.875rem;
}

/* ============================================
   FORMS - MODERN STYLING
   ============================================ */
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-sm);
    font-weight: 400;
    line-height: 1.4;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

/* Align date inputs with btn-sm height */
input[type="date"].form-control {
    height: calc(1.5em + 0.5rem + 2px);
    line-height: 1.5;
}

.form-control:focus,
.form-select:focus {
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border-color: var(--accent-blue);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--gray-100);
    opacity: 0.7;
    cursor: not-allowed;
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.input-group {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group-text {
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.input-group-text:hover {
    background-color: var(--gray-200) !important;
}

/* ============================================
   RENTAL CONTRACT FORMS (Create / Edit)
   ============================================ */
.rental-form {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
}

/* Two-column layout: main form left, payment summary right (e‑commerce style) */
.rental-form__body {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--spacing-xl);
    align-items: start;
}

@media (max-width: 991.98px) {
    .rental-form__body {
        grid-template-columns: 1fr;
    }
    .rental-form__sidebar {
        order: -1; /* Payment summary on top on small screens for context */
    }
}

.rental-form__main {
    min-width: 0;
}

.rental-form__sidebar {
    position: sticky;
    top: calc(var(--spacing-lg) + 60px); /* below typical fixed header */
}

/* Payment summary card — order-style right sidebar */
.rental-form__sidebar .rental-form-section {
    margin-bottom: 0;
}

.rental-form__sidebar .rental-form-section__title {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
}

.rental-form__sidebar .rental-form-section .form-group {
    margin-bottom: var(--spacing-md);
}

.rental-form__sidebar .rental-form-section .form-group:last-of-type {
    margin-bottom: var(--spacing-md);
}

/* Submit + Cancel under payment summary in sidebar */
.rental-form-sidebar-actions {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
.rental-form-sidebar-actions .btn-app-main {
    padding: 0.625rem 1.25rem;
    font-weight: 600;
}
.rental-form-sidebar-cancel {
    display: block;
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.25rem 0;
}
.rental-form-sidebar-cancel:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.rental-form__sidebar .payment-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--border-light);
}

.rental-form__sidebar .payment-summary-row:last-of-type {
    border-bottom: none;
}

.rental-form__sidebar .payment-summary-row__label {
    color: var(--text-secondary);
}

.rental-form__sidebar .payment-summary-row--total {
    padding-top: var(--spacing-md);
    margin-top: var(--spacing-xs);
    border-top: 2px solid var(--border-medium);
    font-weight: 600;
    font-size: var(--font-size-base);
}

.rental-form__sidebar .payment-summary-row--balance {
    padding-top: var(--spacing-sm);
    margin-top: var(--spacing-xs);
    border-top: 1px solid var(--border-light);
    font-weight: 600;
    color: var(--gray-700);
}

.rental-form .rental-form-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--transition-base);
}

.rental-form .rental-form-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-500), var(--primary-600));
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.rental-form .rental-form-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rental-form .rental-form-section__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-lg) 0;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.rental-form .rental-form-section__title::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-500);
    flex-shrink: 0;
}

.rental-form .rental-form-section .form-group {
    margin-bottom: var(--spacing-lg);
}

.rental-form .rental-form-section .form-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.rental-form .rental-form-section .form-control,
.rental-form .rental-form-section .form-select {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-sm);
    min-height: 2.5rem;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.rental-form .rental-form-section .form-control:focus,
.rental-form .rental-form-section .form-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.12);
}

.rental-form .rental-form-section .form-control[readonly]:not([type="hidden"]):not(.rental-period-input),
.rental-form .rental-form-section .form-control:disabled,
.rental-form .rental-form-section input.form-control[readonly]:not(.rental-period-input) {
    background-color: var(--gray-50) !important;
    color: var(--text-secondary);
    border-color: var(--border-light);
    cursor: default;
}

.rental-form .rental-form-section .form-control.rental-period-input[readonly] {
    background-color: var(--bg-primary) !important;
    cursor: pointer;
}

.rental-form .rental-form-section .input-group-text,
.rental-form .rental-form-section .input-group .form-control[readonly] + .form-control {
    font-size: var(--font-size-sm);
    padding: 0.5rem 0.75rem;
    min-height: 2.5rem;
    background-color: var(--gray-50) !important;
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.rental-form .rental-form-section .form-text,
.rental-form .rental-form-section small.text-muted {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: var(--spacing-xs);
    display: block;
}

/* Payment highlights using semantic colors */
.rental-form .rental-form-section #TotalAmount {
    background-color: var(--success-bg) !important;
    border-color: var(--success-light);
    color: var(--gray-800);
    font-weight: 600;
}

.rental-form .rental-form-section #RemainingBalance {
    background-color: var(--warning-bg) !important;
    border-color: var(--warning-light);
    color: var(--gray-800);
    font-weight: 600;
}

/* Rental period error in-section */
.rental-form .rental-period-error {
    background-color: var(--danger-bg);
    border: 1px solid var(--danger-light);
    border-left: 4px solid var(--danger);
    border-radius: var(--radius-md);
    color: var(--gray-800);
    font-size: var(--font-size-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
}

/* Form actions bar */
.rental-form-actions {
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.rental-form-actions .btn-app-main {
    min-width: 180px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
}

.rental-form-actions .btn-secondary {
    padding: 0.5rem 1rem;
}

/* ============================================
   TABLES - MODERN DESIGN
   ============================================ */
.table {
    width: 100%;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0;
}

.custom-table {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: none;
}

.custom-table thead th {
    background: var(--gray-50);
    color: var(--text-primary);
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-transform: none;
    letter-spacing: normal;
    border-bottom: 1px solid var(--border-light);
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-family);
}

.custom-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-light);
    border-left: none;
    border-right: none;
    vertical-align: middle;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    line-height: 1.4;
}

.custom-table tbody tr {
    transition: background-color var(--transition-fast);
    background-color: var(--bg-primary);
}

.custom-table tbody tr:hover {
    background-color: var(--gray-50);
}

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

.custom-table tbody tr:first-child td {
    border-top: none;
}

/* Remove all vertical borders for clean look */
.custom-table th,
.custom-table td {
    border-left: none !important;
    border-right: none !important;
}

.table-hover tbody tr:hover {
    background-color: var(--gray-50);
    color: var(--text-primary);
}

/* ============================================
   BADGES & STATUS INDICATORS
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-xs);
    font-weight: 500;
    line-height: 1.2;
    border-radius: var(--radius-full);
    text-transform: none;
    letter-spacing: normal;
    border: none;
}

.badge-success {
    background-color: var(--success);
    color: var(--text-inverse);
}

.badge-danger {
    background-color: #fee2e2;
    color: #dc2626;
}

.badge-warning {
    background-color: #fef3c7;
    color: #d97706;
}

.badge-info {
    background-color: var(--info-light);
    color: var(--primary-700);
    border: none;
}

.badge-secondary {
    background-color: var(--gray-200);
    color: var(--gray-700);
    border: none;
}

.badge-no-payment {
    background-color: var(--primary-50);
    color: var(--primary-600);
    border: 1px solid var(--primary-200);
}

.status-button {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 600;
    border: none;
    cursor: default;
}

.status-paid {
    background-color: var(--success);
    color: var(--text-inverse);
}

.status-unpaid {
    background-color: var(--danger);
    color: var(--text-inverse);
}

.status-partial {
    background-color: var(--warning);
    color: var(--text-inverse);
}

.status-pending {
    background-color: var(--gray-500);
    color: var(--text-inverse);
}

/* ============================================
   FILTERS & SEARCH
   ============================================ */
.filter-form-container {
    background: var(--bg-primary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-light);
}

.search-form {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    flex-wrap: wrap;
}

.search-form .form-control {
    flex: 1;
    min-width: 200px;
}

.search-form .btn {
    white-space: nowrap;
}

/* ============================================
   STATISTICS CARDS
   ============================================ */
.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-card h4 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-md);
}

.stat-card .stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.stat-card .stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.statistics-section {
    background: var(--bg-primary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-light);
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin-bottom: var(--spacing-xl);
    list-style: none;
    background: transparent;
    border-radius: var(--radius-md);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: var(--font-size-sm);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    padding: 0 var(--spacing-sm);
    color: var(--text-tertiary);
    font-weight: 400;
}

.breadcrumb-item a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.breadcrumb-item a:hover {
    color: #096dd9;
    text-decoration: none;
}

.breadcrumb-item a i {
    color: var(--accent-blue);
    font-size: 0.875rem;
}

.breadcrumb-item.active {
    color: var(--text-secondary);
    font-weight: 500;
}

.custom-breadcrumb {
    background: var(--bg-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: var(--spacing-xl);
}

/* Ensure consistent spacing after breadcrumb navigation */
nav[aria-label="breadcrumb"] {
    margin-bottom: var(--spacing-xl) !important;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: var(--radius-md);
    justify-content: center;
    gap: var(--spacing-xs);
    margin: var(--spacing-lg) 0;
}

.page-item {
    margin: 0;
}

.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    line-height: 1.25;
    color: var(--accent-blue);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    min-width: 2.5rem;
    text-align: center;
}

.page-link:hover:not(.disabled) {
    z-index: 2;
    color: #096dd9;
    background-color: var(--gray-50);
    border-color: var(--accent-blue);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.15);
}

.page-item.active .page-link {
    z-index: 3;
    color: var(--text-inverse);
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.25);
}

.page-item.active .page-link:hover {
    background: #096dd9;
    border-color: #096dd9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(24, 144, 255, 0.3);
}

.page-item.disabled .page-link {
    color: var(--text-tertiary);
    pointer-events: none;
    cursor: not-allowed;
    background-color: var(--bg-primary);
    border-color: var(--border-light);
    opacity: 0.6;
}

/* ============================================
   MODALS - UNIFIED STYLING
   ============================================ */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
}

.modal-header {
    background: var(--accent-blue);
    color: var(--text-inverse);
    border-bottom: none;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header .modal-title {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--text-inverse);
    margin: 0;
}

.modal-header .modal-title i {
    font-size: 1.25rem;
    margin-right: var(--spacing-sm);
}

.modal-header .btn-close {
    filter: invert(1) brightness(100%);
    opacity: 0.9;
    padding: var(--spacing-sm);
    margin: 0;
    transition: opacity var(--transition-fast);
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: var(--spacing-xl);
    background: var(--bg-primary);
}

.modal-body .form-group {
    margin-bottom: var(--spacing-lg);
}

.modal-body .form-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-sm);
}

.modal-body .form-control {
    border-color: var(--border-medium);
    transition: all var(--transition-base);
}

.modal-body .form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.modal-footer {
    border-top: 1px solid var(--border-light);
    padding: var(--spacing-lg) var(--spacing-xl);
    background: var(--gray-50);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

.modal-footer .btn {
    min-width: 100px;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

/* Modal Types - Special Styling */
.modal-header.danger {
    background: var(--danger);
}

.modal-header.success {
    background: var(--success);
}

.modal-header.warning {
    background: var(--warning);
}

/* ============================================
   ACTION BUTTONS & ICONS
   ============================================ */
.action-buttons {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    justify-content: center;
}

.action-icon,
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
    background: var(--bg-primary);
    border: none;
    padding: 0;
    font-size: var(--font-size-sm);
    position: relative;
    color: var(--text-secondary);
    box-shadow: none;
}

.action-icon:hover,
.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* View Action - main blue */
.action-icon.view,
.btn-action.view {
    color: var(--accent-blue);
    background: var(--primary-100);
    border: none;
}

.action-icon.view:hover,
.btn-action.view:hover {
    background-color: var(--primary-200);
    color: var(--primary-700);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

/* Edit Action - main blue (matches app primary) */
.action-icon.edit,
.btn-action.edit {
    color: var(--accent-blue);
    background: var(--primary-100);
    border: none;
}

.action-icon.edit:hover,
.btn-action.edit:hover {
    background-color: var(--primary-200);
    color: var(--primary-700);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

/* Delete Action - Light Danger/Red Background (using app's danger palette) */
.action-icon.delete,
.btn-action.delete {
    color: var(--danger);
    background: var(--danger-light);
    border: none;
}

.action-icon.delete:hover,
.btn-action.delete:hover {
    background-color: var(--danger-bg);
    color: #dc2626;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.15);
}

/* Print Action Button - main blue */
.btn-action.print {
    color: var(--accent-blue);
    background: var(--primary-100);
    border: none;
}

.btn-action.print:hover {
    background-color: var(--primary-200);
    color: var(--primary-700);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

/* Success Actions - Light Green Background (using app's success palette) */
.btn-action.mark-available-btn,
.btn-success-action {
    color: var(--success);
    background: var(--success-light);
    border: none;
}

.btn-action.mark-available-btn:hover,
.btn-success-action:hover {
    background-color: var(--success-bg);
    color: #059669;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.15);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--accent-blue); }

/* Invoice listing – totals card and amount */
.invoice-totals-card {
    background: linear-gradient(135deg, var(--primary-50), var(--gray-50));
    border-left: 4px solid var(--accent-blue);
}
.invoice-totals-card .invoice-total-amount {
    color: var(--accent-blue);
}

/* Invoice listing – Payment column layout (align badge + button, consistent spacing) */
.invoice-payment-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    min-width: 0;
}
.invoice-payment-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}
.invoice-payment-cell .badge {
    font-size: var(--font-size-xs);
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    line-height: 1.25;
}
.invoice-payment-cell .btn-action.delete {
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    min-height: 1.5rem;
    padding: 0;
    font-size: 0.65rem;
}
.invoice-payment-cell .btn-app-main {
    padding: 0.25rem 0.5rem;
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.invoice-payment-unpaid {
    font-size: var(--font-size-xs);
    line-height: 1.25;
    white-space: nowrap;
}

.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-tertiary { background-color: var(--bg-tertiary); }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: var(--spacing-md);
    }
    
    .card-body {
        padding: var(--spacing-md);
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-form .form-control {
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

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

.fade-in {
    animation: fadeIn var(--transition-slow) ease-out;
}

/* ============================================
   LEGACY SUPPORT (for existing classes)
   ============================================ */
.custom-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--spacing-xl);
    transition: all var(--transition-base);
}

.custom-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.custom-card .card-header {
    font-weight: 600;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--spacing-lg);
}

/* Sidebar Logo */
.sidebar-logo img {
    max-width: 100%;
    height: auto;
    padding: var(--spacing-md);
}

/* ============================================
   TOGGLE SWITCH STYLING
   ============================================ */
.form-check-input {
    background-color: var(--gray-500);
    border-color: var(--gray-500);
}

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

.form-check-input:focus {
    border-color: var(--accent-blue);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(24, 144, 255, 0.25);
}

.form-switch .form-check-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    transition: background-position 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

/* Field Validation */
.field-validation-error {
    color: var(--danger);
    font-size: var(--font-size-xs);
    margin-top: var(--spacing-xs);
    display: block;
}

.field-validation-valid {
    display: none;
}

.is-valid {
    border-color: var(--success);
}

.is-invalid {
    border-color: var(--danger);
}

/* Quick Action Buttons */
.quick-action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.quick-action-button:hover {
    transform: translateY(-2px);
}

/* Transaction Type Filters */
.transaction-type-filters {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-top: var(--spacing-lg);
}

/* ============================================
   MODERN TAB NAVIGATION
   ============================================ */
.nav-tabs {
    border-bottom: 2px solid var(--border-light);
    margin-bottom: var(--spacing-md);
    padding: 0;
    display: flex;
    gap: var(--spacing-xs);
}

.nav-tabs .nav-item {
    margin: 0;
    list-style: none;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    position: relative;
    margin-bottom: -2px;
}

.nav-tabs .nav-link i {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    transition: color var(--transition-base);
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    background: var(--gray-50);
    border-bottom-color: var(--border-medium);
}

.nav-tabs .nav-link:hover i {
    color: var(--accent-blue);
}

.nav-tabs .nav-link.active {
    color: var(--accent-blue);
    background: var(--gray-50);
    border-bottom-color: var(--accent-blue);
    font-weight: 600;
}

.nav-tabs .nav-link.active i {
    color: var(--accent-blue);
}

.tab-content {
    padding: var(--spacing-md) 0;
}

.tab-pane {
    animation: fadeIn 0.3s ease-in;
}

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

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* ============================================
   FLATPICKR DATE RANGE PICKER STYLING
   ============================================ */
#dateRangePicker {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    height: calc(1.5em + 0.5rem + 2px);
    font-size: var(--font-size-sm);
}

#dateRangePicker:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
    outline: 0;
}

#dateRangePicker::placeholder {
    color: var(--text-secondary);
}

/* Flatpickr calendar styling */
.flatpickr-calendar {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    font-family: var(--font-family);
}

.flatpickr-months {
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 0.5rem;
}

.flatpickr-month {
    color: var(--text-primary);
}

.flatpickr-current-month {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
}

.flatpickr-prev-month,
.flatpickr-next-month {
    color: var(--text-secondary);
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    color: var(--accent-blue);
}

.flatpickr-weekdays {
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-light);
}

.flatpickr-weekday {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.flatpickr-day {
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}

.flatpickr-day:hover {
    background: var(--primary-100);
    border-color: var(--primary-200);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #ffffff;
    font-weight: 600;
}

.flatpickr-day.inRange {
    background: var(--primary-50);
    border-color: var(--primary-100);
    color: var(--text-primary);
}

.flatpickr-day.today {
    border-color: var(--accent-blue);
}

.flatpickr-day.today:hover {
    background: var(--primary-100);
    border-color: var(--accent-blue);
}
