/* MK Flow - VDE Glassmorphism Design System */
:root {
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    /* VDE Merk Kleuren */
    --flow-blue: #0284c7;
    --flow-blue-dark: #0369a1;
    --flow-blue-light: rgba(2, 132, 199, 0.12);
    --flow-blue-glow: rgba(2, 132, 199, 0.25);
    
    /* Neurale Tinten */
    --bg-base: #f3f5f8;
    --glass-bg: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(255, 255, 255, 0.9);
    --metallic-silver: #d1d5db;
    --metallic-border: #f3f5f8;
    
    /* Tekst */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* Schaduwen */
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.09);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(2, 132, 199, 0.04), transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(2, 132, 199, 0.03), transparent 30%);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
}

/* Glassmorphism Class */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    border-radius: 20px;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    margin: 20px 24px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-badge {
    background: linear-gradient(135deg, var(--flow-blue), var(--flow-blue-dark));
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--flow-blue-glow);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.trademark {
    font-size: 0.8rem;
    vertical-align: top;
    color: var(--flow-blue);
    margin-left: 2px;
}

.sub-badge {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--flow-blue);
}

.highlight-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--flow-blue-light);
    color: var(--flow-blue-dark);
    border-radius: 8px;
}

/* Tab Selector */
.tab-selector-container {
    display: flex;
    justify-content: center;
    margin: 0 24px 20px;
}

.tab-selector {
    display: inline-flex;
    padding: 6px;
    gap: 8px;
    border-radius: 100px;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    background: transparent;
    border-radius: 100px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.6);
}

.tab-btn.active {
    background: var(--flow-blue);
    color: white;
    box-shadow: 0 4px 14px var(--flow-blue-glow);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 0 24px;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.form-panel, .preview-panel {
    padding: 28px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--metallic-silver);
}

.status-indicator {
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--flow-blue-light);
    color: var(--flow-blue-dark);
    padding: 4px 10px;
    border-radius: 100px;
}

/* Form Styling */
.form-section {
    margin-bottom: 24px;
}

.form-section h3 {
    font-size: 1.05rem;
    margin-bottom: 12px;
}

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

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--metallic-silver);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--flow-blue);
    box-shadow: 0 0 0 3px var(--flow-blue-light);
}

.full-width {
    grid-column: 1 / -1;
}

/* Invoice Lines */
.invoice-lines-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invoice-line-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1.2fr 1fr auto;
    gap: 8px;
    align-items: center;
}

.btn-remove-line {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-remove-line:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

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

.btn-primary {
    background-color: var(--flow-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--flow-blue-dark);
}

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

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.btn-metallic {
    background: linear-gradient(135deg, #ffffff, #f3f5f8);
    border: 1px solid var(--metallic-border);
    color: var(--text-primary);
}

.btn-metallic:hover {
    filter: brightness(0.96);
}

.btn-large {
    padding: 13px 24px;
    font-size: 1rem;
}

/* A4 Live Preview */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.preview-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.a4-viewport {
    background: #f3f5f8;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    overflow-x: auto;
}

.a4-document {
    width: 100%;
    max-width: 550px;
    min-height: 650px;
    background: white;
    padding: 32px;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.doc-header-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.doc-brand {
    font-size: 1.3rem;
    color: var(--flow-blue-dark);
    margin-bottom: 4px;
}

.doc-meta-text {
    color: var(--text-secondary);
    line-height: 1.4;
    font-size: 0.78rem;
    white-space: pre-wrap;
}

.doc-type-box {
    text-align: right;
}

.doc-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.doc-number-row {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.doc-client-box {
    background: #f8fafc;
    border: 1px solid #f3f5f8;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.8rem;
}

.doc-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.8rem;
}

.doc-table th {
    background: #f1f5f9;
    padding: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid #f3f5f8;
    text-align: left;
}

.doc-table td {
    padding: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.doc-totals-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.doc-totals-table {
    width: 240px;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.doc-totals-table td {
    padding: 4px 8px;
    text-align: right;
}

.doc-totals-table td:first-child {
    color: var(--text-secondary);
    text-align: left;
}

.doc-total-grand {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--flow-blue-dark);
    border-top: 2px solid #f3f5f8;
}

.doc-footer-box {
    border-top: 1px solid #f3f5f8;
    padding-top: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.doc-notes-text {
    margin-bottom: 6px;
    white-space: pre-wrap;
}

.doc-payment-details {
    font-weight: 600;
    color: var(--text-primary);
}

.download-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

/* Tab 2: Bulk PDF naar UBL */
.ubl-converter-panel {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    text-align: center;
}

.converter-header {
    margin-bottom: 28px;
}

.subtitle {
    color: var(--text-secondary);
    margin-top: 6px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.95rem;
}

.dropzone {
    border: 2px dashed var(--metallic-border);
    border-radius: 20px;
    padding: 48px 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.5);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--flow-blue);
    background: var(--flow-blue-light);
}

.upload-icon {
    color: var(--flow-blue);
    margin-bottom: 12px;
}

.file-types-badge {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.75rem;
    background: #f3f5f8;
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 100px;
}

.progress-container {
    margin-top: 24px;
}

.progress-bar {
    height: 8px;
    background: #f3f5f8;
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--flow-blue);
    width: 0%;
    transition: width 0.2s ease;
}

.status-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.result-card {
    margin-top: 28px;
    padding: 24px;
    text-align: left;
}

.batch-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--metallic-silver);
}

.result-success-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--flow-blue-dark);
    font-size: 1.05rem;
}

.badge-count {
    background: var(--flow-blue-light);
    color: var(--flow-blue-dark);
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.85rem;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.batch-table th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: left;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--metallic-silver);
    font-weight: 600;
}

.batch-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.badge-running {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-success {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-error {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.78rem;
    font-weight: 600;
}

.batch-actions-footer {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--metallic-silver);
    flex-wrap: wrap;
}

/* Footer */
.main-footer {
    margin: 40px 24px 20px;
    padding: 20px 28px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.disclaimer {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--flow-blue);
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-2col {
        grid-template-columns: 1fr;
    }
    .batch-actions-footer {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    body {
        background: white !important;
    }
    .main-header, .tab-selector-container, .form-panel, .download-bar, .main-footer, #tab-2-content {
        display: none !important;
    }
    .main-content, .grid-2col, .preview-panel, .a4-viewport {
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
        border: none !important;
        box-shadow: none !important;
    }
    .a4-document {
        max-width: 100% !important;
        box-shadow: none !important;
        padding: 20mm !important;
    }
}
