/* ═══════════════════════════════════════════════════════════════
   dokuno — Design System v1
   Warm & Professionell · Lokal gehostete Fonts (DSGVO-konform)
   Font: Inter (lokal) mit System-Font Fallback
   ═══════════════════════════════════════════════════════════════ */

/* Inter lokal einbinden — Dateien unter /assets/fonts/ ablegen */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local('Inter'),
       url('/assets/fonts/inter-var.woff2') format('woff2');
}

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

:root {
  /* ── Farben ── */
  --accent:        #2D5BE3;
  --accent-hover:  #2449C4;
  --accent-light:  #EEF2FF;
  --accent-text:   #1E3FA0;

  --success:       #1A7F50;
  --success-light: #E6F5EE;
  --warning:       #C4620D;
  --warning-light: #FEF3E2;
  --danger:        #C42B2B;
  --danger-light:  #FDEAEA;

  /* Warm Grays — das Herzstück der Richtung */
  --gray-50:  #F7F6F3;   /* Seiten-Hintergrund */
  --gray-100: #F0EFE9;   /* leichte Fläche */
  --gray-200: #E5E3DA;   /* Borders */
  --gray-300: #CCC9BD;   /* stärkere Border */
  --gray-400: #9C9A8E;   /* Placeholder, Hint */
  --gray-500: #737068;   /* Muted Text */
  --gray-600: #504D46;   /* Body Text sekundär */
  --gray-700: #312F2A;   /* Body Text */
  --gray-800: #1E1C18;   /* Headings */
  --gray-900: #0F0E0B;   /* Sehr dunkel */

  /* Seitenlayout */
  --sidebar-w:   224px;
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   14px;
  --shadow-sm:   0 1px 2px rgba(0,0,0,.06);
  --shadow:      0 1px 4px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);

  /* Font Stack — Inter lokal, System als Fallback */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 15px;
  color: var(--gray-700);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── App Shell ─────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--gray-100);
}

.logo-mark {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.logo-mark svg {
  width: 16px; height: 16px;
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -.5px;
}

.logo-text span {
  color: var(--accent);
}

.sidebar-nav {
  flex: 1;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
}

.sidebar-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gray-400);
  padding: 12px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 450;
  transition: background .12s, color .12s;
  position: relative;
}

.nav-item svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: .7;
}

.nav-item:hover {
  background: var(--gray-50);
  color: var(--gray-800);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.active svg { opacity: 1; }

.badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  font-family: var(--font-mono);
}

.sidebar-footer {
  padding: 10px 10px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.user-avatar {
  width: 30px; height: 30px;
  background: var(--accent-light);
  color: var(--accent-text);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--gray-400);
  white-space: nowrap;
}

.logout-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400);
  border-radius: var(--radius-sm);
  transition: background .12s, color .12s;
  flex-shrink: 0;
  text-decoration: none;
}

.logout-btn svg { width: 16px; height: 16px; }
.logout-btn:hover { background: var(--danger-light); color: var(--danger); }

/* ── Main Content ──────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 36px;
  max-width: 1120px;
}

/* ── Flash Messages ────────────────────────────────────────────── */
.flash {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flash::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.flash-info    { background: var(--accent-light); color: var(--accent-text); }
.flash-success { background: var(--success-light); color: var(--success); }
.flash-error   { background: var(--danger-light); color: var(--danger); }
.flash-warning { background: var(--warning-light); color: var(--warning); }

/* ── Page Header ───────────────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -.5px;
}

.page-header p {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}

.card-body { padding: 20px; }

/* ── Stats ─────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat-label {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-800);
  font-family: var(--font-mono);
  letter-spacing: -1px;
}

.stat-value.accent  { color: var(--accent); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }

/* ── Table ─────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .7px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background .1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

td {
  padding: 11px 16px;
  color: var(--gray-700);
  vertical-align: middle;
}

/* ── Status Pills ──────────────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.status-pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.pill-draft     { background: var(--gray-100);    color: var(--gray-500); }
.pill-submitted { background: var(--warning-light); color: var(--warning); }
.pill-approved  { background: var(--success-light); color: var(--success); }
.pill-rejected  { background: var(--danger-light);  color: var(--danger); }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .12s, transform .08s, box-shadow .12s;
  white-space: nowrap;
  line-height: 1;
}

.btn:active { transform: scale(.98); }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(45,91,227,.25);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 6px rgba(45,91,227,.3);
}

.btn-secondary {
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-50); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #156640; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a82323; }

.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-sm svg { width: 13px; height: 13px; }

/* ── Forms ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 5px;
}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=date],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--gray-800);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,91,227,.1);
}

input:disabled, select:disabled, textarea:disabled {
  background: var(--gray-50);
  color: var(--gray-400);
  cursor: not-allowed;
}

textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

.form-hint {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ── Auth Layout ───────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  padding: 24px;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
  padding: 40px 40px 36px;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-logo .logo-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
}

.auth-logo .logo-text { font-size: 19px; }

.auth-card h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -.4px;
  margin-bottom: 5px;
}

.auth-card > p {
  font-size: 13.5px;
  color: var(--gray-500);
  margin-bottom: 26px;
  line-height: 1.5;
}

/* ── Report Form ───────────────────────────────────────────────── */
.week-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.week-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  font-family: var(--font-mono);
}

.day-block {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}

.day-block:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,91,227,.08);
}

.day-header {
  padding: 9px 15px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gray-700);
}

.day-date {
  font-size: 11.5px;
  color: var(--gray-400);
  font-family: var(--font-mono);
}

.day-block textarea {
  border: none;
  border-radius: 0;
  padding: 11px 15px;
  font-size: 13.5px;
  min-height: 70px;
}

.day-block textarea:focus {
  box-shadow: none;
  border-color: transparent;
}

/* ── Report View ───────────────────────────────────────────────── */
.entry-item {
  padding: 13px 0;
  border-bottom: 1px solid var(--gray-100);
}
.entry-item:last-child { border-bottom: none; }

.entry-day {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gray-400);
  margin-bottom: 4px;
}

.entry-text {
  font-size: 13.5px;
  color: var(--gray-700);
  line-height: 1.65;
  white-space: pre-wrap;
}

/* ── Empty State ───────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--gray-400);
}

.empty-state svg {
  width: 36px; height: 36px;
  margin-bottom: 10px;
  opacity: .35;
}

.empty-state p { font-size: 13.5px; }

/* ── Tabs ──────────────────────────────────────────────────────── */
.tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid var(--gray-200);
  margin-bottom: 22px;
}

.tab-btn {
  padding: 9px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: color .12s, border-color .12s;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--gray-800); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Search & Filter ───────────────────────────────────────────── */
.search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.search-wrap svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--gray-400);
  pointer-events: none;
}

.search-input {
  padding-left: 34px;
  width: 100%;
  padding-top: 8px;
  padding-bottom: 8px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--gray-800);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,91,227,.1);
}

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chip {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-500);
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: all .12s;
  line-height: 1;
}

.chip:hover { background: var(--gray-200); color: var(--gray-700); }
.chip.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(45,91,227,.25);
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; padding: 20px 16px; }
}

/* ── Kopierschutz ────────────────────────────────────────────────── */
/* Textmarkierung deaktivieren — Drucken/PDF bleibt möglich */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* Formularfelder zum Schreiben weiterhin selektierbar */
input, textarea, [contenteditable] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
/* Bilder nicht draggable */
img { pointer-events: none; -webkit-user-drag: none; }
