/* WCF Transaktionsportal - Design System */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
    --wcf-primary: #003366;
    --wcf-primary-light: #004d99;
    --wcf-primary-dark: #002244;
    --wcf-accent: #e6f0ff;
    --wcf-success: #28a745;
    --wcf-warning: #ffc107;
    --wcf-danger: #dc3545;
    --wcf-info: #17a2b8;
    --wcf-gray-100: #f8f9fa;
    --wcf-gray-200: #e9ecef;
    --wcf-gray-300: #dee2e6;
    --wcf-gray-500: #6c757d;
    --wcf-gray-700: #495057;
    --wcf-gray-800: #343a40;
    --wcf-white: #ffffff;
    --wcf-font: 'Montserrat', sans-serif;
    --wcf-radius: 8px;
    --wcf-radius-sm: 4px;
    --wcf-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --wcf-shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --wcf-transition: 0.2s ease;
}

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

body {
    font-family: var(--wcf-font);
    color: var(--wcf-gray-800);
    background: var(--wcf-gray-100);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

/* --- Layout --- */
.portal-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--wcf-primary-dark);
    color: var(--wcf-white);
    padding: 24px 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}

.sidebar-logo h2 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.sidebar-logo .deal-name {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--wcf-transition);
}

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

.sidebar-nav a.active { border-left: 3px solid var(--wcf-white); }

.sidebar-nav .nav-icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-section {
    padding: 12px 20px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.4;
    margin-top: 8px;
}

.main-content {
    margin-left: 240px;
    padding: 32px;
    flex: 1;
    max-width: 1100px;
}

/* --- Header --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--wcf-primary);
}

.page-header .meta {
    font-size: 13px;
    color: var(--wcf-gray-500);
}

/* --- Cards --- */
.card {
    background: var(--wcf-white);
    border-radius: var(--wcf-radius);
    box-shadow: var(--wcf-shadow);
    padding: 24px;
    margin-bottom: 20px;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--wcf-gray-800);
}

.card-header .badge { font-size: 13px; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--wcf-radius-sm);
    font-family: var(--wcf-font);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--wcf-transition);
    text-decoration: none;
    line-height: 1.4;
}

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

.btn-success { background: var(--wcf-success); color: var(--wcf-white); }
.btn-success:hover { opacity: 0.9; }

.btn-danger { background: var(--wcf-danger); color: var(--wcf-white); }
.btn-danger:hover { opacity: 0.9; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--wcf-gray-300);
    color: var(--wcf-gray-700);
}
.btn-outline:hover { background: var(--wcf-gray-100); }

.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-group { display: flex; gap: 8px; }

/* --- Forms --- */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--wcf-gray-700);
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--wcf-gray-300);
    border-radius: var(--wcf-radius-sm);
    font-family: var(--wcf-font);
    font-size: 14px;
    color: var(--wcf-gray-800);
    transition: var(--wcf-transition);
    background: var(--wcf-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--wcf-primary);
    box-shadow: 0 0 0 3px rgba(0,51,102,0.1);
}

textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { appearance: auto; }

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

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

table th, table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--wcf-gray-200);
    font-size: 14px;
}

table th {
    font-weight: 600;
    color: var(--wcf-gray-700);
    background: var(--wcf-gray-100);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tbody tr:hover { background: var(--wcf-accent); }

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-neutral { background: var(--wcf-gray-200); color: var(--wcf-gray-700); }
.badge-primary { background: var(--wcf-accent); color: var(--wcf-primary); }

/* --- Progress --- */
.progress-bar {
    height: 8px;
    background: var(--wcf-gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: var(--wcf-primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: var(--wcf-radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-success { background: #d4edda; color: #155724; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-danger { background: #f8d7da; color: #721c24; }
.alert-info { background: #d1ecf1; color: #0c5460; }

/* --- Login --- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--wcf-primary-dark) 0%, var(--wcf-primary) 100%);
}

.login-card {
    background: var(--wcf-white);
    border-radius: var(--wcf-radius);
    box-shadow: var(--wcf-shadow-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-card h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--wcf-primary);
    margin-bottom: 4px;
}

.login-card .subtitle {
    font-size: 14px;
    color: var(--wcf-gray-500);
    margin-bottom: 32px;
}

.code-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.code-inputs input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid var(--wcf-gray-300);
    border-radius: var(--wcf-radius-sm);
    font-family: var(--wcf-font);
    color: var(--wcf-primary);
    transition: var(--wcf-transition);
}

.code-inputs input:focus {
    outline: none;
    border-color: var(--wcf-primary);
    box-shadow: 0 0 0 3px rgba(0,51,102,0.1);
}

.login-footer {
    margin-top: 24px;
    font-size: 12px;
    color: var(--wcf-gray-500);
}

/* --- Chat --- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    max-height: 600px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.chat-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
}

.chat-message.user { justify-content: flex-end; }

.chat-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.chat-message.user .chat-bubble {
    background: var(--wcf-primary);
    color: var(--wcf-white);
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .chat-bubble {
    background: var(--wcf-gray-100);
    color: var(--wcf-gray-800);
    border-bottom-left-radius: 4px;
}

.chat-input {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--wcf-gray-200);
}

.chat-input input {
    flex: 1;
}

/* --- Upload --- */
.upload-zone {
    border: 2px dashed var(--wcf-gray-300);
    border-radius: var(--wcf-radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--wcf-transition);
    background: var(--wcf-white);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--wcf-primary);
    background: var(--wcf-accent);
}

.upload-zone .icon { font-size: 36px; color: var(--wcf-gray-500); margin-bottom: 8px; }

/* --- Checklist --- */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--wcf-gray-200);
}

.checklist-item .status-icon { font-size: 20px; width: 24px; }
.checklist-item .doc-name { flex: 1; font-size: 14px; }
.checklist-item .doc-date { font-size: 12px; color: var(--wcf-gray-500); }

/* --- Deal Cards (Admin) --- */
.deal-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-left: 4px solid;
    margin-bottom: 12px;
    background: var(--wcf-white);
    border-radius: 0 var(--wcf-radius) var(--wcf-radius) 0;
    box-shadow: var(--wcf-shadow);
    cursor: pointer;
    transition: var(--wcf-transition);
}

.deal-card:hover { transform: translateX(4px); }
.deal-card.red { border-left-color: var(--wcf-danger); }
.deal-card.yellow { border-left-color: var(--wcf-warning); }
.deal-card.green { border-left-color: var(--wcf-success); }

.deal-card .deal-name { font-weight: 600; font-size: 15px; flex: 1; }

/* --- Overlay/Modal --- */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.overlay.active { display: flex; }

.modal {
    background: var(--wcf-white);
    border-radius: var(--wcf-radius);
    box-shadow: var(--wcf-shadow-lg);
    padding: 32px;
    max-width: 560px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h3 { font-size: 18px; margin-bottom: 16px; color: var(--wcf-primary); }

/* --- KI-Hinweis --- */
.ki-notice {
    background: var(--wcf-accent);
    border-left: 3px solid var(--wcf-primary);
    padding: 10px 14px;
    font-size: 12px;
    color: var(--wcf-gray-700);
    border-radius: 0 var(--wcf-radius-sm) var(--wcf-radius-sm) 0;
}

/* --- Status Dots --- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-red { background: var(--wcf-danger); }
.dot-yellow { background: var(--wcf-warning); }
.dot-green { background: var(--wcf-success); }

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 16px; }
    .login-card { margin: 16px; padding: 32px 24px; }
    .code-inputs input { width: 40px; height: 48px; font-size: 20px; }
}

/* --- Utility --- */
.text-muted { color: var(--wcf-gray-500); }
.text-small { font-size: 13px; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.hidden { display: none; }
