/* ENCC Powertec Baustellen-Management - Stylesheet */
/* ================================================= */

/* CSS Custom Properties */
:root {
    --color-primary:    #1e1e2e;
    --color-accent:     #c85a1e;
    --color-accent-dark: #a84818;
    --color-bg:         #f5f3f0;
    --color-bg-card:    #ffffff;
    --color-bg-input:   #f8f7f5;
    --color-sidebar:    #ffffff;
    --color-border:     #e0ddd8;
    --color-text:       #1e1e1e;
    --color-text-muted: #666666;
    --color-topbar:     #ffffff;
    --color-success:    #198754;
    --color-warning:    #e6a817;
    --color-danger:     #dc3545;
    --color-orange:     #c85a1e;
    --color-info:       #0d6efd;
    --sidebar-width:    240px;
    --topbar-height:    60px;
    --radius:           8px;
    --radius-sm:        4px;
    --shadow:           0 4px 20px rgba(0,0,0,0.08);
    --shadow-sm:        0 2px 8px rgba(0,0,0,0.06);
    --transition:       all 0.25s ease;
    --font:             'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-accent); text-decoration: none; transition: var(--transition); }
a:hover { color: #33bce8; }

img { max-width: 100%; height: auto; }

ul { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
}

p { margin-bottom: 1rem; }

/* ===================== */
/* APP LAYOUT            */
/* ===================== */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.layout-wrapper {
    display: flex;
    flex: 1;
    padding-top: var(--topbar-height);
}

/* ===================== */
/* TOPBAR                */
/* ===================== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--color-topbar);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-logo { display: flex; align-items: center; }
.topbar-logo-img { height: 36px; max-width: 150px; object-fit: contain; }

/* Hamburger Button */
.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.sidebar-toggle:hover { background: rgba(0,0,0,0.06); }
.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: var(--transition);
}

/* User Menu */
.user-menu { display: flex; align-items: center; gap: 12px; }
.user-info { display: flex; flex-direction: column; align-items: flex-end; }
.user-name { font-size: 0.875rem; font-weight: 500; color: var(--color-text); }
.user-role { font-size: 0.7rem; margin-top: 2px; }

/* ===================== */
/* SIDEBAR               */
/* ===================== */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--color-sidebar);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.25s ease, transform 0.25s ease;
    z-index: 900;
}

.sidebar.collapsed { width: 60px; }

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 0;
}

/* Nav Links */
.nav-list { flex: 1; }
.nav-item { margin: 2px 8px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
}

.nav-link:hover {
    background: rgba(200,90,30,0.1);
    color: var(--color-accent);
}

.nav-link.active {
    background: rgba(200,90,30,0.15);
    color: var(--color-accent);
    border-left: 3px solid var(--color-accent);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-label { transition: opacity 0.2s; }
.sidebar.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
}
.sidebar-version { font-size: 0.75rem; color: var(--color-text-muted); }
.sidebar.collapsed .sidebar-footer { display: none; }

/* ===================== */
/* MAIN CONTENT          */
/* ===================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left 0.25s ease;
}

.sidebar.collapsed ~ .main-content,
.main-content.sidebar-collapsed {
    margin-left: 60px;
}

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

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* ===================== */
/* CARDS                 */
/* ===================== */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.card-body { padding: 20px; }
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
    background: rgba(0,0,0,0.1);
}

/* ===================== */
/* STAT CARDS (Dashboard) */
/* ===================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

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

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon-blue   { background: rgba(13,110,253,0.15); color: #0d6efd; }
.stat-icon-green  { background: rgba(25,135,84,0.15);  color: #198754; }
.stat-icon-orange { background: rgba(253,126,20,0.15); color: #fd7e14; }
.stat-icon-red    { background: rgba(220,53,69,0.15);  color: #dc3545; }
.stat-icon-accent { background: rgba(200,90,30,0.15);  color: var(--color-accent); }

.stat-icon svg { width: 24px; height: 24px; }

.stat-info { flex: 1; }
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}
.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ===================== */
/* BADGES & STATUS       */
/* ===================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

/* Status Badges */
.badge-anfrage     { background: rgba(108,117,125,0.2); color: #adb5bd; border: 1px solid rgba(108,117,125,0.4); }
.badge-fragebogen  { background: rgba(255,193,7,0.2);   color: #ffc107; border: 1px solid rgba(255,193,7,0.4); }
.badge-unterlagen  { background: rgba(253,126,20,0.2);  color: #fd7e14; border: 1px solid rgba(253,126,20,0.4); }
.badge-bkz         { background: rgba(253,126,20,0.2);  color: #fd7e14; border: 1px solid rgba(253,126,20,0.4); }
.badge-beauftragung { background: rgba(13,110,253,0.2); color: #6ea8fe; border: 1px solid rgba(13,110,253,0.4); }
.badge-ibn         { background: rgba(25,135,84,0.2);   color: #75b798; border: 1px solid rgba(25,135,84,0.4); }
.badge-problem     { background: rgba(220,53,69,0.2);   color: #f18a96; border: 1px solid rgba(220,53,69,0.4); }
.badge-anschluss   { background: rgba(200,90,30,0.15);  color: var(--color-accent); border: 1px solid rgba(200,90,30,0.3); font-size: 0.7rem; }

/* Rollen-Badges */
.badge-role-superadmin  { background: rgba(220,53,69,0.2);   color: #f18a96; border: 1px solid rgba(220,53,69,0.3); }
.badge-role-admin       { background: rgba(200,90,30,0.2);   color: var(--color-accent); border: 1px solid rgba(200,90,30,0.3); }
.badge-role-mediaberater { background: rgba(25,135,84,0.2);  color: #75b798; border: 1px solid rgba(25,135,84,0.3); }
.badge-role-bautraeger  { background: rgba(108,117,125,0.2); color: #adb5bd; border: 1px solid rgba(108,117,125,0.3); }

/* ===================== */
/* TABLES                */
/* ===================== */
.table-wrapper { overflow-x: auto; }

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

.table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    background: rgba(0,0,0,0.2);
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(30,58,95,0.5);
    vertical-align: middle;
    color: var(--color-text);
}

.table-striped tr:nth-child(even) td { background: rgba(0,0,0,0.1); }
.table tbody tr:hover td { background: rgba(200,90,30,0.05); }
.table tbody tr:last-child td { border-bottom: none; }

.table .actions { white-space: nowrap; }

/* ===================== */
/* FORMS                 */
/* ===================== */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.form-label .required { color: var(--color-danger); margin-left: 2px; }

.form-control {
    display: block;
    width: 100%;
    padding: 9px 12px;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.875rem;
    font-family: var(--font);
    transition: var(--transition);
    outline: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(200,90,30,0.15);
}

.form-control::placeholder { color: var(--color-text-muted); opacity: 0.6; }

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%237a9ab8' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 32px;
}

/* Checkboxen */
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.form-check-input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-accent);
    cursor: pointer;
}
.form-check-label { font-size: 0.875rem; cursor: pointer; color: var(--color-text); }

/* Checkbox-Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    padding: 12px;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

/* Formular Reihen */
.form-row {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 2fr 1fr 1fr 1fr; }

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

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary   { background: var(--color-accent); color: #fff; }
.btn-primary:hover   { background: var(--color-accent-dark); color: #fff; }

.btn-secondary { background: rgba(255,255,255,0.08); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: rgba(255,255,255,0.14); color: var(--color-text); }

.btn-danger    { background: rgba(220,53,69,0.15); color: #f18a96; border: 1px solid rgba(220,53,69,0.3); }
.btn-danger:hover    { background: rgba(220,53,69,0.3); color: #f18a96; }

.btn-success   { background: rgba(25,135,84,0.15); color: #75b798; border: 1px solid rgba(25,135,84,0.3); }
.btn-success:hover   { background: rgba(25,135,84,0.3); color: #75b798; }

.btn-warning   { background: rgba(255,193,7,0.15); color: #ffc107; border: 1px solid rgba(255,193,7,0.3); }
.btn-warning:hover   { background: rgba(255,193,7,0.3); color: #ffc107; }

.btn-outline-light { background: transparent; color: var(--color-accent); border: 1px solid var(--color-accent); }
.btn-outline-light:hover { background: var(--color-accent); color: #ffffff; }

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-lg { padding: 11px 22px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===================== */
/* ALERTS                */
/* ===================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid transparent;
}

.alert-success { background: rgba(25,135,84,0.15);   color: #75b798; border-color: rgba(25,135,84,0.3); }
.alert-error   { background: rgba(220,53,69,0.15);   color: #f18a96; border-color: rgba(220,53,69,0.3); }
.alert-warning { background: rgba(255,193,7,0.15);   color: #ffc107; border-color: rgba(255,193,7,0.3); }
.alert-info    { background: rgba(200,90,30,0.15);   color: var(--color-accent); border-color: rgba(200,90,30,0.3); }

/* ===================== */
/* TABS                  */
/* ===================== */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 20px;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    margin-bottom: -2px;
    font-family: var(--font);
}
.tab-btn:hover { color: var(--color-text); }
.tab-btn.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

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

/* ===================== */
/* MODAL                 */
/* ===================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 600; margin: 0; }
.modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px;
    border-radius: var(--radius-sm);
}
.modal-close:hover { color: var(--color-text); background: rgba(255,255,255,0.08); }
.modal-body { padding: 20px; }
.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ===================== */
/* LOG TIMELINE          */
/* ===================== */
.log-timeline { padding: 8px 0; }

.log-entry {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(30,58,95,0.4);
    position: relative;
}
.log-entry:last-child { border-bottom: none; }

.log-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-accent);
    flex-shrink: 0;
    margin-top: 5px;
    position: relative;
}
.log-dot::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 4px;
    width: 2px;
    height: calc(100% + 14px);
    background: var(--color-border);
}
.log-entry:last-child .log-dot::before { display: none; }

.log-dot-status  { background: var(--color-info); }
.log-dot-upload  { background: var(--color-success); }
.log-dot-comment { background: var(--color-accent); }
.log-dot-create  { background: var(--color-warning); }

.log-content { flex: 1; }
.log-action {
    font-size: 0.875rem;
    color: var(--color-text);
    font-weight: 500;
}
.log-meta {
    font-size: 0.775rem;
    color: var(--color-text-muted);
    margin-top: 3px;
}

/* ===================== */
/* UPLOAD AREA           */
/* ===================== */
.upload-area {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: #fafaf9;
    display: block;
}
.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--color-accent);
    background: rgba(200,90,30,0.04);
}
.upload-area.drag-over { border-style: solid; }
.upload-area input[type="file"] { display: none; }

.upload-area-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    background: rgba(200,90,30,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
}
.upload-area-icon svg { width: 26px; height: 26px; }

.upload-area-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}
.upload-area-sub {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 14px;
}
.upload-area-btn {
    display: inline-block;
    padding: 7px 18px;
    background: var(--color-accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}
.upload-area:hover .upload-area-btn { background: var(--color-accent-dark); }

.upload-selected {
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--color-accent);
    font-weight: 500;
    display: none;
}

/* ===================== */
/* FILTER BAR            */
/* ===================== */
.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 16px 20px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 150px;
}
.filter-label { font-size: 0.75rem; color: var(--color-text-muted); font-weight: 500; }

.filter-bar .form-control { margin-bottom: 0; }

/* ===================== */
/* PAGINATION            */
/* ===================== */
.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    transition: var(--transition);
}
.page-link:hover { border-color: var(--color-accent); color: var(--color-accent); }
.page-link.active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.page-link.disabled { opacity: 0.4; pointer-events: none; }

/* ===================== */
/* LOGIN PAGE            */
/* ===================== */
.login-page {
    min-height: 100vh;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--color-accent);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo img { max-height: 60px; max-width: 200px; }
.login-logo h1 {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-top: 12px;
    font-weight: 400;
}

.login-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

/* ===================== */
/* KONTAKTE DYNAMISCH    */
/* ===================== */
.contact-row {
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.contact-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.contact-row-title { font-size: 0.8rem; font-weight: 600; color: var(--color-accent); }

.contact-add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    color: var(--color-accent);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    background: none;
    border: none;
    font-family: var(--font);
    transition: var(--transition);
}
.contact-add-btn:hover { color: #33bce8; }

/* ===================== */
/* DETAIL VIEW           */
/* ===================== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.detail-item { }
.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}
.detail-value {
    font-size: 0.9rem;
    color: var(--color-text);
    word-break: break-word;
}

/* ===================== */
/* PROBLEM FLAG          */
/* ===================== */
.problem-flag-active {
    border: 2px solid rgba(220,53,69,0.5) !important;
}

.btn-problem {
    background: rgba(220,53,69,0.15);
    color: #f18a96;
    border: 1px solid rgba(220,53,69,0.3);
}
.btn-problem:hover { background: rgba(220,53,69,0.3); }
.btn-problem.active {
    background: rgba(220,53,69,0.4);
    border-color: #dc3545;
    color: #fff;
}

/* ===================== */
/* DOKUMENT LISTE        */
/* ===================== */
.doc-list { display: flex; flex-direction: column; gap: 6px; }

.doc-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.doc-item:hover {
    border-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(200,90,30,0.08);
    transform: translateY(-1px);
}

.doc-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0;
}
.doc-icon.ext-pdf  { background: #fff0f0; color: #e53e3e; }
.doc-icon.ext-jpg,
.doc-icon.ext-jpeg,
.doc-icon.ext-png  { background: #f0f7ff; color: #3182ce; }
.doc-icon.ext-docx { background: #f0f4ff; color: #5a67d8; }
.doc-icon.ext-xlsx { background: #f0fff4; color: #38a169; }
.doc-icon.ext-other { background: rgba(200,90,30,0.08); color: var(--color-accent); }

.doc-info { flex: 1; min-width: 0; }
.doc-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.doc-type-badge {
    display: inline-block;
    background: rgba(200,90,30,0.1);
    color: var(--color-accent);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    margin-right: 6px;
}
.doc-meta { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 2px; }
.doc-actions { display: flex; gap: 6px; }

/* ===================== */
/* STATUS CHANGE FORM    */
/* ===================== */
.status-change-box {
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===================== */
/* TEXT UTILITIES        */
/* ===================== */
.text-muted  { color: var(--color-text-muted) !important; }
.text-accent { color: var(--color-accent) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger  { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-small   { font-size: 0.8rem; }
.text-bold    { font-weight: 600; }

/* Display */
.d-flex { display: flex; }
.d-none { display: none; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }

/* Spacing */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* Divider */
.divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 20px 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 0.875rem; }

/* Session Timeout Warning */
.session-warning {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--color-bg-card);
    border: 1px solid rgba(255,193,7,0.4);
    border-radius: var(--radius);
    padding: 16px 20px;
    max-width: 320px;
    box-shadow: var(--shadow);
    z-index: 3000;
    display: none;
}
.session-warning.visible { display: block; }
.session-warning-title { font-weight: 600; color: var(--color-warning); margin-bottom: 6px; }
.session-warning-text { font-size: 0.8rem; color: var(--color-text-muted); }

/* ===================== */
/* APP FOOTER            */
/* ===================== */
.app-footer {
    background: var(--color-topbar);
    border-top: 1px solid var(--color-border);
    text-align: center;
    padding: 10px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s ease;
}

/* ===================== */
/* INSTALL PAGE          */
/* ===================== */
.install-page {
    min-height: 100vh;
    background: var(--color-bg);
    padding: 40px 20px;
    font-family: var(--font);
    color: var(--color-text);
}
.install-container {
    max-width: 700px;
    margin: 0 auto;
}
.install-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 20px;
}
.install-step { margin-bottom: 12px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.875rem; }
.install-step.ok   { background: rgba(25,135,84,0.15); color: #75b798; }
.install-step.fail { background: rgba(220,53,69,0.15); color: #f18a96; }
.install-step.info { background: rgba(200,90,30,0.1);  color: var(--color-accent); }

/* ===================== */
/* RESPONSIVE            */
/* ===================== */
@media (max-width: 1024px) {
    .detail-grid { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr 1fr; }
    .form-row-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    :root { --sidebar-width: 240px; }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow);
    }
    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .app-footer { margin-left: 0; }

    .topbar { padding: 0 12px; }
    .logout-text { display: none; }
    .user-info { display: none; }

    .main-content { padding: 16px; }

    .form-row-2,
    .form-row-3,
    .form-row-4 { grid-template-columns: 1fr; }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .page-header { flex-direction: column; align-items: flex-start; }

    .filter-bar { gap: 8px; }
    .filter-group { min-width: 120px; }

    .tab-btn { padding: 8px 14px; font-size: 0.8rem; }

    .modal { max-width: 100%; margin: 10px; }

    .status-change-box { flex-direction: column; }

    /* Mobile Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        z-index: 850;
    }
    .sidebar-overlay.open { display: block; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-card { padding: 24px; }
    .table { font-size: 0.8rem; }
    .table th, .table td { padding: 8px 10px; }
}
