/* == Google Fonts (Inter) == */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap');

/* == Design Tokens: Light == */
:root {
    /* Farben */
    --c-bg:           #ffffff;
    --c-surface:      #f5f7fa;
    --c-surface-2:    #edf0f5;
    --c-border:       #dde2ec;
    --c-text:         #0d1117;
    --c-muted:        #64748b;

    --c-blue:         #1a56db;
    --c-blue-hover:   #1240a8;
    --c-blue-light:   #eff6ff;
    --c-red:          #dc2626;
    --c-red-light:    #fef2f2;
    --c-green:        #16a34a;
    --c-green-light:  #f0fdf4;
    --c-amber:        #d97706;
    --c-amber-light:  #fffbeb;

    /* Prim-rfarbe */
    --c-primary:      var(--c-blue);
    --c-primary-h:    var(--c-blue-hover);
    --c-danger:       var(--c-red);
    --c-success:      var(--c-green);

    /* Schatten */
    --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
    --shadow-md:  0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.12);

    /* Radien */
    --r-sm:  0px;
    --r-md:  0px;
    --r-lg:  0px;
    --r-xl:  0px;
    --r-full: 0px;

    /* Typografie */
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --fw-normal: 400;
    --fw-semi:   600;
    --fw-bold:   700;
    --fw-black:  900;

    /* Abst-nde */
    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
}

/* == Design Tokens: Dark == */
[data-theme="dark"] {
    --c-bg:           #0d1117;
    --c-surface:      #161b22;
    --c-surface-2:    #21262d;
    --c-border:       #30363d;
    --c-text:         #e6edf3;
    --c-muted:        #8b949e;

    --c-blue:         #4d8ef8;
    --c-blue-hover:   #79a8f8;
    --c-blue-light:   #0c1a3a;
    --c-red:          #f87171;
    --c-red-light:    #2d0a0a;
    --c-green:        #4ade80;
    --c-green-light:  #052e16;
    --c-amber:        #fbbf24;
    --c-amber-light:  #1c1400;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.4);
    --shadow-md:  0 4px 16px rgba(0,0,0,.5);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.6);
}

/* == Reset == */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body  {
    font-family: var(--font);
    font-size: .9375rem;
    line-height: 1.6;
    background: var(--c-bg);
    color: var(--c-text);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
a           { color: var(--c-primary); text-decoration: none; }
a:hover     { text-decoration: underline; }
img         { display: block; max-width: 100%; }
button      { font-family: inherit; }

/* == Utility == */
.muted      { color: var(--c-muted); font-size: .85rem; }
.empty-state { color: var(--c-muted); font-style: italic; padding: var(--space-4) 0; }

/* == Header == */
.site-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-3);
    height: 56px;
    background: var(--c-surface);
    border-bottom: 2px solid var(--c-primary);
    position: sticky; top: 0; z-index: 200;
    box-shadow: var(--shadow-sm);
}
.site-logo {
    font-weight: var(--fw-black);
    font-size: 1.2rem;
    letter-spacing: -.04em;
    color: var(--c-primary);
    text-decoration: none;
    white-space: nowrap;
    display: flex; align-items: center; gap: var(--space-2);
}
.site-nav        { display: flex; gap: var(--space-1); }
.site-nav a      {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--r-md);
    font-size: .85rem;
    font-weight: var(--fw-semi);
    color: var(--c-muted);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.site-nav a:hover    { background: var(--c-surface-2); color: var(--c-text); }
.site-nav a.active   { background: var(--c-blue-light); color: var(--c-primary); }
.header-right        { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.theme-btn           {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: none; border: 1px solid var(--c-border);
    border-radius: var(--r-md); font-size: .9rem;
    cursor: pointer; color: var(--c-muted);
    transition: border-color .15s, color .15s;
}
.theme-btn:hover     { border-color: var(--c-primary); color: var(--c-primary); }
.header-right form   { margin: 0; padding: 0; display: flex; align-items: center; }

/* == Main == */
.site-main {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
}

/* == Footer == */
.site-footer {
    border-top: 1px solid var(--c-border);
    padding: var(--space-4) var(--space-6);
    text-align: center;
    color: var(--c-muted);
    font-size: .78rem;
}

/* == Flash Messages == */
.flash {
    display: flex; align-items: flex-start; gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--r-md);
    margin-bottom: var(--space-4);
    font-size: .88rem;
    font-weight: var(--fw-semi);
    border-left: 4px solid;
}
.flash--success { background: var(--c-green-light); border-color: var(--c-green);  color: #14532d; }
.flash--error   { background: var(--c-red-light);   border-color: var(--c-danger); color: #7f1d1d; }
.flash--info    { background: var(--c-blue-light);  border-color: var(--c-blue);   color: #1e3a8a; }
[data-theme="dark"] .flash--success { color: #86efac; }
[data-theme="dark"] .flash--error   { color: #fca5a5; }
[data-theme="dark"] .flash--info    { color: #93c5fd; }

/* == Buttons == */
.btn {
    display: inline-flex; align-items: center; gap: var(--space-2);
    padding: .55rem 1.15rem;
    border: none; border-radius: var(--r-md);
    font-family: inherit; font-size: .88rem; font-weight: var(--fw-bold);
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: opacity .15s, transform .1s, box-shadow .15s;
    line-height: 1.4;
}
.btn:hover       { opacity: .88; text-decoration: none; }
.btn:active      { transform: scale(.97); }
.btn--primary    { background: var(--c-primary);  color: #fff; box-shadow: 0 1px 4px rgba(26,86,219,.3); }
.btn--primary:hover { background: var(--c-primary-h); opacity: 1; }
.btn--danger     { background: var(--c-danger); color: #fff; }
.btn--ghost      { background: transparent; border: 1px solid var(--c-border); color: var(--c-text); }
.btn--ghost:hover { border-color: var(--c-primary); color: var(--c-primary); opacity: 1; }
.btn--sm         { padding: .3rem .7rem; font-size: .8rem; border-radius: var(--r-sm); }
.btn--lg         { padding: .75rem 1.6rem; font-size: 1rem; border-radius: var(--r-lg); }
.btn--full       { width: 100%; justify-content: center; }
.btn--icon       { width: 38px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--r-md); flex-shrink: 0; }

.icon-btn {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; padding: 0;
    background: none; border: 1px solid var(--c-border);
    border-radius: var(--r-md); font-size: 1rem;
    cursor: pointer; color: var(--c-muted);
    transition: border-color .15s, color .15s; flex-shrink: 0;
}
.icon-btn:hover         { border-color: var(--c-primary); color: var(--c-primary); }
.icon-btn--danger:hover { border-color: var(--c-danger); color: var(--c-danger); }
.btn--icon       {
    width: 38px; height: 38px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-md); flex-shrink: 0;
}

/* == Badges == */
.badge {
    display: inline-flex; align-items: center; gap: .2rem;
    padding: .15rem .55rem; border-radius: var(--r-full);
    font-size: .72rem; font-weight: var(--fw-bold);
    background: var(--c-surface-2); border: 1px solid var(--c-border);
    color: var(--c-muted); white-space: nowrap;
}
.badge--active   { background: var(--c-green-light); color: #14532d; border-color: #86efac; }
.badge--finished { background: var(--c-surface-2); color: var(--c-muted); }
.badge--setup    { background: var(--c-amber-light); color: #78350f; border-color: #fcd34d; }
.badge--me       { background: var(--c-blue-light); color: var(--c-primary); border-color: var(--c-blue); }
.badge--lg       { font-size: .85rem; padding: .3rem .9rem; }
[data-theme="dark"] .badge--active   { color: #86efac; }
[data-theme="dark"] .badge--setup    { color: var(--c-amber); }

/* == Formulare == */
label {
    display: block;
    font-size: .8rem; font-weight: var(--fw-bold);
    color: var(--c-muted); margin-bottom: var(--space-2);
    text-transform: uppercase; letter-spacing: .04em;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="file"],
select, textarea {
    width: 100%;
    padding: .6rem .85rem;
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-bg); color: var(--c-text);
    font-family: inherit; font-size: .92rem;
    margin-bottom: var(--space-5);
    transition: border-color .15s, box-shadow .15s;
    appearance: auto;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
input[type="file"] { padding: .4rem .6rem; cursor: pointer; }
small { font-size: .78rem; color: var(--c-muted); display: block; margin-top: -.3rem; margin-bottom: var(--space-4); }

/* == Form Layout == */
.form-row      { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-row--3   { grid-template-columns: 1fr 1fr 1fr; }
.form-row--4   { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-group--sm { max-width: 140px; }
.form-group    {}
.form-actions  { display: flex; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-5); align-items: center; padding-top: var(--space-5); border-top: 1px solid var(--c-border); }
.help-text     { font-size: .83rem; color: var(--c-muted); margin-bottom: var(--space-3); }
.inline-form   { margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--c-border); }

/* == Karten / Panels == */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--space-5) var(--space-6);
}

/* == Page Header == */
.page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: var(--space-4); margin-bottom: var(--space-6);
}
.page-header h1 {
    font-size: 1.75rem; font-weight: var(--fw-black);
    letter-spacing: -.04em; line-height: 1.1;
}

/* == Auth == */
.auth-wrapper {
    display: flex; justify-content: center;
    padding-top: var(--space-10);
}
.auth-card {
    width: 100%; max-width: 480px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
}
/* Für reine Textseiten (z.B. "Über uns") - breiter als ein Login-Formular,
   aber bewusst schmaler als die 1100px von .site-main für bessere Lesbarkeit
   langer Textzeilen. */
.content-card {
    width: 100%; max-width: 720px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
}
.auth-title {
    font-size: 1.75rem; font-weight: var(--fw-black);
    letter-spacing: -.05em; margin-bottom: var(--space-6);
}
.auth-alt {
    text-align: center; margin-top: var(--space-5);
    font-size: .85rem; color: var(--c-muted);
}

/* == Data Table == */
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th {
    text-align: left; padding: var(--space-3) var(--space-4);
    font-size: .72rem; font-weight: var(--fw-bold);
    color: var(--c-muted); border-bottom: 2px solid var(--c-border);
    text-transform: uppercase; letter-spacing: .05em;
}
.data-table td      { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover   { background: var(--c-surface-2); }
.action-cell  { display: flex; gap: var(--space-2); align-items: center; white-space: nowrap; }
.table-logo   { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; margin-right: var(--space-2); }
