/* Blaschke-Connect Portal - Hauptstylesheet */

:root {
    --bc-red:        #c00000;
    --bc-red-dark:   #8b0000;
    --bc-red-light:  #fdf0f0;
    --bc-black:      #1a1a1a;
    --bc-gray-dark:  #333333;
    --bc-gray:       #666666;
    --bc-gray-light: #f4f4f4;
    --bc-border:     #e0e0e0;
    --bc-white:      #ffffff;
    --bc-shadow:     0 2px 8px rgba(0,0,0,0.08);
    --bc-shadow-lg:  0 4px 20px rgba(0,0,0,0.12);
    --radius:        8px;
    --radius-lg:     12px;
    --transition:    0.2s ease;
}

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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    color: var(--bc-black);
    background: var(--bc-gray-light);
    line-height: 1.5;
}

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--bc-black);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
}

.main-content {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: var(--bc-white);
    border-bottom: 1px solid var(--bc-border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--bc-shadow);
}

.page-content { padding: 24px; flex: 1; }

/* ── Sidebar ── */
.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--bc-white);
    letter-spacing: -0.3px;
}

.logo-text span { color: var(--bc-red); }

.logo-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section {
    padding: 4px 12px 2px;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 13px;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: var(--bc-white);
    border-left-color: rgba(192,0,0,0.5);
}

.nav-item.active {
    background: rgba(192,0,0,0.15);
    color: var(--bc-white);
    border-left-color: var(--bc-red);
}

.nav-item .icon { width: 16px; text-align: center; font-size: 15px; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info { margin-bottom: 10px; }
.user-name { font-size: 13px; color: var(--bc-white); font-weight: 600; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.4); }

.btn-logout {
    display: block;
    width: 100%;
    padding: 8px;
    background: rgba(192,0,0,0.2);
    border: 1px solid rgba(192,0,0,0.4);
    border-radius: var(--radius);
    color: #ff9999;
    font-size: 12px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-logout:hover { background: rgba(192,0,0,0.4); }

/* ── Topbar ── */
.page-title { font-size: 16px; font-weight: 600; color: var(--bc-black); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary { background: var(--bc-red); color: var(--bc-white); }
.btn-primary:hover { background: var(--bc-red-dark); }

.btn-secondary {
    background: var(--bc-white);
    color: var(--bc-gray-dark);
    border: 1px solid var(--bc-border);
}
.btn-secondary:hover { background: var(--bc-gray-light); }

.btn-danger { background: #dc2626; color: var(--bc-white); }
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px 8px; }

/* ── Cards ── */
.card {
    background: var(--bc-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bc-border);
    box-shadow: var(--bc-shadow);
}

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

.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* ── Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bc-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--bc-border);
    padding: 16px 20px;
    box-shadow: var(--bc-shadow);
}

.stat-label { font-size: 12px; color: var(--bc-gray); margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--bc-black); }
.stat-sub { font-size: 12px; color: var(--bc-gray); margin-top: 2px; }

/* ── Table ── */
.table-wrapper { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--bc-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--bc-border);
    background: var(--bc-gray-light);
    white-space: nowrap;
}

tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--bc-border);
    vertical-align: middle;
}

tbody tr:hover { background: #fafafa; }
tbody tr:last-child td { border-bottom: none; }

/* ── Status badges ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-open        { background: #f3f4f6; color: #374151; }
.status-scheduled   { background: #eff6ff; color: #1d4ed8; }
.status-progress    { background: #fff7ed; color: #c2410c; }
.status-application { background: #fdf4ff; color: #7e22ce; }
.status-done        { background: #f0fdf4; color: #15803d; }
.status-complaint   { background: #fef2f2; color: #dc2626; }
.status-submitted   { background: #f0fdf4; color: #15803d; }

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--bc-gray-dark);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--bc-border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--bc-black);
    background: var(--bc-white);
    transition: border-color var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--bc-red);
    box-shadow: 0 0 0 3px rgba(192,0,0,0.08);
}

select.form-control { cursor: pointer; }

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.form-section {
    border: 1px solid var(--bc-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    background: var(--bc-white);
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--bc-red);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--bc-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Toggle */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--bc-border);
}
.toggle-row:last-child { border-bottom: none; }

.toggle-label { font-size: 13px; font-weight: 500; }
.toggle-sub { font-size: 11px; color: var(--bc-gray); margin-top: 2px; }

.toggle-switch { display: flex; gap: 4px; }
.toggle-btn {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--bc-border);
    background: var(--bc-white);
    color: var(--bc-gray);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
}
.toggle-btn.active { background: var(--bc-red); color: var(--bc-white); border-color: var(--bc-red); }

/* Address autocomplete */
.autocomplete-wrapper { position: relative; }
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bc-white);
    border: 1px solid var(--bc-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--bc-shadow-lg);
    z-index: 200;
    max-height: 240px;
    overflow-y: auto;
    display: none;
}
.autocomplete-item {
    padding: 9px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--bc-border);
    transition: background var(--transition);
}
.autocomplete-item:hover { background: var(--bc-gray-light); }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item small { color: var(--bc-gray); font-size: 11px; display: block; margin-top: 2px; }

/* ── Filter bar ── */
.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
    background: var(--bc-white);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--bc-border);
}

.filter-bar input,
.filter-bar select {
    padding: 7px 12px;
    border: 1px solid var(--bc-border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--bc-black);
    background: var(--bc-white);
}
.filter-bar input:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--bc-red);
}

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--bc-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--bc-shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--bc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--bc-white);
}

.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
    width: 28px; height: 28px;
    border: none;
    background: var(--bc-gray-light);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bc-gray);
}
.modal-close:hover { background: var(--bc-border); }
.modal-body { padding: 20px; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--bc-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── Login page ── */
.login-page {
    min-height: 100vh;
    background: var(--bc-gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--bc-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--bc-shadow-lg);
    width: 100%;
    max-width: 380px;
    overflow: hidden;
}

.login-header {
    background: var(--bc-black);
    padding: 28px 32px 24px;
    text-align: center;
}

.login-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--bc-white);
    margin-bottom: 4px;
}
.login-logo span { color: var(--bc-red); }
.login-sub { font-size: 11px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; }

.login-body { padding: 28px 32px; }
.login-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-240px); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Misc ── */
.text-muted { color: var(--bc-gray); }
.text-red   { color: var(--bc-red); }
.fw-bold    { font-weight: 600; }
.mt-4       { margin-top: 16px; }
.mb-4       { margin-bottom: 16px; }
.d-flex     { display: flex; }
.align-center { align-items: center; }
.gap-2      { gap: 8px; }
.gap-3      { gap: 12px; }
