/* Connectra brand — Schichtplaner management UI.
   Tokens mirrored from connectra-website tokens.css (single source of brand).
   Hand-written component classes — no Tailwind. */

/* ---------- Fonts (self-hosted, served from /fonts/) ---------- */
@font-face { font-family: 'Satoshi'; src: url('/fonts/satoshi-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('/fonts/satoshi-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('/fonts/satoshi-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('/fonts/satoshi-900.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-normal.woff2') format('woff2'); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-italic.woff2') format('woff2'); font-weight: 300 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'DM Serif Display'; src: url('/fonts/dm-serif-display-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

/* ---------- Tokens (from connectra-website) ---------- */
:root {
  --bg: #fbf6f0; --bg-soft: #f4ebe1; --surface: #ffffff; --surface-elevated: #fffaf4;
  --surface-glass: rgba(255, 255, 255, 0.85);
  --text: #2a2026; --text-muted: #6e6168; --text-soft: #796b73;
  --border: #ece0d4; --border-strong: #ddccbd;
  --rose: #bf2e51; --rose-deep: #8f1426; --rose-bg: #fbe9ee; --rose-glow: rgba(143, 20, 38, 0.24);
  --cherry: #8f1426; --cherry-pink-soft: #ffd9e8;
  --ok-green: #2f9e63; --warn: #c2710c; --error: #c0392b; --danger-bg: #fdeee8;
  --font-sans: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;
  --radius-card: 18px; --radius-md: 12px; --radius-sm: 8px; --radius-pill: 999px;
}

/* ---------- Base ---------- */
* , *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font-sans); font-size: 15px; line-height: 1.6; color: var(--text);
  background:
    radial-gradient(circle at 82% 4%, rgba(191, 46, 81, 0.10), transparent 40%),
    linear-gradient(180deg, #fdf9f4 0%, #fbf6f0 60%, #f8f1ea 100%);
  background-attachment: fixed; min-height: 100vh; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
code { background: var(--bg-soft); border-radius: 4px; padding: 1px 5px; font-size: 0.85em; }
::selection { background: var(--cherry); color: #fff; }

/* ---------- Topbar / nav ---------- */
.topbar { background: var(--surface-glass); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand { font-family: var(--font-serif); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; margin-right: 14px; color: var(--rose-deep); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-link { padding: 8px 13px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; color: var(--text-muted); transition: background-color .2s, color .2s; }
.nav-link:hover { background: var(--bg-soft); color: var(--text); }
.nav-link.active { background: linear-gradient(120deg, var(--rose), var(--rose-deep)); color: #fff; }
.logout-form { margin-left: auto; }

/* ---------- Layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 24px 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.page-title { font-family: var(--font-serif); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.muted { color: var(--text-muted); font-weight: 400; font-size: 14px; }
.note { font-size: 12px; color: var(--text-soft); margin-top: 14px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; font-size: 13px; border: none; border-radius: var(--radius-pill); padding: 9px 18px; cursor: pointer; transition: box-shadow .2s, transform .2s, background-color .2s, color .2s; }
.btn-primary { background: linear-gradient(120deg, var(--rose), var(--rose-deep)); color: #fff; box-shadow: 0 8px 24px -10px var(--rose-glow); }
.btn-primary:hover { box-shadow: 0 12px 32px -8px var(--rose-glow); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--rose); color: var(--rose-deep); }
.btn-text { background: none; border: none; color: var(--text-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 8px 12px; border-radius: var(--radius-pill); }
.btn-text:hover { background: var(--bg-soft); color: var(--text); }
.btn-sm { font-size: 12px; padding: 5px 11px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* ---------- Cards / surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 8px; box-shadow: 0 1px 2px rgba(42,32,38,0.03); }
.empty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 28px; text-align: center; color: var(--text-muted); }
.scroll-x { overflow-x: auto; }

/* ---------- Login ---------- */
.login-card { max-width: 380px; margin: 64px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 32px; box-shadow: 0 24px 60px -30px var(--rose-glow); }
.login-title { font-family: var(--font-serif); font-size: 24px; font-weight: 700; color: var(--rose-deep); margin-bottom: 2px; }
.alert { background: var(--danger-bg); border: 1px solid var(--rose); color: var(--rose-deep); font-size: 13px; border-radius: var(--radius-sm); padding: 9px 12px; margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 5px; }
.input { width: 100%; background: var(--surface-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; font: inherit; color: var(--text); margin-bottom: 16px; outline: none; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-bg); }
.select { background: var(--surface-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 4px 8px; font: inherit; font-size: 12px; color: var(--text); }

/* ---------- Period picker ---------- */
.period-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.period-bar-label { font-size: 12px; color: var(--text-muted); margin-right: 2px; }
.period-pill { padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-muted); transition: border-color .2s, color .2s; }
.period-pill:hover { border-color: var(--rose); color: var(--rose-deep); }
.period-pill.active { background: linear-gradient(120deg, var(--rose), var(--rose-deep)); border-color: transparent; color: #fff; }

/* ---------- Tables ---------- */
.grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid-table td { border: 1px solid var(--border); padding: 8px; vertical-align: top; }
.grid-table .day-cell { font-weight: 600; white-space: nowrap; background: var(--bg-soft); }
.cell-head { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead { background: var(--bg-soft); text-align: left; }
.data-table th { padding: 9px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 700; }
.data-table td { padding: 9px; border-top: 1px solid var(--border); }
.data-table tr:first-child td { border-top: none; }

/* ---------- Chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 2px 9px; font-size: 12px; margin: 0 4px 4px 0; }
.chip-x { color: var(--rose); font-weight: 700; background: none; border: none; cursor: pointer; padding: 0; line-height: 1; }
.chip-x:hover { color: var(--rose-deep); }
.assign-form { display: flex; gap: 5px; margin-top: 6px; }
.dash { color: var(--text-soft); font-size: 12px; }
.warn { color: var(--warn); }
.inline { display: inline; }

/* Tabellen-Controls (v3) — Suche + sortierbare Header. Kein JS (CSP script-src 'none'). */
.table-search { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; flex-wrap: wrap; }
.search-input { background: var(--surface-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 12px; font: inherit; font-size: 13px; color: var(--text); outline: none; min-width: 16rem; transition: border-color .2s, box-shadow .2s; }
.search-input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-bg); }
.data-table thead th { text-align: left; }
.sort-link { text-decoration: none; color: var(--text-muted); font-weight: 700; white-space: nowrap; }
.sort-link:hover { color: var(--text); text-decoration: underline; }
