/* ======================================================
   Urlaubsplaner – Haupt-Stylesheet
   ====================================================== */

:root {
    --sidebar-w:    260px;
    --sidebar-bg:   #1e293b;
    --sidebar-txt:  #94a3b8;
    --sidebar-act:  #2563eb;
    --primary:      #2563eb;
    --primary-dark: #1d4ed8;
    --body-bg:      #f1f5f9;
    --card-bg:      #ffffff;
    --text:         #1e293b;
    --text-muted:   #64748b;
    --border:       #e2e8f0;
    --radius:       0.625rem;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
    color: var(--text);
    margin: 0;
    font-size: 0.9rem;
}

a { text-decoration: none; }

/* ===== Layout ===== */
#wrapper {
    display: flex;
    min-height: 100vh;
}

#sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
    z-index: 100;
    transition: transform .25s ease;
}

#page-content {
    flex: 1;
    padding: 2rem 2.5rem;
    overflow-x: hidden;
    min-width: 0;
}

/* ===== Sidebar ===== */
.sidebar-logo {
    padding: 1.4rem 1.2rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo img {
    width: 150px;
    opacity: .9;
}

.sidebar-user {
    padding: .85rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-user .u-name {
    color: #f8fafc;
    font-weight: 600;
    font-size: .875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .u-role {
    color: var(--sidebar-txt);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-top: 2px;
}

#sidebar .nav-link {
    color: var(--sidebar-txt) !important;
    padding: .55rem 1rem;
    border-radius: .4rem;
    margin: .1rem .6rem;
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .55rem;
    transition: background .15s, color .15s;
}

#sidebar .nav-link:hover {
    background: rgba(255,255,255,.08);
    color: #f1f5f9 !important;
}

#sidebar .nav-link.active {
    background: var(--sidebar-act);
    color: #fff !important;
}

.nav-icon { width: 20px; text-align: center; font-style: normal; flex-shrink: 0; }

.sidebar-sep {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255,255,255,.3);
    padding: .8rem 1.6rem .3rem;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-footer .version {
    font-size: .7rem;
    color: rgba(255,255,255,.25);
    text-align: center;
    margin-bottom: .6rem;
}

/* ===== Mobile Topbar ===== */
.topbar {
    background: var(--sidebar-bg);
    padding: .5rem 1rem;
    position: sticky;
    top: 0;
    z-index: 200;
    display: none;
    align-items: center;
    gap: .75rem;
}

.topbar .brand { color: #f8fafc; font-weight: 700; font-size: 1rem; }

.topbar-toggle {
    background: none;
    border: none;
    color: #f8fafc;
    cursor: pointer;
    padding: .25rem;
    line-height: 1;
}

#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99;
}

#sidebar-overlay.active { display: block; }

@media (max-width: 767.98px) {
    .topbar { display: flex; }

    #sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 150;
    }

    #sidebar.open { transform: translateX(0); }

    #page-content { padding: 1rem; }
}

/* ===== Page title ===== */
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
}

/* ===== Cards ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

/* ===== Stat cards ===== */
.stat-card {
    text-align: center;
    padding: 1.4rem;
}

.stat-card .stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    margin-top: .35rem;
}

.stat-card.danger  .stat-num { color: #dc2626; }
.stat-card.success .stat-num { color: #16a34a; }
.stat-card.warning .stat-num { color: #d97706; }

/* ===== Vacation bar ===== */
.vac-bar-wrap {
    height: 8px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    margin-top: .5rem;
}

.vac-bar {
    height: 100%;
    border-radius: 9999px;
    background: var(--primary);
    transition: width .5s ease;
}

.vac-bar.warn  { background: #f59e0b; }
.vac-bar.full  { background: #dc2626; }

/* ===== Type badges ===== */
.badge { font-size: .72rem; font-weight: 600; padding: .3em .65em; }

.type-urlaub       { background: #dbeafe; color: #1d4ed8; }
.type-krankheit    { background: #fee2e2; color: #b91c1c; }
.type-sonderurlaub { background: #fef9c3; color: #92400e; }
.type-gleittag     { background: #d1fae5; color: #065f46; }

/* ===== Tables ===== */
.table th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.table td { vertical-align: middle; }

/* ===== Buttons ===== */
.btn { border-radius: .4rem; font-size: .85rem; font-weight: 500; }
.btn-sm { font-size: .78rem; }

/* ===== Forms ===== */
.form-control, .form-select {
    font-size: .875rem;
    border-radius: .4rem;
    border-color: var(--border);
}

.form-label { font-size: .82rem; font-weight: 600; color: var(--text-muted); margin-bottom: .3rem; }

/* ===== Request cards ===== */
.request-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card-bg);
    padding: 1rem 1.2rem;
    transition: box-shadow .15s;
}

.request-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); }

.request-card .rc-dates {
    font-size: .8rem;
    color: var(--text-muted);
    margin: .3rem 0;
}

/* ===== Calendar ===== */
#calendar {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    border: 1px solid var(--border);
}

/* ===== Alerts ===== */
.alert { border: none; border-radius: .5rem; font-size: .875rem; }

/* ===== Login page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

.login-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 60px rgba(0,0,0,.3);
}

.login-card img { width: 180px; display: block; margin: 0 auto 1.5rem; }
.login-card h2  { font-size: 1.3rem; font-weight: 700; text-align: center; margin-bottom: 1.5rem; }

.login-tagline {
    text-align: center;
    font-style: italic;
    color: var(--text-muted);
    font-size: .8rem;
    margin-bottom: 1.2rem;
}

/* ===== Profile ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ===== Footer ===== */
.site-footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: .72rem;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
    margin-top: 2rem;
}

/* ===== Notification dot ===== */
.notif-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    margin-left: auto;
}

/* ===== Color picker display ===== */
.color-preview {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid var(--border);
    vertical-align: middle;
}
