/* ============================================================
   Avison Studios Dashboard — Grundlage
   Teil 1: Design-Tokens, Gerüst (Seitenleiste + Inhalt), Bereichsköpfe,
   Raster, Karten, Kennzahlen, Buttons und Eingabefelder.

   Das System in einem Satz: ruhige Bühne, Bedeutung durch Farbe.
   Karten haben keinen Rahmen und einen weichen Schatten. Was wichtig
   ist, bekommt eine Tonfläche (Orange = dringend, Moss = Ziel/Erfolg,
   Powder = Zahlen/Technik, Charcoal = Briefing). Kunden tragen ihre
   eigene Farbe als Fläche, nicht als Rand.

   Die Reihenfolge der <link>-Tags in index.html muss so bleiben:
   in CSS gewinnt die spätere Regel.
   ============================================================ */

:root {
    /* ---- CI-Farben (unverändert) ---- */
    --orange: #BE5E21;
    --orange-soft: #d4824d;
    --moss: #8F8F45;
    --powder: #ADBDD6;
    --almond: #E9DAC5;
    --charcoal: #232425;
    --charcoal-soft: #313234;

    /* ---- Bühne & Flächen ---- */
    --canvas: #F4EDE2;            /* Seitenhintergrund */
    --surface: #FFFDF9;           /* Karte */
    --surface-2: #F6F0E6;         /* Zeile, Chip, Eingabe in Karte */
    --paper: var(--surface);      /* alter Name, bleibt für die übrigen Blätter */
    --almond-light: var(--surface-2);
    --white: #fff;

    /* ---- Tonflächen: Bedeutung durch Farbe ---- */
    --tone-orange: #F6E4D7;
    --tone-orange-ink: #8C4014;
    --tone-blue: #E2E9F2;
    --tone-blue-ink: #3B4E6B;
    --tone-moss: #E9EAD6;
    --tone-moss-ink: #5F5F2A;
    --tone-almond: #EFE4D2;
    --tone-red: #F5DEDB;
    --tone-red-ink: #8E1F14;

    /* ---- Schrift ---- */
    --ink: #232425;
    --ink-2: #5D574F;             /* Sekundärtext */
    --ink-3: #8A8177;             /* Hilfstext, erst ab 13px */
    --muted: var(--ink-2);
    --faint: var(--ink-3);
    --danger: #B3271B;
    --ink-rgb: 35, 36, 37;

    /* ---- Linien, Radien, Schatten ---- */
    --line: rgba(35, 36, 37, 0.08);
    --line-strong: rgba(35, 36, 37, 0.16);
    --radius: 16px;
    --radius-sm: 10px;
    --r-pill: 999px;
    --border: 1px solid var(--line);
    --border-sm: 1px solid var(--line);
    --shadow-card: 0 1px 2px rgba(35,36,37,0.04), 0 10px 28px -14px rgba(35,36,37,0.14);
    --shadow-hover: 0 2px 4px rgba(35,36,37,0.05), 0 16px 32px -14px rgba(35,36,37,0.20);
    --shadow: var(--shadow-card);
    --shadow-sm: var(--shadow-card);

    /* ---- Schriften ---- */
    --font-display: 'Chillax', 'Chillax-Regular', system-ui, sans-serif;
    --font-title: 'Gambarino', Georgia, 'Times New Roman', serif;
    /* Kleine Labels laufen jetzt in Chillax – Gambarino nur noch für
       Titel und große Zahlen. Die alten Namen bleiben für die übrigen Blätter. */
    --font-type: var(--font-display);
    --font-type-sm: var(--font-display);

    --gap: 16px;
    --sidebar: 236px;
    --page-x: 28px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 14px;
    line-height: 1.45;
    font-weight: 450;
    -webkit-font-smoothing: antialiased;
}
::selection { background: var(--powder); color: var(--charcoal); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: rgba(35,36,37,0.22) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(35,36,37,0.22); border-radius: 4px; }
.num, .tabnum { font-variant-numeric: tabular-nums; }

/* Icons: eine Strichstärke, überall */
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ============ Gerüst: Seitenleiste + Inhalt ============ */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

.side {
    background: var(--charcoal);
    color: var(--almond);
    padding: 22px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 20px;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
    width: 100%;
}
.brand img { width: 38px; height: auto; display: block; transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.brand:hover img { transform: rotate(-4deg) scale(1.06); }
.brand b { display: block; font-family: var(--font-title); font-weight: 400; font-size: 20px; letter-spacing: 0.02em; line-height: 1; }
.brand small { display: block; font-size: 10.5px; color: rgba(233,218,197,0.55); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 4px; }

.side-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(233,218,197,0.45); padding: 14px 12px 6px; font-weight: 500; }

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: none;
    color: rgba(233,218,197,0.72);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.nav-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-btn:hover { background: rgba(233,218,197,0.07); color: var(--almond); }
.nav-btn.active { background: var(--orange); color: #FFF6EC; }
.nav-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    background: rgba(233,218,197,0.14);
    border-radius: var(--r-pill);
    padding: 2px 8px;
    font-variant-numeric: tabular-nums;
}
.nav-count:empty { display: none; }
.nav-btn.active .nav-count { background: rgba(255,255,255,0.22); }
.nav-count.hot { background: var(--orange); color: #FFF6EC; }
.nav-btn.active .nav-count.hot { background: rgba(255,255,255,0.22); }

.side-foot { margin-top: auto; padding: 14px 4px 0; display: flex; flex-direction: column; gap: 12px; }
.side-tools { display: flex; align-items: center; gap: 6px; padding: 0 6px; }
.icon-action {
    display: inline-grid;
    place-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(233,218,197,0.08);
    color: rgba(233,218,197,0.75);
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.icon-action svg { width: 17px; height: 17px; }
.icon-action:hover { background: rgba(233,218,197,0.16); color: var(--almond); }
.icon-action.muted { color: rgba(233,218,197,0.4); }
.icon-action:not(.muted) .snd-slash { display: none; }
.icon-action.muted .snd-waves { display: none; }

/* Sync-Anzeige: kleiner Punkt + Text */
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(233,218,197,0.62);
    padding: 0 12px;
}
.sync-status:empty { display: none; }
.sync-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.sync-status.ok::before { background: #A6B85A; box-shadow: 0 0 0 3px rgba(166,184,90,0.18); }
.sync-status.offline { color: var(--orange-soft); }
.sync-status.offline::before { background: var(--orange); box-shadow: 0 0 0 3px rgba(190,94,33,0.2); }

/* Zeiterfassung in der Seitenleiste: Kunde wählen + Start / laufende Uhr + Stopp */
.side-timer {
    margin: auto 6px 0;   /* sitzt unten, direkt über Sync und Einstellungen */
    padding: 12px;
    border-radius: 14px;
    background: rgba(233,218,197,0.07);
    color: var(--almond);
}
.side-timer.running {
    background: color-mix(in srgb, var(--client-color, var(--orange)) 22%, #2C2D2E);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--client-color, var(--orange)) 45%, transparent);
}
.side-timer + .side-foot { margin-top: 0; }
.st-fab { display: none; }
.st-panel { display: flex; flex-direction: column; gap: 8px; }
.st-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(233,218,197,0.5); }
.st-row { display: flex; gap: 6px; }
.side-timer select {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 8px 28px 8px 10px;
    border: none;
    border-radius: 10px;
    background-color: rgba(233,218,197,0.1);
    color: var(--almond);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    box-shadow: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E9DAC5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.side-timer select:hover { background-color: rgba(233,218,197,0.16); }
.side-timer select:focus { outline: 2px solid var(--orange); outline-offset: 1px; background-color: rgba(233,218,197,0.16); box-shadow: none; }
.side-timer option, .side-timer optgroup { color: var(--charcoal); background: #FFFDF9; }
.side-timer .st-cat { flex: 1; font-size: 12px; color: rgba(233,218,197,0.8); }
.side-timer select.st-need { animation: st-need 0.45s ease-in-out; outline: 2px solid var(--orange); }
@keyframes st-need { 25% { transform: translateX(-4px); } 60% { transform: translateX(4px); } }
.st-go, .st-stop {
    flex-shrink: 0;
    width: 36px; height: 36px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 10px;
    background: var(--orange);
    color: #FFF6EC;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.st-go:hover { background: #a8531d; }
.st-go:active, .st-stop:active { transform: scale(0.94); }
.st-go .ico, .st-stop .ico { width: 15px; height: 15px; }
.st-stop { background: var(--almond); color: var(--charcoal); }
.st-stop:hover { background: #fff; }
.st-run { display: flex; flex-direction: column; gap: 8px; }
.st-info {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    padding: 0;
    cursor: pointer;
    text-align: left;
}
.st-text { display: flex; flex-direction: column; min-width: 0; }
.st-text strong { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-text small { font-size: 11px; color: rgba(233,218,197,0.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-clockrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-clock { font-family: var(--font-title); font-size: 24px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.st-other { display: flex; align-items: center; gap: 7px; margin: 2px 0 0; font-size: 11px; color: rgba(233,218,197,0.6); }
.st-other .timer-dot { width: 6px; height: 6px; background: var(--moss, #8F8F45); }
.st-other-text { flex: 1; min-width: 0; }
.st-other-stop {
    flex-shrink: 0;
    width: 22px; height: 22px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 6px;
    background: rgba(233,218,197,0.1);
    color: var(--almond);
    cursor: pointer;
}
.st-other-stop:hover { background: rgba(233,218,197,0.22); }
.st-other-stop .ico { width: 10px; height: 10px; }
/* Wer arbeitet: Simon, Endrit oder beide */
.st-who { display: flex; gap: 6px; border-radius: 10px; }
.st-who.st-need { animation: st-need 0.45s ease-in-out; outline: 2px solid var(--orange); }
.st-who-btn {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: none;
    border-radius: 10px;
    background: rgba(233,218,197,0.08);
    color: rgba(233,218,197,0.55);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.st-who-btn:hover { background: rgba(233,218,197,0.14); color: var(--almond); }
.st-who-btn.on.simon { background: var(--moss); color: #fff; }
.st-who-btn.on.endrit { background: var(--powder); color: var(--charcoal); }
.timer-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--client-color, var(--orange)); flex-shrink: 0; animation: timer-blink 1.6s ease-in-out infinite; }
@keyframes timer-blink { 50% { opacity: 0.35; } }

/* ============ Inhalt ============ */
.page { padding: 20px var(--page-x) 56px; min-width: 0; }

/* Rote Warnleiste: überfällige To-dos – jetzt als Tonfläche im Inhalt */
.overdue-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: none;
    border-radius: 12px;
    background: var(--tone-red);
    color: var(--tone-red-ink);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 13px;
    text-align: left;
    padding: 10px 14px;
    margin: 20px var(--page-x) -6px;
    width: calc(100% - 2 * var(--page-x));
    cursor: pointer;
    animation: banner-in 0.3s both;
}
.overdue-banner:hover { background: #F0D2CD; }
.ob-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--danger);
    color: #fff;
    border-radius: 6px;
    padding: 3px 8px;
    flex-shrink: 0;
}
@keyframes banner-in { from { opacity: 0; transform: translateY(-6px); } }

/* Bereichskopf: Titel links, Aktionen rechts */
.day-hero, .view-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 6px 2px 22px;
}
.head-text { min-width: 0; }
.kicker { font-size: 13px; color: var(--ink-2); margin: 0 0 6px; display: block; letter-spacing: 0; }
.day-hero .kicker { color: var(--ink-2); }
.day-title {
    font-family: var(--font-title);
    font-size: clamp(26px, 2.6vw, 34px);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.005em;
    margin: 0;
    text-wrap: balance;
}
.day-title em { font-style: normal; color: var(--orange); }
.day-sub { font-size: 13px; color: var(--ink-2); margin: 6px 0 0; letter-spacing: 0; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Markdown-Export (assets/export.js): leiser Knopf, damit er die eigentlichen Aktionen nicht übertönt */
.md-btn .ico, .md-btn-all .ico { width: 14px; height: 14px; }
.md-btn-docs { padding-left: 9px; padding-right: 9px; }

/* ---- „Heute fällig"-Chips im Kopf ---- */
.today-due { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.today-due:empty { display: none; }
.today-label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.today-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    background: color-mix(in srgb, var(--chip-color, var(--charcoal)) 18%, var(--surface));
    color: var(--ink);
    border: none;
    border-radius: var(--r-pill);
    padding: 6px 13px;
    cursor: pointer;
    transition: background 0.15s;
}
.today-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--chip-color, var(--charcoal)); }
.today-chip:hover { background: color-mix(in srgb, var(--chip-color, var(--charcoal)) 30%, var(--surface)); }
.today-chip img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; background: var(--white); }
.today-chip.deadline { background: var(--tone-almond); }
.today-chip.deadline::before { background: var(--orange); }
.today-chip.deadline.overdue { background: var(--tone-red); color: var(--tone-red-ink); }
.today-chip.deadline.overdue::before { background: var(--danger); }

/* ============ Raster ============ */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.span-3  { grid-column: span 3; }
.span-4  { grid-column: span 4; }
.span-6  { grid-column: span 6; }
.span-8  { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* ============ Karten ============ */
.card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 20px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.card-head > div:first-child { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card-head .kicker { margin: 0; font-size: 12px; }
.card h2 {
    margin: 0;
    font-family: var(--font-title);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.005em;
    line-height: 1.1;
}
.card h3 {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.card-sub { font-size: 13px; color: var(--ink-3); }
.card-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--line-strong);
    font-family: inherit;
}
.card-link:hover { color: var(--orange); text-decoration-color: currentColor; }

/* Tonflächen-Karten */
.card.tone-charcoal { background: var(--charcoal); color: var(--almond); }
.card.tone-charcoal h2 { color: var(--almond); }
.card.tone-charcoal .card-sub { color: rgba(233,218,197,0.5); }
.card.tone-orange { background: var(--tone-orange); }
.card.tone-blue { background: var(--tone-blue); }
.card.tone-moss { background: var(--tone-moss); }
.card.tone-almond { background: var(--tone-almond); }

/* ============ Kennzahlen-Kacheln ============ */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.kpi-row:empty { display: none; }
.kpi {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
    min-height: 116px;
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: var(--ink);
    transition: box-shadow 0.15s, transform 0.15s;
}
.kpi:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.kpi-l { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.kpi-l svg { width: 16px; height: 16px; }
.kpi-v { font-family: var(--font-title); font-size: 36px; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi-v small { font-family: var(--font-display); font-size: 13px; font-weight: 500; color: var(--ink-2); margin-left: 6px; letter-spacing: 0; }
.kpi-m { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); margin-top: auto; min-width: 0; }
.kpi-m .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.orange { background: var(--tone-orange); }
.kpi.orange .kpi-l, .kpi.orange .kpi-m, .kpi.orange .kpi-v small { color: var(--tone-orange-ink); }
.kpi.red { background: var(--tone-red); }
.kpi.red .kpi-l, .kpi.red .kpi-m, .kpi.red .kpi-v small { color: var(--tone-red-ink); }
.kpi.blue { background: var(--tone-blue); }
.kpi.blue .kpi-l, .kpi.blue .kpi-m, .kpi.blue .kpi-v small { color: var(--tone-blue-ink); }
.kpi.moss { background: var(--tone-moss); }
.kpi.moss .kpi-l, .kpi.moss .kpi-m, .kpi.moss .kpi-v small { color: var(--tone-moss-ink); }
.kpi.almond { background: var(--tone-almond); }
.bar { height: 6px; border-radius: 3px; background: rgba(35,36,37,0.10); overflow: hidden; flex: 1; min-width: 40px; }
.bar i { display: block; height: 100%; width: var(--w, 0%); background: var(--bar-color, var(--moss)); border-radius: 3px; transition: width 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    background: var(--charcoal);
    color: var(--almond);
    border: none;
    border-radius: var(--r-pill);
    box-shadow: none;
    padding: 9px 16px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s, color 0.15s;
}
.btn:hover { background: #363739; transform: none; box-shadow: none; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.ghost:hover { background: var(--tone-almond); }
.btn.primary, .btn.orange { background: var(--orange); color: #FFF6EC; }
.btn.primary:hover, .btn.orange:hover { background: #a8531d; }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.round { border-radius: 50%; width: 38px; height: 38px; padding: 0; font-size: 20px; line-height: 1; flex-shrink: 0; }
.btn.danger { background: var(--tone-red); color: var(--tone-red-ink); }
.btn.danger:hover { background: #F0D2CD; }
.btn:disabled { opacity: 0.45; cursor: default; }

.icon-btn {
    background: none;
    border: none;
    color: var(--ink-3);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 8px;
    line-height: 1;
    font-family: inherit;
}
.icon-btn:hover { color: var(--orange); background: rgba(190, 94, 33, 0.10); }

/* ============ Eingabefelder ============ */
input[type=text], input[type=url], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=search], input[type=email], select, textarea {
    font-family: var(--font-display);
    font-size: 14px;
    background: var(--surface-2);
    border: 1px solid transparent;
    color: var(--ink);
    border-radius: 10px;
    padding: 10px 12px;
    width: 100%;
    transition: background 0.15s, border-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; background: var(--surface); border-color: var(--powder); box-shadow: 0 0 0 3px rgba(173,189,214,0.35); }
::placeholder { color: var(--ink-3); }
select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235D574F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
label { font-size: 13px; font-weight: 500; color: var(--ink-2); }

.add-row { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.add-row input { flex: 1; }
.add-row select { width: auto; }
.add-row.small input { padding: 7px 10px; font-size: 13px; }
.add-row.small .btn { padding: 6px 12px; font-size: 12px; }

.muted { color: var(--ink-2); }
.small { font-size: 13px; }

/* ============ Responsiv ============ */
@media (max-width: 1240px) {
    .span-3 { grid-column: span 6; }
    .span-4, .span-6, .span-8 { grid-column: span 12; }
    .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    :root { --page-x: 16px; }
    .shell { grid-template-columns: minmax(0, 1fr); }
    /* Die Seitenleiste wird zur Bottom-Bar */
    .side {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        flex-direction: row;
        align-items: stretch;
        gap: 2px;
        padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        z-index: 80;
        overflow: visible;
    }
    .brand, .side-label, .side-foot { display: none; }
    /* Zeiterfassung schwebt rechts über der Leiste: runder Knopf, klappt auf */
    .side-timer {
        position: fixed;
        right: 12px;
        bottom: calc(80px + env(safe-area-inset-bottom));
        margin: 0;
        padding: 0;
        background: none;
        z-index: 81;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }
    .st-fab {
        order: 2;
        display: grid;
        place-items: center;
        width: 50px; height: 50px;
        border: none;
        border-radius: 50%;
        background: var(--charcoal);
        color: var(--almond);
        box-shadow: 0 10px 24px -8px rgba(0,0,0,0.5);
        cursor: pointer;
    }
    .st-fab svg { width: 22px; height: 22px; }
    .side-timer.open .st-fab { background: var(--orange); color: #FFF6EC; }
    .st-panel { display: none; width: min(260px, calc(100vw - 24px)); padding: 12px; border-radius: 16px; background: var(--charcoal); box-shadow: 0 16px 36px -12px rgba(0,0,0,0.55); }
    .side-timer.open .st-panel { display: flex; }
    .side-timer select { font-size: 16px; }   /* sonst zoomt iOS beim Antippen */
    .side-timer.running {
        padding: 8px 8px 8px 14px;
        border-radius: var(--r-pill);
        background: color-mix(in srgb, var(--client-color, var(--orange)) 30%, var(--charcoal));
        box-shadow: 0 10px 24px -8px rgba(0,0,0,0.5);
    }
    .side-timer.running .st-run { flex-direction: row; align-items: center; gap: 10px; }
    .side-timer.running .st-text small, .side-timer.running .st-other { display: none; }
    .side-timer.running .st-text strong { max-width: 110px; }
    .side-timer.running .st-clock { font-size: 18px; }
    .nav-btn { flex: 1; flex-direction: column; gap: 4px; font-size: 10px; padding: 8px 2px; border-radius: 12px; justify-content: center; }
    .nav-btn svg { width: 20px; height: 20px; }
    .nav-count { position: absolute; display: none; }
    .page { padding-bottom: 96px; }
    .day-hero, .view-head { padding-top: 4px; }
    .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi { padding: 14px 16px; min-height: 0; }
    .kpi-v { font-size: 30px; }
}
@media (max-width: 520px) {
    .kpi-row { grid-template-columns: minmax(0, 1fr); }
    .span-3 { grid-column: span 12; }
}

/* Inhaltsspalte neben der Seitenleiste */
.content { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.content .page { flex: 1; }

/* ============ Icon-Sprite (assets/icons.svg, assets/icons.js) ============
   Ein Icon läuft als 1em-Quadrat in der Textfarbe mit. Drehungen ersetzen
   Varianten: rot90 = nach unten, rot180 = nach links, rot270 = nach oben. */
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.16em; flex-shrink: 0; fill: currentColor; }
.ico.rot90 { transform: rotate(90deg); }
.ico.rot180 { transform: rotate(180deg); }
.ico.rot270 { transform: rotate(270deg); }
.ico-text { font-size: 0.95em; }
.btn .ico, .nav-btn .ico { width: 1.05em; height: 1.05em; }
.icon-btn .ico { width: 1em; height: 1em; }
.focus-star .ico { width: 17px; height: 17px; }
.todo-sect-caret .ico, .doc-row-caret .ico { width: 11px; height: 11px; }
.sub-chip .ico, .todo-client .ico { width: 12px; height: 12px; }
.detail-dot .ico { width: 12px; height: 12px; }
.ob-badge .ico { width: 12px; height: 12px; vertical-align: -0.12em; }
.file-icon .ico { width: 18px; height: 18px; }
.doc-row-icon .ico, .docw-icon .ico, .dmi-icon .ico, .td-doc .ico { width: 16px; height: 16px; }
.doc-icon-btn .ico { width: 28px; height: 28px; }
.doc-icon-pop button .ico { width: 20px; height: 20px; }
.doc-tpl .ico { width: 18px; height: 18px; color: var(--orange); }
.blk-marker.callout .ico { width: 16px; height: 16px; }
.pal-lock .ico, .gt-state .ico, .aviens-badge .ico { width: 14px; height: 14px; }
.p-btn .ico { width: 20px; height: 20px; }
.cal-nav .ico, .prompt-nav .ico, .dlb-nav .ico, .rm-cut .ico { width: 14px; height: 14px; }
.todo-legend .ico { width: 13px; height: 13px; }

/* Bottom-Bar am Handy: neun Bereiche passen nicht nebeneinander –
   die Leiste scrollt seitlich, Beschriftungen brechen nicht um. */
@media (max-width: 860px) {
    .side { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; justify-content: flex-start; }
    .side::-webkit-scrollbar { display: none; }
    .side .nav-btn { flex: 1 0 auto; width: auto; min-width: 60px; padding-left: 8px; padding-right: 8px; }
    .side .nav-label { white-space: nowrap; }
}
