/* ============================================================
   8D Report Manager – Stylesheet
   Firmenfarben: Ändere einfach die --color-primary Variablen!
   Company colors: Just change the --color-primary variables!
   ============================================================ */

:root {
    /* === OCTORESOLVE BRAND COLORS === */
    --color-primary:       #2060d0;
    --color-primary-dark:  #0d2a6e;
    --color-primary-light: #e0eeff;
    --color-accent:        #00c9a7;
    --color-accent-dark:   #009e84;

    /* Neutrale Farben / Neutral colors */
    --color-bg:         #f0f4f9;
    --color-surface:    #ffffff;
    --color-border:     #dde6f0;
    --color-text:       #0d1b2e;
    --color-text-muted: #5a7090;
    --color-shadow:     rgba(13,27,46,.10);

    /* Status-Farben / Status colors */
    --color-open:        #f97316;
    --color-inprogress:  #2060d0;
    --color-closed:      #00c9a7;

    /* Abstände / Spacing */
    --radius:  10px;
    --radius-sm: 6px;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === LAYOUT === */
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #0d1b2e 0%, #0d2a6e 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}
.sidebar-brand {
    padding: 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    display: flex; align-items: center; justify-content: center;
}
.sidebar-brand .icon { font-size: 1.4rem; }
.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,.85);
    font-size: .9rem;
    transition: background .2s, color .2s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,.10);
    color: #00c9a7;
    border-left-color: #00c9a7;
    text-decoration: none;
}
.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,.15);
    font-size: .8rem;
    color: rgba(255,255,255,.5);
}
.sidebar-footer a { color: rgba(255,255,255,.7); }

/* Main */
.main {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.topbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 28px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 1px 4px var(--color-shadow);
}
.topbar-title { font-size: 1.15rem; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.content { padding: 28px; flex: 1; }

/* === KARTEN / CARDS === */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px var(--color-shadow);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    font-size: 1rem;
    background: linear-gradient(90deg, #e0eeff, #e0fff8);
    color: #0d2a6e;
    display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 20px; }

/* === STAT-KARTEN / STAT CARDS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px var(--color-shadow);
    transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-num  { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .8rem; color: var(--color-text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; }
.stat-card.total  .stat-num { color: var(--color-primary); }
.stat-card.open   .stat-num { color: var(--color-open); }
.stat-card.inprogress .stat-num { color: var(--color-inprogress); }
.stat-card.closed .stat-num { color: var(--color-closed); }

/* === TABELLE / TABLE === */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
    background: #f8fafc;
    border-bottom: 2px solid var(--color-border);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-open        { background: #fff7ed; color: #c2410c; }
.badge-inprogress  { background: #eff6ff; color: #1d4ed8; }
.badge-closed      { background: #f0fdf4; color: #15803d; }

/* === FORMULAR / FORM === */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}
.form-label .req { color: #ef4444; margin-left: 2px; }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-family: inherit;
    color: var(--color-text);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* === 8D ABSCHNITTE / 8D SECTIONS === */
.d-section {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.d-section-header {
    background: linear-gradient(135deg, #2060d0, #0d2a6e);
    color: #fff;
    padding: 12px 18px;
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    user-select: none;
}
.d-section-header:hover { opacity: .92; }
.d-section-body {
    padding: 18px;
    background: var(--color-surface);
}
.d-section-body.collapsed { display: none; }
.chevron { transition: transform .3s; display: inline-block; }
.chevron.open { transform: rotate(180deg); }

/* Nummern-Chips */
.d-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    font-size: .85rem; font-weight: 700;
    margin-right: 6px; flex-shrink: 0;
}

/* === BUTTONS === */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px;
    border: none; border-radius: var(--radius-sm);
    font-size: .88rem; font-weight: 600; cursor: pointer;
    font-family: inherit;
    transition: opacity .2s, transform .1s;
    text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary   { background: var(--color-primary);  color: #fff; }
.btn-secondary { background: #e2e8f0; color: var(--color-text); }
.btn-danger    { background: #ef4444; color: #fff; }
.btn-success   { background: #22c55e; color: #fff; }
.btn-outline   { background: transparent; border: 1.5px solid var(--color-primary); color: var(--color-primary); }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-icon { padding: 7px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* === ALERTS === */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid #22c55e; }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-info    { background: var(--color-primary-light); color: var(--color-primary-dark); border-left: 4px solid var(--color-primary); }

/* === LOGIN === */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0d1b2e 0%, #0d2a6e 60%, #1a4a8a 100%);
}
.login-box {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0,201,167,0.25);
    border-radius: 16px; padding: 44px 40px;
    width: 100%; max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,.4);
}
.login-box .form-label { color: #c8daf0; }
.login-box .form-control {
    background: rgba(255,255,255,0.08);
    border-color: rgba(0,201,167,0.3);
    color: #fff;
}
.login-box .form-control:focus {
    border-color: #00c9a7;
    box-shadow: 0 0 0 3px rgba(0,201,167,0.18);
}
.login-box .login-logo p { color: #7baac8; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon { font-size: 3rem; }
.login-logo h1 { font-size: 1.4rem; margin-top: 8px; color: var(--color-text); }
.login-logo p { color: var(--color-text-muted); font-size: .88rem; }

/* === LANG-SWITCHER === */
.lang-switch {
    display: flex; gap: 4px;
}
.lang-switch a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 28px;
    border-radius: var(--radius-sm);
    font-size: .78rem; font-weight: 700;
    color: var(--color-text-muted);
    background: transparent;
    border: 1.5px solid transparent;
    transition: all .2s;
}
.lang-switch a:hover, .lang-switch a.active {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
    text-decoration: none;
}

/* === SEARCH BAR === */
.search-filter {
    display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.search-filter input, .search-filter select {
    padding: 8px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-family: inherit;
    outline: none;
}
.search-filter input { flex: 1; min-width: 180px; }
.search-filter input:focus, .search-filter select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}

/* === PRINT / PDF === */
@media print {
    .sidebar, .topbar, .btn, .btn-group,
    .search-filter, .no-print { display: none !important; }
    .main { margin-left: 0 !important; }
    .content { padding: 0 !important; }
    .d-section { border: 1px solid #ccc; page-break-inside: avoid; }
    .d-section-body.collapsed { display: block !important; }
    .d-section-header { background: #1a56db !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}

/* === MISC === */
.text-muted { color: var(--color-text-muted); }
.text-sm    { font-size: .85rem; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
hr.divider { border: none; border-top: 1px solid var(--color-border); margin: 16px 0; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar { width: 0; overflow: hidden; }
    .main { margin-left: 0; }
    .content { padding: 16px; }
}
