/* Tours Flame Reservation System - Main Stylesheet */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --bg-dark: #1e293b;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --radius: 12px;
    --radius-sm: 8px;
}

/* ============================================
   Reset & Base
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   App Container Layout
   ============================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--bg-dark) 0%, #0f172a 100%);
    color: white;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.sidebar-header .subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.nav-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
}

.nav-item a i {
    width: 20px;
    text-align: center;
}

.nav-item:hover a,
.nav-item.active a {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active a {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.user-info i {
    font-size: 24px;
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ============================================
   Top Bar
   ============================================ */
.top-bar {
    height: var(--topbar-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar h1 {
    font-size: 24px;
    font-weight: 600;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
}

.top-actions {
    display: flex;
    gap: 12px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

/* ============================================
   Pages
   ============================================ */
.page {
    display: none;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

/* ============================================
   Stats Cards
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   Sections
   ============================================ */
.section {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.view-all {
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

/* ============================================
   Quick Actions
   ============================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: var(--bg-light);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.action-btn i {
    font-size: 32px;
    color: var(--primary);
}

.action-btn span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================
   Tables
   ============================================ */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: var(--bg-light);
}

.data-table td.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* ============================================
   Status Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-confirmed { background: #d1fae5; color: #059669; }
.badge-pending { background: #fef3c7; color: #d97706; }
.badge-completed { background: #dbeafe; color: #2563eb; }
.badge-cancelled { background: #fee2e2; color: #dc2626; }
.badge-draft { background: #f3f4f6; color: #6b7280; }
.badge-sent { background: #d1fae5; color: #059669; }
.badge-paid { background: #d1fae5; color: #059669; }
.badge-unpaid { background: #fee2e2; color: #dc2626; }
.badge-reserved { background: #e0e7ff; color: #4338ca; }
.badge-full_refund { background: #fce7f3; color: #be185d; }
.badge-partial_refund { background: #fff7ed; color: #c2410c; }
.badge-updated { background: #fef3c7; color: #d97706; }
.badge-info { background: #dbeafe; color: #2563eb; }

/* Dashboard status badges */
.badge-upcoming { background: #dbeafe; color: #2563eb; }
.badge-need-attention { background: #fef3c7; color: #d97706; }
.badge-urgent { background: #fee2e2; color: #dc2626; font-weight: 600; }
.badge-all-set { background: #d1fae5; color: #059669; }

/* Action cell styling */
.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin: 0 1px; }

/* ============================================
   Forms & Filters
   ============================================ */
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-input,
.filter-select,
.filter-date {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus,
.filter-select:focus,
.filter-date:focus {
    border-color: var(--primary);
}

.search-input {
    min-width: 250px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ============================================
   Finance Page
   ============================================ */
.finance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.finance-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.finance-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.finance-card p {
    font-size: 28px;
    font-weight: 700;
}

.finance-card.revenue p { color: var(--primary); }
.finance-card.costs p { color: var(--danger); }
.finance-card.profit p { color: var(--success); }

.finance-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-light);
}

.tab-btn.active {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.voucher-finance-lookup {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.voucher-finance-lookup input {
    flex: 1;
    max-width: 300px;
}

/* ============================================
   Suppliers Grid
   ============================================ */
.suppliers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.supplier-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.supplier-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.supplier-card .location {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.supplier-card .contact-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.supplier-card .contact-info p {
    margin-bottom: 4px;
}

.supplier-card .actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

/* ================================================================
   SERVICES PAGE STYLES
   ================================================================ */
.services-info-banner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    border: 1px solid #7dd3fc;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.services-info-banner i {
    color: #0284c7;
    font-size: 20px;
    margin-top: 2px;
}

.services-info-banner strong {
    color: #0369a1;
}

.services-info-banner p {
    margin: 5px 0 0;
    color: #0c4a6e;
    font-size: 13px;
}

/* Service Type Cards */
.service-type-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.service-type-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.service-type-card.inactive {
    opacity: 0.7;
    background: #f9fafb;
}

.service-type-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border);
}

.service-type-info h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--text-primary);
}

.service-type-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.service-type-actions {
    display: flex;
    gap: 6px;
}

/* Presets Section */
.presets-section {
    padding: 16px 20px;
}

.presets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.presets-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.presets-header h4 i {
    margin-right: 6px;
}

.presets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    transition: background 0.2s;
}

.preset-item:hover {
    background: #f1f5f9;
}

.preset-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preset-info strong {
    color: var(--text-primary);
}

.preset-price {
    color: var(--success);
    font-weight: 500;
    font-size: 13px;
}

.preset-fields-count {
    color: var(--text-muted);
    font-size: 12px;
}

.preset-actions {
    display: flex;
    gap: 4px;
}

/* Fields Builder */
.fields-builder-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.fields-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.fields-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--primary);
}

.field-builder-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.field-builder-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.field-builder-item .form-group {
    margin-bottom: 8px;
}

.field-builder-item .form-group label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0 0 20px;
    font-size: 16px;
}

/* Loading States */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.loading-spinner i {
    font-size: 24px;
    margin-bottom: 10px;
}

.loading-text {
    color: var(--text-muted);
    font-size: 13px;
    padding: 10px;
}

/* Small Button Variant */
.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
}

/* ================================================================
   SUPPLIERS PAGE STYLES
   ================================================================ */
.inactive-row {
    opacity: 0.6;
    background: #f9fafb;
}

/* ================================================================
   RESERVATIONS PAGE STYLES  
   ================================================================ */
.reservations-filters .filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.reservations-filters select,
.reservations-filters input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    min-width: 150px;
}

/* Service Item in Reservation Form */
.reservation-service-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.reservation-service-item .service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.reservation-service-item .service-header h5 {
    margin: 0;
    color: var(--primary);
    font-size: 14px;
}

/* External Cost Section */
.external-cost-section {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.external-cost-section h5 {
    margin: 0 0 10px;
    color: #92400e;
    font-size: 13px;
}

/* Dynamic Fields */
.dynamic-field-group {
    margin-bottom: 15px;
}

.dynamic-field-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.dynamic-field-group .required-star {
    color: var(--danger);
}

/* Style inputs inside dynamic fields */
.dynamic-field-group input,
.dynamic-field-group select,
.dynamic-field-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.dynamic-field-group input:focus,
.dynamic-field-group select:focus,
.dynamic-field-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dynamic-field-group input[type="number"] {
    -moz-appearance: textfield;
}

.dynamic-field-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* Dynamic fields container */
.dynamic-fields-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.dynamic-fields-container:empty {
    display: none;
}

/* Cost Status Section */
.cost-status-section {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.cost-status-section .form-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* Convert Options */
.convert-options {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.convert-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
}

/* Reservation View Modal */
.reservation-detail-section {
    margin-bottom: 20px;
}

.reservation-detail-section h4 {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.reservation-service-view {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.reservation-service-view .field-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.reservation-service-view .field-row .label {
    color: var(--text-secondary);
}

.reservation-service-view .field-row .value {
    color: var(--text-primary);
    font-weight: 500;
}


/* ============================================
   Settings Page
   ============================================ */
.settings-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.settings-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.settings-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.settings-card h3 i {
    color: var(--primary);
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================
   Toast Notifications
   ============================================ */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

.toast i {
    font-size: 20px;
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .page {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .search-input {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }
    
    .top-bar h1 {
        font-size: 18px;
    }
}

/* ============================================
   Finance Module - Additional Styles
   ============================================ */

/* Finance Controls - Date Range */
.finance-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.finance-controls .filter-date {
    padding: 8px 12px;
}

/* Finance Detail View */
.voucher-finance-detail {
    padding: 20px 0;
}

.voucher-finance-detail .finance-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.voucher-finance-detail .finance-header h3 {
    margin: 0 0 5px 0;
    color: var(--primary);
}

.voucher-finance-detail .finance-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Summary Cards in Detail View */
.finance-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-card {
    background: var(--bg-light);
    padding: 15px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.summary-card .label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.summary-card .value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Finance Sections */
.finance-section {
    margin-bottom: 25px;
}

.finance-section h4 {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.finance-section h4 i {
    margin-right: 8px;
    color: var(--primary);
}

/* Mini Table for Finance Details */
.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mini-table th,
.mini-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.mini-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
}

.mini-table tbody tr:hover {
    background: var(--bg-light);
}

/* Checkbox Items in Modal */
.checkbox-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    background: var(--bg-light);
}

.checkbox-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.commission-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.commission-input label {
    font-size: 12px;
    color: var(--text-secondary);
}

.commission-input input,
.commission-input select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

/* Supplier Detail View */
.supplier-detail {
    padding: 10px 0;
}

.supplier-detail h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

/* Badge styles for paid/pending */
.badge-paid {
    background: var(--success);
    color: white;
}

.badge-pending {
    background: var(--warning);
    color: white;
}

/* ============================================
   Finance Module - Additional Styles v2
   ============================================ */

/* Clickable table rows */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover {
    background-color: rgba(102, 126, 234, 0.1) !important;
}

.clickable-row .voucher-link {
    color: var(--primary);
    text-decoration: underline;
}

/* Finance Controls - Date Range */
.finance-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.finance-controls .filter-date {
    padding: 8px 12px;
}

/* Finance Detail View */
.voucher-finance-detail {
    padding: 20px 0;
}

.voucher-finance-detail .finance-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.voucher-finance-detail .finance-header h3 {
    margin: 0 0 5px 0;
    color: var(--primary);
}

.voucher-finance-detail .finance-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Summary Cards in Detail View */
.finance-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-card {
    background: var(--bg-light);
    padding: 15px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.summary-card .label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.summary-card .value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Finance Sections */
.finance-section {
    margin-bottom: 25px;
}

.finance-section h4 {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.finance-section h4 i {
    margin-right: 8px;
    color: var(--primary);
}

/* Mini Table for Finance Details */
.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mini-table th,
.mini-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.mini-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
}

.mini-table tbody tr:hover {
    background: var(--bg-light);
}

/* Checkbox Items in Modal */
.checkbox-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    background: var(--bg-light);
}

.checkbox-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.commission-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.commission-input label {
    font-size: 12px;
    color: var(--text-secondary);
}

.commission-input input,
.commission-input select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

/* Supplier Detail View */
.supplier-detail {
    padding: 10px 0;
}

.supplier-detail h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

/* Period Summary Box */
.period-summary {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.period-summary h4 {
    margin: 0 0 10px 0;
}

/* Badge styles for paid/pending */
.badge-paid {
    background: var(--success);
    color: white;
}

.badge-pending {
    background: var(--warning);
    color: white;
}

/* Form Row for side-by-side inputs */
.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Preset Manager */
.preset-manager {
    min-height: 400px;
}

.preset-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.preset-tabs .tab-btn {
    padding: 8px 15px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.preset-tabs .tab-btn:hover {
    background: var(--bg-light);
}

.preset-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.preset-tabs .tab-btn .badge {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.preset-tabs .tab-btn.active .badge {
    background: rgba(255,255,255,0.3);
}

/* Preset Grid */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.preset-card {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.preset-card.inactive {
    opacity: 0.6;
}

.preset-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.preset-info {
    flex: 1;
    min-width: 0;
}

.preset-info h4 {
    margin: 0 0 5px;
    font-size: 14px;
}

.preset-info p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preset-meta {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.preset-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Icon/Color Selectors */
.icon-btn {
    border: 2px solid transparent;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
}

.icon-btn.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

/* Itinerary Builder */
.itinerary-builder {
    min-height: 500px;
}

.builder-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.day-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.day-tab {
    padding: 10px 18px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.day-tab:hover {
    background: var(--bg-light);
}

.day-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.day-tab .badge {
    margin-left: 5px;
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.day-tab.active .badge {
    background: rgba(255,255,255,0.3);
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.day-header h4 {
    margin: 0;
}

/* Itinerary Items */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.itinerary-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}

.itinerary-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.item-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.item-content {
    flex: 1;
    min-width: 0;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.item-header h5 {
    margin: 0;
    font-size: 15px;
}

.item-time {
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
    margin-right: 8px;
}

.item-actions {
    display: flex;
    gap: 5px;
}

.item-description {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.item-location, .item-duration {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.item-location i, .item-duration i {
    margin-right: 5px;
    width: 14px;
}

.item-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.field-value {
    font-size: 12px;
    color: var(--text-secondary);
}

.field-value strong {
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
}

/* PDF Preview */
.pdf-preview {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: white;
}

.pdf-preview h2 {
    margin-top: 0;
}

.pdf-preview h3 {
    margin-top: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

/* Modal sizes */
.modal-lg .modal-content {
    max-width: 800px;
}

.modal-xl .modal-content {
    max-width: 1000px;
}

/* Preset Fields Form */
.preset-fields-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.preset-fields-form .form-group {
    margin: 0;
}

@media (max-width: 768px) {
    .preset-fields-form {
        grid-template-columns: 1fr;
    }
    
    .preset-grid {
        grid-template-columns: 1fr;
    }
}

/* itinerary-styles.css - Add to your main styles.css */

/* Preset Manager */
.preset-manager {
    min-height: 400px;
}

.preset-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.preset-tabs .tab-btn {
    padding: 8px 15px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.preset-tabs .tab-btn:hover {
    background: var(--bg-light);
}

.preset-tabs .tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.preset-tabs .tab-btn .badge {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.preset-tabs .tab-btn.active .badge {
    background: rgba(255,255,255,0.3);
}

/* Preset Grid */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.preset-card {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.preset-card.inactive {
    opacity: 0.6;
}

.preset-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.preset-info {
    flex: 1;
    min-width: 0;
}

.preset-info h4 {
    margin: 0 0 5px;
    font-size: 14px;
}

.preset-info p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preset-meta {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.preset-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Icon/Color Selectors */
.icon-btn {
    border: 2px solid transparent;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
}

.icon-btn.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

/* Itinerary Builder */
.itinerary-builder {
    min-height: 500px;
}

.builder-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.day-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.day-tab {
    padding: 10px 18px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.day-tab:hover {
    background: var(--bg-light);
}

.day-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.day-tab .badge {
    margin-left: 5px;
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.day-tab.active .badge {
    background: rgba(255,255,255,0.3);
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.day-header h4 {
    margin: 0;
}

/* Itinerary Items */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.itinerary-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}

.itinerary-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.item-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.item-content {
    flex: 1;
    min-width: 0;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.item-header h5 {
    margin: 0;
    font-size: 15px;
}

.item-time {
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
    margin-right: 8px;
}

.item-actions {
    display: flex;
    gap: 5px;
}

.item-description {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.item-location, .item-duration {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.item-location i, .item-duration i {
    margin-right: 5px;
    width: 14px;
}

.item-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.field-value {
    font-size: 12px;
    color: var(--text-secondary);
}

.field-value strong {
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
}

/* PDF Preview */
.pdf-preview {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: white;
}

.pdf-preview h2 {
    margin-top: 0;
}

.pdf-preview h3 {
    margin-top: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

/* Modal sizes */
.modal-lg .modal-content {
    max-width: 800px;
}

.modal-xl .modal-content {
    max-width: 1000px;
}

/* Preset Fields Form */
.preset-fields-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.preset-fields-form .form-group {
    margin: 0;
}

@media (max-width: 768px) {
    .preset-fields-form {
        grid-template-columns: 1fr;
    }
    
    .preset-grid {
        grid-template-columns: 1fr;
    }
}

/* Fix settings card table overflow */
.settings-card {
    overflow: hidden;
}

.settings-card .data-table {
    width: 100%;
    table-layout: fixed;
}

.settings-card .table-container {
    overflow-x: auto;
    margin: 0 -24px;
    padding: 0 24px;
}

/* Fix User Management table */
#usersListContainer {
    overflow-x: auto;
}

#usersListContainer .data-table {
    min-width: 600px;
}

#usersListContainer .data-table th,
#usersListContainer .data-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Fix Service Types table */
#serviceTypesContainer {
    overflow-x: auto;
}

#serviceTypesContainer .data-table {
    min-width: 500px;
}

#serviceTypesContainer .data-table th,
#serviceTypesContainer .data-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* General table fix in settings cards */
.settings-card table {
    font-size: 13px;
}

.settings-card table th {
    font-weight: 600;
    background: var(--bg-light);
}

.settings-card table td {
    vertical-align: middle;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .settings-card {
        padding: 16px;
    }
    
    .settings-card .data-table {
        font-size: 12px;
    }
    
    .settings-card .btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}
