/* Custom Style System for Event-Blitzer Fotobox ERP */

/* ==========================================
   DESIGN TOKENS & SYSTEM VARIABLES
   ========================================== */
:root {
    /* Fonts */
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    
    /* Layout Constants */
    --sidebar-width: 260px;
    --header-height: 70px;
    --bottom-nav-height: 64px;
    
    /* Status Colors */
    --color-success: #2e7d32;
    --color-success-bg: rgba(46, 125, 50, 0.15);
    --color-success-border: rgba(46, 125, 50, 0.3);
    
    --color-warning: #f57f17;
    --color-warning-bg: rgba(245, 127, 23, 0.15);
    --color-warning-border: rgba(245, 127, 23, 0.3);
    
    --color-info: #0288d1;
    --color-info-bg: rgba(2, 136, 209, 0.15);
    --color-info-border: rgba(2, 136, 209, 0.3);
    
    --color-danger: #d32f2f;
    --color-danger-bg: rgba(211, 47, 47, 0.15);
    --color-danger-border: rgba(211, 47, 47, 0.3);
}

/* Default Dark Theme variables */
:root, [data-theme="dark"] {
    color-scheme: dark;
    
    --bg-color: #0c0e12;
    --bg-gradient: linear-gradient(135deg, #0c0e12 0%, #151922 100%);
    --bg-card: rgba(22, 28, 38, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-color: #8bc34a; /* Event-Blitzer Lime Green */
    --accent-hover: #9ccc65;
    --accent-glow: rgba(139, 195, 74, 0.15);
    
    --glass-bg: rgba(18, 22, 30, 0.75);
    --glass-blur: 16px;
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shine: linear-gradient(110deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.04));
    
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    
    --scrollbar-thumb: #374151;
    --scrollbar-track: #111827;
}

/* Light Theme overrides */
[data-theme="light"] {
    color-scheme: light;
    
    --bg-color: #f3f4f6;
    --bg-gradient: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    --bg-card: rgba(255, 255, 255, 0.7);
    --border-color: rgba(0, 0, 0, 0.08);
    
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    
    --accent-color: #689f38; /* Slightly darker green for readability */
    --accent-hover: #558b2f;
    --accent-glow: rgba(104, 159, 56, 0.1);
    
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-blur: 12px;
    --glass-border: rgba(0, 0, 0, 0.04);
    --glass-shine: linear-gradient(110deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.05);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    
    --scrollbar-thumb: #d1d5db;
    --scrollbar-track: #f3f4f6;
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-color);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--accent-hover);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Utilities */
.hide { display: none !important; }
.bold { font-weight: 600; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-md { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-secondary { color: var(--text-secondary); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.green-text { color: #8bc34a !important; }
[data-theme="light"] .green-text { color: #558b2f !important; }
.red-text { color: var(--color-danger) !important; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.mt-2 { margin-top: 8px; }
.mt-auto { margin-top: auto; }

/* ==========================================
   GLASSMORPHISM PATTERNS
   ========================================== */
.glass {
    background: var(--glass-bg);
    background-image: var(--glass-shine);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft), var(--shadow-inset);
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px; /* Touch target size */
}

.btn-primary {
    background-color: var(--accent-color);
    color: #0c0e12;
    font-weight: 600;
}
.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-primary:active {
    transform: translateY(1px);
}

.btn-success {
    background-color: var(--color-success);
    color: white;
}
.btn-success:hover {
    background-color: #388e3c;
    transform: translateY(-1px);
}

.btn-red {
    background-color: var(--color-danger);
    color: white;
}
.btn-red:hover {
    background-color: #b71c1c;
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

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

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
}
.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    min-height: 26px;
}

.button-wa {
    background-color: #25d366;
    color: white !important;
}
.button-wa:hover {
    background-color: #128c7e;
}

/* ==========================================
   FORM CONTROLS
   ========================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    outline: none;
    transition: all 0.2s;
    min-height: 44px; /* Mobile touch size */
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 16px;
}
.col-6 { width: 50%; }
.col-8 { width: 66.66%; }
.col-4 { width: 33.33%; }

.form-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

.help-text {
    font-size: 11px;
    color: var(--text-muted);
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon-wrapper input {
    padding-left: 40px;
}
.input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}
.input-icon-wrapper input.has-toggle {
    padding-right: 42px;
}
.input-icon-wrapper input.has-toggle::-webkit-credentials-auto-fill-button {
    margin-right: 24px;
}
.btn-toggle-pw {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    padding: 6px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}
.btn-toggle-pw:hover, .btn-toggle-pw:focus {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}
.btn-toggle-pw svg, .btn-toggle-pw i {
    width: 18px;
    height: 18px;
}
input.masked-secret {
    -webkit-text-security: disc;
    text-security: disc;
}

/* Checkboxes */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.checkbox-container input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
}

/* ==========================================
   BADGES
   ========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}
.badge-blue { background: var(--color-info-bg); border-color: var(--color-info-border); color: #0288d1; }
.badge-green { background: var(--color-success-bg); border-color: var(--color-success-border); color: var(--accent-color); }
.badge-yellow { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: #fbc02d; }
.badge-red { background: var(--color-danger-bg); border-color: var(--color-danger-border); color: #e53935; }

/* ==========================================
   LOGIN SCREEN LAYOUT
   ========================================== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    max-width: 400px;
    width: 100%;
    padding: 35px;
    border-radius: 16px;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

.login-logo {
    height: 70px;
    width: auto;
    max-width: 100%;
    border-radius: 14px;
    object-fit: contain;
    margin-bottom: 15px;
}

.brand-header h1 {
    font-size: 24px;
    margin-bottom: 6px;
}
.brand-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.error-msg {
    color: var(--danger-color);
    background: rgba(var(--danger-rgb), 0.1);
    border: 1px solid rgba(var(--danger-rgb), 0.2);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ==========================================
   MAIN VIEWPORT & SHELL LAYOUT
   ========================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    border-radius: 0;
    border-top: 0;
    border-bottom: 0;
    border-left: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.nav-logo {
    height: 34px;
    width: auto;
    max-width: 120px;
    border-radius: 6px;
    object-fit: contain;
}
.brand-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 17px;
    color: var(--text-primary);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 24px 16px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    padding: 12px 16px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.nav-item i {
    width: 18px;
    height: 18px;
}
.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}
.nav-item.active {
    color: var(--text-primary);
    background: var(--accent-glow);
    border-left: 3px solid var(--accent-color);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

/* Bottom Navigation (Hidden on desktop) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    z-index: 100;
    border-radius: 0;
    border-bottom: 0;
    border-left: 0;
    border-right: 0;
    justify-content: space-around;
    align-items: center;
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    font-size: 10px;
    font-family: var(--font-body);
    font-weight: 500;
    gap: 4px;
    flex-grow: 1;
    height: 100%;
}
.bottom-nav-item i {
    width: 20px;
    height: 20px;
}
.bottom-nav-item.active {
    color: var(--accent-color);
}

/* Main Viewport Content */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    padding-top: calc(var(--header-height) + 30px);
    min-height: 100vh;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    z-index: 90;
    border-radius: 0;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

#page-title {
    font-size: 20px;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

#theme-toggle .moon-icon { display: none; }
[data-theme="light"] #theme-toggle .sun-icon { display: none; }
[data-theme="light"] #theme-toggle .moon-icon { display: block; }

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--border-color);
    border: 1px solid var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
}

/* Tab Management */
.tab-pane {
    display: none;
    animation: fadeScale 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-pane.active {
    display: block;
}

/* ==========================================
   DASHBOARD VIEW STYLES
   ========================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}
.kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
}
.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
}
.kpi-icon i {
    width: 24px;
    height: 24px;
}
.kpi-info {
    display: flex;
    flex-direction: column;
}
.kpi-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.kpi-value {
    font-size: 20px;
    font-weight: 700;
    margin-top: 2px;
}

.card-blue .kpi-icon { color: var(--color-info); }
.card-yellow .kpi-icon { color: #fbc02d; }
.card-green .kpi-icon { color: var(--accent-color); }
.card-red .kpi-icon { color: var(--color-danger); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.dashboard-card {
    border-radius: 14px;
    display: flex;
    flex-direction: column;
}

.dashboard-card .card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.dashboard-card .card-header h3 {
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dashboard-card .card-body {
    padding: 20px;
    flex-grow: 1;
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    /* Reset native button styles */
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
    text-align: left;
    width: 100%;
    /* List item styling */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
    cursor: pointer;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.list-item:hover {
    transform: translateX(4px);
    border-color: var(--text-muted);
}
.list-item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.list-item-title {
    font-weight: 600;
    font-size: 14px;
}
.list-item-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}
.list-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

/* ==========================================
   BOOKINGS VIEW STYLES
   ========================================== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex-grow: 1;
    max-width: 400px;
}
.search-box input {
    padding-left: 40px;
}
.search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.booking-filter-chips {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding-bottom: 5px;
}
.chip {
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.chip:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}
.chip.active {
    background: var(--accent-color);
    color: #0c0e12;
    border-color: var(--accent-color);
    font-weight: 600;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.booking-card {
    /* Reset native button styles */
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--border-color);
    background: transparent;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
    text-align: left;
    width: 100%;
    /* Card styling */
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    cursor: pointer;
    transition: transform 0.25s, border-color 0.25s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
@media (hover: hover) {
    .booking-card:hover {
        transform: translateY(-4px);
        border-color: var(--accent-color);
    }
}

.booking-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.booking-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.booking-card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.meta-item i {
    width: 16px;
    height: 16px;
}

.booking-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
.price-tag {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
}

/* ==========================================
   EXPENSES / TABLE STYLES
   ========================================== */
.eur-header {
    border-radius: 14px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}
.eur-selector select {
    width: 120px;
    margin-top: 4px;
}
.eur-summary-strip {
    display: flex;
    align-items: center;
    gap: 15px;
}
.eur-sum-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.eur-sum-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.eur-sum-val {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-top: 2px;
}

.tab-sub-navigation {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.sub-nav-btn {
    background: transparent;
    border: 0;
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.sub-nav-btn:hover {
    color: var(--text-primary);
}
.sub-nav-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    font-weight: 600;
}

.subtab-pane {
    display: none;
}
.subtab-pane.active {
    display: block;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
}
.table-responsive .data-table {
    min-width: 480px;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
}
.data-table th,
.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}
.data-table th {
    background: rgba(0, 0, 0, 0.2);
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-secondary);
}
.data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.data-table.compact th,
.data-table.compact td {
    padding: 10px 14px;
}

.eur-report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}
.eur-details-card {
    border-radius: 12px;
    padding: 20px;
}
.eur-details-card h3 {
    font-size: 15px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* ==========================================
   CRM MAILBOX STYLES
   ========================================== */
.mailbox-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: calc(100vh - var(--header-height) - 60px);
    max-height: calc(100vh - var(--header-height) - 60px);
    border-radius: 14px;
    overflow: hidden;
}

.mailbox-sidebar {
    border-right: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}
.mailbox-search {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.mail-list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}
.mail-list-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}
.mail-list-item:hover {
    background: rgba(255, 255, 255, 0.02);
}
.mail-list-item.active {
    background: var(--accent-glow);
    border-left: 3px solid var(--accent-color);
}

.mailbox-content {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.05);
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.mail-header-info {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.chat-thread-container {
    flex: 1 1 0;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    gap: 14px;
    padding: 40px;
}

/* Chat Bubbles */
.chat-bubble {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.chat-bubble-meta {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 4px;
}
.chat-bubble-body {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
}

.chat-bubble.incoming {
    align-self: flex-start;
}
.chat-bubble.incoming .chat-bubble-body {
    background: rgba(255, 255, 255, 0.07);
    border-bottom-left-radius: 2px;
    color: var(--text-primary);
}

.chat-bubble.outgoing {
    align-self: flex-end;
}
.chat-bubble.outgoing .chat-bubble-body {
    background: var(--accent-glow);
    border-bottom-right-radius: 2px;
    border: 1px solid rgba(139, 195, 74, 0.2);
    color: var(--text-primary);
}

.chat-bubble-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}
.chat-bubble-body pre, .chat-bubble-body table {
    max-width: 100%;
    overflow-x: auto;
}

.mail-reply-area {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}
.mail-reply-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}
.mail-attachment-info {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================
   SETTINGS LAYOUT
   ========================================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    max-width: 100%;
    box-sizing: border-box;
}
.settings-card {
    border-radius: 14px;
    padding: 25px;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}
.settings-card h3 {
    font-size: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.settings-card.span-2 {
    grid-column: span 2;
}

.card-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.card-title-bar h3 {
    margin-bottom: 0;
}

.google-auth-strip {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* ==========================================
   NATIVE MODALS & DIALOGS
   ========================================== */
.modal-dialog {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    margin: auto;
    outline: none;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
    background: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
}
.modal-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.modal-dialog.large {
    max-width: 950px;
}
.modal-dialog.x-large {
    max-width: 1100px;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}
.dialog-header h2 {
    font-size: 18px;
    font-weight: 700;
}
.dialog-body {
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}
.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

/* Booking details split */
.detail-modal-body {
    padding: 0;
}
.detail-split-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    height: 75vh;
}
.detail-info-pane {
    padding: 24px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(0, 0, 0, 0.1);
    min-height: 0;
    height: 100%;
}
.detail-crm-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}
.crm-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.crm-reply-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}
.crm-reply-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-status-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.detail-section h4 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.button-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.button-stack .btn {
    justify-content: flex-start;
    padding-left: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* Cohesive outline-based semantic actions */
.button-stack .btn.btn-red {
    background-color: transparent;
    border-color: rgba(211, 47, 47, 0.4);
    color: var(--color-danger);
}
.button-stack .btn.btn-red:hover {
    background-color: rgba(211, 47, 47, 0.08);
}

.button-stack .btn.button-wa {
    background-color: transparent;
    border-color: rgba(37, 211, 102, 0.4);
    color: #25d366 !important;
}
.button-stack .btn.button-wa:hover {
    background-color: rgba(37, 211, 102, 0.08);
}

.button-stack .btn.btn-success {
    background-color: transparent;
    border-color: rgba(46, 125, 50, 0.4);
    color: #8bc34a !important;
}
.button-stack .btn.btn-success:hover {
    background-color: rgba(46, 125, 50, 0.08);
}

.button-stack .btn.btn-primary {
    background-color: transparent;
    border-color: var(--accent-color);
    color: var(--accent-color) !important;
}
.button-stack .btn.btn-primary:hover {
    background-color: rgba(139, 195, 74, 0.08);
}

/* Expense Scanner Split Layout */
.expense-dialog-body {
    padding: 0;
}
.expense-split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 70vh;
}
.expense-scan-pane {
    border-right: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.expense-form-pane {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.upload-dropzone {
    width: 100%;
    max-width: 380px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    transition: border-color 0.2s, background 0.2s;
}
.upload-dropzone:hover {
    border-color: var(--accent-color);
    background: rgba(139, 195, 74, 0.02);
}
.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
    stroke-width: 1.5;
}

.preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.preview-toolbar {
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.file-viewer-frame {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background: #000;
    border-radius: 8px;
    margin-top: 10px;
}
.file-viewer-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.2s;
}

.email-attachment-box {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}
.attachment-details {
    display: flex;
    flex-direction: column;
}

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

/* ==========================================
   MOBILE RESPONSIVENESS & BREAKPOINTS
   ========================================== */
@media (max-width: 1024px) {
    /* Tablet structures */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .settings-card.span-2 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    /* Mobile Shell Layout changes */
    .sidebar {
        display: none; /* Hide desktop sidebar */
    }
    .bottom-nav {
        display: flex; /* Show bottom bar */
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: calc(var(--header-height) + 16px);
        padding-bottom: calc(var(--bottom-nav-height) + 20px);
        max-width: 100%;
        overflow-x: hidden;
    }
    .app-header {
        left: 0;
        padding: 0 16px;
    }

    /* Settings Grid on Mobile */
    .settings-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .settings-card {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        padding: 18px !important;
        box-sizing: border-box !important;
    }
    .settings-card.span-2 {
        grid-column: 1 / -1 !important;
    }
    
    /* Grid collapses */
    .grid-layout {
        grid-template-columns: 1fr;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .eur-report-grid {
        grid-template-columns: 1fr;
    }
    
    /* Toolbar stack on mobile */
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .search-box {
        max-width: 100%;
    }
    
    /* EÜR Summary Layout */
    .eur-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .eur-summary-strip {
        width: 100%;
        justify-content: space-around;
        flex-wrap: wrap;
        gap: 10px;
    }
    .minus-operator, .equal-operator {
        display: none; /* Hide operators on mobile to save space */
    }
    
    /* Modals & Dialogs on Mobile */
    .modal-dialog[open] {
        position: fixed !important;
        top: 15px !important;
        bottom: 15px !important;
        left: 2.5% !important;
        right: 2.5% !important;
        width: 95% !important;
        max-width: 95% !important;
        height: calc(100% - 30px) !important;
        max-height: calc(100% - 30px) !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .dialog-body {
        flex-grow: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 16px !important;
    }
    
    /* Layout collapses in dialogs */
    .detail-split-layout {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
    }
    .detail-info-pane {
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
        height: auto !important;
        overflow-y: visible !important;
        padding: 16px !important;
    }
    .detail-crm-pane {
        height: auto !important;
        overflow: visible !important;
    }
    .chat-thread-container {
        max-height: 300px;
        overflow-y: auto;
    }
    
    .expense-split-layout {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
    }
    .expense-scan-pane {
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
        height: auto !important;
        max-height: 250px;
    }
    .expense-form-pane {
        height: auto !important;
        padding: 16px !important;
    }
    
    .mailbox-layout {
        grid-template-columns: 1fr; /* Stack mail sidebar and chat on mobile */
    }
    .mailbox-sidebar {
        display: none; /* In email tab, we can hide the sidebar or toggle it */
    }
    .mailbox-layout.show-sidebar .mailbox-sidebar {
        display: flex;
    }
    .mailbox-layout.show-sidebar .mailbox-content {
        display: none;
    }
    
    /* Forms collapse */
    .form-row {
        display: block !important;
    }
    .form-row > div {
        width: 100% !important;
        margin-bottom: 12px;
    }
}

/* Loading Spinner Utility */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 8px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
