/* ========================================
   CashFlow NL - Premium Fintech Dashboard
   ======================================== */

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

:root {
    /* Premium Dark Theme Colors */
    --bg-primary: #0B0E1A;
    --bg-secondary: #13172A;
    --bg-tertiary: #1A1F38;
    --bg-card: #1E2442;
    --bg-elevated: #252B4A;
    
    /* Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #A8B2D1;
    --text-muted: #6B7A99;
    
    /* Accent Colors */
    --accent-primary: #6C5CE7;
    --accent-success: #00D9A3;
    --accent-warning: #FFB020;
    --accent-danger: #FF5370;
    --accent-info: #00B8D9;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    --gradient-success: linear-gradient(135deg, #00D9A3 0%, #00A67E 100%);
    --gradient-warning: linear-gradient(135deg, #FFB020 0%, #FF8C00 100%);
    --gradient-danger: linear-gradient(135deg, #FF5370 0%, #E73C6F 100%);
    
    /* Borders & Shadows */
    --border-color: #2A3250;
    --border-subtle: #1F2541;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px rgba(108, 92, 231, 0.15);
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ========================================
   Sticky Header (Compact)
   ======================================== */

.header-sticky {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo-compact {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon-compact {
    font-size: 28px;
    filter: drop-shadow(0 2px 6px rgba(108, 92, 231, 0.3));
}

.logo-text-compact {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.logo-title-compact {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 20px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-sub-compact {
    font-size: 9px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.nav-compact {
    display: flex;
    gap: 4px;
}

.nav-link-compact {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link-compact:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link-compact.active {
    color: var(--text-primary);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
}

.btn-header-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gradient-primary);
    color: var(--text-primary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
    transition: all 0.2s ease;
}

.btn-header-primary:hover {
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4);
    transform: translateY(-1px);
}

.btn-header-primary .btn-icon {
    font-size: 18px;
    font-weight: 700;
}

/* ========================================
   Main Layout
   ======================================== */

.main-content {
    padding-top: var(--spacing-2xl);
    padding-bottom: var(--spacing-2xl);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
}

/* ========================================
   Scrollable Page Headers (in content)
   ======================================== */

.page-header-scrollable {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.page-header-left {
    flex: 1;
}

.page-header-right {
    flex-shrink: 0;
}

.page-title-large {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -1px;
    line-height: 1.2;
}

.page-subtitle-large {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.btn-new-invoice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-primary);
    color: var(--text-primary);
    text-decoration: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-new-invoice:hover {
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4);
    transform: translateY(-2px);
}

.btn-new-invoice .btn-icon {
    font-size: 18px;
    font-weight: 700;
}

/* ========================================
   Legacy Page Headers (for other pages)
   ======================================== */

.page-header {
    margin-bottom: var(--spacing-xl);
}

.page-header-content {
    max-width: 800px;
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -1px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========================================
   Section Headers
   ======================================== */

.section-header {
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* ========================================
   Cards Grid
   ======================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    font-size: 32px;
    margin-bottom: var(--spacing-sm);
    opacity: 0.9;
}

.card-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: var(--spacing-xs);
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.2;
}

.card-change {
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-change.positive {
    color: var(--accent-success);
}

.card-change.negative {
    color: var(--accent-danger);
}

.card-change.neutral {
    color: var(--text-secondary);
}

/* Specific Card Styles */
.card-balance .card-value {
    color: var(--accent-success);
}

.card-incoming .card-value {
    color: var(--accent-info);
}

.card-outgoing .card-value {
    color: var(--accent-warning);
}

/* Runway Card */
.card-runway {
    grid-column: 1 / -1;
}

.runway-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin: var(--spacing-md) 0;
}

.runway-fill {
    height: 100%;
    background: var(--gradient-success);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.card-runway.runway-orange .runway-fill {
    background: var(--gradient-warning);
}

.card-runway.runway-red .runway-fill {
    background: var(--gradient-danger);
}

.card-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 13px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-green {
    background: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
}

.status-orange {
    background: var(--accent-warning);
    box-shadow: 0 0 8px var(--accent-warning);
}

.status-red {
    background: var(--accent-danger);
    box-shadow: 0 0 8px var(--accent-danger);
}

/* ========================================
   CashPilot Panel
   ======================================== */

.cashpilot-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-md);
}

.pilot-header {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.pilot-icon {
    font-size: 48px;
    line-height: 1;
}

.pilot-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pilot-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.pilot-description {
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent-primary);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-lg);
}

.pilot-description p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.pilot-empty-state {
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.pilot-empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* ========================================
   Form Styles
   ======================================== */

.pilot-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-textarea {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    resize: vertical;
    transition: all 0.2s ease;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.form-textarea::placeholder {
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

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

.btn-primary:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 16px;
}

/* ========================================
   Alerts Panel
   ======================================== */

.alerts-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.alerts-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.alert {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    border-left: 3px solid;
    transition: all 0.2s ease;
}

.alert:hover {
    transform: translateX(4px);
}

.alert-success {
    background: rgba(0, 217, 163, 0.08);
    border-left-color: var(--accent-success);
}

.alert-warning {
    background: rgba(255, 176, 32, 0.08);
    border-left-color: var(--accent-warning);
}

.alert-info {
    background: rgba(0, 184, 217, 0.08);
    border-left-color: var(--accent-info);
}

.alert-danger {
    background: rgba(255, 83, 112, 0.08);
    border-left-color: var(--accent-danger);
}

.alert-icon {
    font-size: 18px;
    line-height: 1;
    opacity: 0.9;
}

.alert-content {
    flex: 1;
}

.alert-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.alert-text {
    font-size: 13px;
    color: var(--text-primary);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .nav-compact {
        gap: 2px;
    }
    
    .nav-link-compact {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .page-header-scrollable {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .page-header-right {
        width: 100%;
    }
    
    .btn-new-invoice {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-compact {
        height: auto;
        min-height: 56px;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) 0;
    }
    
    .logo-icon-compact {
        font-size: 24px;
    }
    
    .logo-title-compact {
        font-size: 18px;
    }
    
    .logo-sub-compact {
        font-size: 8px;
    }
    
    .nav-compact {
        width: 100%;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .nav-link-compact {
        flex: 1 1 auto;
        text-align: center;
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .main-content {
        padding-top: var(--spacing-lg);
        padding-bottom: var(--spacing-lg);
    }
    
    .page-title-large {
        font-size: 28px;
    }
    
    .page-subtitle-large {
        font-size: 14px;
    }
    
    .page-header-scrollable {
        margin-bottom: var(--spacing-lg);
        padding-bottom: var(--spacing-md);
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .card-runway {
        grid-column: 1;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .card-value {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .logo-title-compact {
        font-size: 16px;
    }
    
    .nav-link-compact {
        font-size: 10px;
        padding: 6px 8px;
    }
    
    .page-title-large {
        font-size: 24px;
    }
    
    .btn-new-invoice {
        padding: 10px 18px;
        font-size: 13px;
    }
}

/* ========================================
   Footer
   ======================================== */

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-2xl);
}

.footer-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 0.3px;
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .main {
        padding: var(--spacing-lg) 0;
    }
    
    .pilot-header {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .pilot-icon {
        font-size: 36px;
    }
}
