/*
 * Tibu Design System 1.2.1
 * Milestone 1: frozen foundations, shared components and responsive rules.
 */

:root {
  color-scheme: dark;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --bg-0: #101827;
  --bg-1: #172235;
  --bg-2: #222e42;
  --surface-0: rgba(18, 27, 43, .94);
  --surface-1: rgba(255, 255, 255, .075);
  --surface-2: rgba(255, 255, 255, .11);
  --surface-3: rgba(255, 255, 255, .16);
  --line: rgba(255, 255, 255, .13);
  --line-strong: rgba(255, 255, 255, .22);

  --text: #f7f9fc;
  --text-soft: #d7deea;
  --muted: #a8b4c7;
  --dark-text: #07111f;
  --danger: #ff756f;
  --danger-soft: rgba(255, 117, 111, .15);
  --success: #42cbd5;

  --cyan: #42cbd5;
  --cyan-2: #24b9c5;
  --orange: #ff926c;
  --orange-2: #ff764f;
  --yellow: #ffdf91;
  --yellow-2: #ffc94f;
  --purple: #8654ff;
  --purple-2: #6d39f5;

  /* Verbindlicher Kontrastvertrag für Markenfarbflächen */
  --on-brand-dark: #07111f;
  --on-brand-dark-muted: rgba(7, 17, 31, .68);
  --on-brand-light: #ffffff;
  --on-brand-light-muted: rgba(255, 255, 255, .76);

  --header-height: 64px;
  --bottom-nav-height: 82px;
  --sidebar-width: 248px;
  --content-width: 760px;
  --content-gap: 16px;
  --panel-padding: 24px;
  --control-height: 52px;
  --pill-height: 82px;

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --radius-pill: 999px;

  --shadow-sm: 0 10px 28px rgba(0, 0, 0, .16);
  --shadow-md: 0 20px 56px rgba(0, 0, 0, .24);
  --shadow-lg: 0 34px 90px rgba(0, 0, 0, .34);

  --ease-standard: cubic-bezier(.2, .8, .2, 1);
  --duration-fast: 150ms;
  --duration: 220ms;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-0); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at 7% 0%, rgba(66, 203, 213, .18), transparent 30%),
    radial-gradient(circle at 100% 4%, rgba(134, 84, 255, .17), transparent 28%),
    linear-gradient(145deg, var(--bg-2), var(--bg-1) 52%, var(--bg-0));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open { position: fixed; inset-inline: 0; width: 100%; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden], .is-hidden { display: none !important; }
:focus-visible { outline: 3px solid rgba(66, 203, 213, .78); outline-offset: 3px; }
::selection { color: var(--dark-text); background: var(--cyan); }

* { scrollbar-width: thin; scrollbar-color: rgba(168, 180, 199, .58) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(168, 180, 199, .42); border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(168, 180, 199, .68); border: 2px solid transparent; background-clip: padding-box; }

/* Shell and page layout */
.app-shell { min-height: 100vh; min-height: 100dvh; }
.screen {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--safe-top) + 8px) max(16px, var(--safe-right)) calc(var(--bottom-nav-height) + var(--safe-bottom) + 28px) max(16px, var(--safe-left));
}
.native-header,
.view > * {
  width: min(100%, var(--content-width));
  margin-inline: auto;
}
.native-header {
  position: sticky;
  top: var(--safe-top);
  z-index: 35;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  height: var(--header-height);
  margin-bottom: 12px;
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.native-header h1 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -.025em;
}
.icon-link {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, .055);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--duration-fast) ease, background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}
.icon-link:hover { border-color: var(--line); background: rgba(255, 255, 255, .1); }
.icon-link:active { transform: scale(.94); }
.icon-link img { width: 21px; height: 21px; filter: invert(1); opacity: .9; }
.ui-icon-mirror-x { transform: scaleX(-1); transform-origin: center; }

.app-views { position: relative; min-height: 70vh; overflow: visible; }
.view { display: none; position: relative; z-index: 0; padding-bottom: 2px; overflow: visible; }
.view.is-active { display: block; z-index: 1; overflow: visible; animation: view-in var(--duration) var(--ease-standard) both; }
.view.is-prev, .view.is-next { display: none; }

/* Shared surfaces */
.native-panel {
  margin-block: 14px;
  position: relative;
  z-index: 1;
  padding: var(--panel-padding);
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .04));
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
}
.native-panel h2 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: clamp(22px, 4.8vw, 28px);
  font-weight: 920;
  line-height: 1.1;
  letter-spacing: -.04em;
}
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.section-title-row h2 { margin: 0; }
.compact-form { overflow: visible; }

/* Segmented controls */
.segment-pills {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  width: min(100%, 420px);
  margin: 0 auto 18px;
  padding: 3px;
  border: 1px solid rgba(66, 203, 213, .52);
  border-radius: var(--radius-pill);
  background: rgba(8, 15, 27, .34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.segment {
  min-height: 42px;
  padding: 8px 15px;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--cyan);
  background: transparent;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast), transform var(--duration-fast);
}
.segment:hover { background: rgba(66, 203, 213, .08); }
.segment:active { transform: scale(.98); }
.segment.active { color: var(--dark-text); background: linear-gradient(135deg, var(--cyan), var(--cyan-2)); box-shadow: var(--shadow-sm); }
.segment strong { margin-left: 4px; }
.project-filter-pills { display: none; }
.project-filter-top { margin-bottom: 16px; }

/* Dashboard cards */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.mini-stat,
.insight-card {
  border: 0;
  color: var(--dark-text);
  text-decoration: none;
}
.mini-stat {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 104px;
  padding: 15px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.mini-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mini-stat:active { transform: translateY(0) scale(.985); }
.mini-stat span { overflow: hidden; font-size: clamp(20px, 4vw, 27px); font-weight: 950; line-height: 1; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.04em; }
.mini-stat small { margin-top: 7px; color: rgba(7, 17, 31, .7); font-size: 12px; font-weight: 850; }
.dashboard-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.insight-card {
  display: grid;
  align-content: end;
  min-height: 142px;
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.insight-label { margin-bottom: auto; color: rgba(7, 17, 31, .72); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.insight-card strong { margin-top: 20px; overflow: hidden; font-size: clamp(25px, 5vw, 34px); font-weight: 950; line-height: 1; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.045em; }
.insight-card small { margin-top: 7px; overflow: hidden; color: rgba(7, 17, 31, .68); font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.next-todo-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .045));
  box-shadow: var(--shadow-sm);
}
.next-todo-card > img { width: 48px; height: 48px; padding: 13px; border-radius: 17px; background: rgba(66, 203, 213, .14); filter: invert(79%) sepia(46%) saturate(582%) hue-rotate(133deg) brightness(95%) contrast(92%); }
.next-todo-card div { min-width: 0; }
.next-todo-card span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.next-todo-card strong { display: block; color: var(--text); font-size: 15px; line-height: 1.4; }

/* Brand color utilities and frozen contrast contract */
.c-cyan { background: linear-gradient(135deg, var(--cyan), var(--cyan-2)) !important; color: var(--dark-text) !important; }
.c-orange { background: linear-gradient(135deg, var(--orange), var(--orange-2)) !important; color: var(--dark-text) !important; }
.c-yellow { background: linear-gradient(135deg, var(--yellow), var(--yellow-2)) !important; color: var(--dark-text) !important; }
.c-purple { background: linear-gradient(135deg, var(--purple), var(--purple-2)) !important; color: #fff !important; }

.ui-color-surface {
  --ui-on-color: var(--on-brand-dark);
  --ui-on-color-muted: var(--on-brand-dark-muted);
  --ui-on-color-line: rgba(7, 17, 31, .22);
  --ui-on-color-overlay: rgba(7, 17, 31, .09);
  --ui-on-color-panel: rgba(255, 255, 255, .15);
  --ui-on-color-icon-filter: brightness(0) saturate(100%);
  color: var(--ui-on-color) !important;
  background-clip: padding-box !important;
}
.ui-color-surface.ui-on-light {
  --ui-on-color: var(--on-brand-light);
  --ui-on-color-muted: var(--on-brand-light-muted);
  --ui-on-color-line: rgba(255, 255, 255, .28);
  --ui-on-color-overlay: rgba(7, 17, 31, .18);
  --ui-on-color-panel: rgba(255, 255, 255, .09);
  --ui-on-color-icon-filter: invert(1);
}
.ui-color-surface.ui-on-dark { color: var(--on-brand-dark) !important; }
.ui-color-surface.ui-on-light { color: var(--on-brand-light) !important; }

.ui-color-surface :where(.project-title, .meter-value, .timer-display, .project-description-content, .project-description-content h3, .running-hint) {
  color: var(--ui-on-color) !important;
}
.ui-color-surface :where(.project-sub, .insight-label, small, .meter-label) {
  color: var(--ui-on-color-muted) !important;
}
.ui-color-surface :where(.project-icon img, .chevron) {
  filter: var(--ui-on-color-icon-filter) !important;
  opacity: .84;
}
.ui-color-surface .project-icon { background: var(--ui-on-color-overlay); }
.ui-color-surface :where(.project-detail, .team-detail) {
  border-color: var(--ui-on-color-line);
  color: var(--ui-on-color);
  background: var(--ui-on-color-panel);
}
.ui-color-surface :where(.project-description-content, .meter-item, .project-timer-box) {
  border-color: var(--ui-on-color-line);
  background: var(--ui-on-color-overlay);
}
.ui-color-surface .round-complete {
  border-color: var(--ui-on-color-line);
  color: var(--ui-on-color);
  background: var(--ui-on-color-overlay);
}
.ui-color-surface .round-complete:hover {
  border-color: var(--ui-on-color);
  background: var(--ui-on-color-panel);
}
.ui-color-surface .round-complete img {
  filter: var(--ui-on-color-icon-filter) !important;
  opacity: .88;
}
.ui-color-surface .employee-delete {
  border-color: var(--ui-on-color-line);
  color: var(--ui-on-color);
  background: var(--ui-on-color-overlay);
}
.ui-color-surface .employee-delete img {
  filter: var(--ui-on-color-icon-filter) !important;
  opacity: .88;
}

/* Neutrale Unterflächen setzen den Markenflächen-Kontrast bewusst zurück. */
.ui-color-surface :where(.month-report-detail, .edit-panel) {
  --ui-on-color: var(--text);
  --ui-on-color-muted: var(--muted);
  --ui-on-color-line: var(--line);
  --ui-on-color-overlay: rgba(255, 255, 255, .07);
  --ui-on-color-panel: rgba(255, 255, 255, .09);
  --ui-on-color-icon-filter: invert(1);
  color: var(--text);
}

/* Ein Farbwähler ist kein Farbflächen-Container. Nur der innere Swatch trägt Farbe und Radius. */
.color-choice.ui-color-swatch {
  overflow: visible;
  border-radius: 0 !important;
  color: inherit !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Expandable cards */
.pill-list,
.project-list,
.team-list,
.month-report-list { display: grid; gap: 14px; min-width: 0; }
.project-wrap,
.team-wrap,
.month-report-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  overflow: visible;
  border-radius: var(--radius-xl);
  background-clip: padding-box;
}
.project-wrap:hover,
.team-wrap:hover,
.month-report-wrap:hover { z-index: 2; }
.project-wrap:not(.is-open),
.team-wrap:not(.is-open),
.month-report-wrap:not(.is-open) { background: transparent !important; }
.project-wrap.is-open,
.team-wrap.is-open { box-shadow: var(--shadow-sm); }
.project-pill,
.team-pill,
.month-report-pill {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 15px;
  width: 100%;
  min-width: 0;
  min-height: var(--pill-height);
  padding: 13px 20px 13px 14px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--dark-text);
  text-align: left;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--duration-fast) ease, border-radius var(--duration) var(--ease-standard), box-shadow var(--duration) ease;
}
.project-pill:hover,
.team-pill:hover,
.month-report-pill:hover { box-shadow: var(--shadow-md); }
.project-pill:active,
.team-pill:active,
.month-report-pill:active { transform: scale(.988); }
.project-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: rgba(7, 17, 31, .13);
}
.project-icon img { width: 26px; height: 26px; opacity: .75; }
.project-copy { display: grid; gap: 3px; min-width: 0; }
.project-title,
.project-sub { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-title { color: inherit; font-size: 18px; font-weight: 950; line-height: 1.18; letter-spacing: -.03em; }
.project-sub { color: var(--ui-on-color-muted, rgba(7, 17, 31, .7)); font-size: 13px; font-weight: 820; }
.chevron { width: 21px; height: 21px; opacity: .52; transition: transform var(--duration) var(--ease-standard); }
.c-purple .project-sub { color: var(--ui-on-color-muted, rgba(255, 255, 255, .76)); }
.c-purple .project-icon img,
.c-purple .chevron { filter: var(--ui-on-color-icon-filter, invert(1)); opacity: .84; }

.project-wrap.is-open .project-pill,
.project-pill.expanded,
.team-wrap.is-open .team-pill,
.team-pill.expanded,
.month-report-wrap.is-open .month-report-pill { border-radius: var(--radius-xl) var(--radius-xl) 16px 16px; }
.project-wrap.is-open .chevron,
.project-pill.expanded .chevron,
.team-wrap.is-open .chevron,
.team-pill.expanded .chevron,
.month-report-wrap.is-open .chevron { transform: rotate(180deg); }

.project-detail,
.team-detail,
.month-report-detail {
  display: none;
  position: relative;
  z-index: 1;
  margin-top: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px var(--radius-xl) var(--radius-xl) var(--radius-xl);
  background: linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .045));
  box-shadow: var(--shadow-sm);
  animation: detail-in var(--duration) var(--ease-standard) both;
}
.project-detail.open,
.team-detail.open,
.month-report-detail.open { display: block; }
.month-report-wrap.is-open.c-cyan,
.month-report-wrap.is-open.c-orange,
.month-report-wrap.is-open.c-yellow,
.month-report-wrap.is-open.c-purple { padding-bottom: 0; background: transparent !important; }
.month-report-wrap.is-open .month-report-detail { color: var(--text); }

.project-description-content {
  margin-bottom: 18px;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(8, 15, 27, .24);
  color: var(--ui-on-color, var(--text-soft));
  font-size: 14px;
  line-height: 1.62;
}
.project-description-content h3 { margin: 0 0 10px; color: var(--ui-on-color, var(--text)); font-size: 17px; letter-spacing: -.02em; }
.project-description-content p { margin: 0 0 10px; }
.project-description-content p:last-child { margin-bottom: 0; }
.project-description-content ul,
.project-description-content ol { margin: 8px 0 12px; padding-left: 21px; }
.project-description-content li + li { margin-top: 5px; }

.meter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.meter-item {
  display: grid;
  min-width: 0;
  min-height: 76px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .045);
}
.meter-label { color: var(--ui-on-color-muted, var(--muted)); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .045em; }
.meter-value { margin-top: 5px; overflow: hidden; color: var(--ui-on-color, var(--text)); font-size: 17px; font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }

.project-timer-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 84px;
  margin-bottom: 18px;
  padding: 14px 15px 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(8, 15, 27, .3);
}
.timer-display { min-width: 0; color: var(--ui-on-color, var(--text)); font-variant-numeric: tabular-nums; font-size: clamp(29px, 7vw, 42px); font-weight: 350; line-height: 1; letter-spacing: .015em; }
.timer-controls { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.timer-controls form { margin: 0; }
.timer-icon-btn {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .08);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--duration-fast), background var(--duration-fast), opacity var(--duration-fast);
}
.timer-icon-btn:hover { background: rgba(255, 255, 255, .13); }
.timer-icon-btn:active { transform: scale(.94); }
.timer-icon-btn img { width: 23px; height: 23px; filter: invert(1); }
.timer-icon-btn.play { border: 0; background: linear-gradient(135deg, var(--cyan), var(--cyan-2)); }
.timer-icon-btn.play img { filter: none; }
.timer-icon-btn.stop { border: 0; background: linear-gradient(135deg, var(--yellow), var(--yellow-2)); }
.timer-icon-btn.stop img { filter: none; }
.timer-icon-btn.muted { opacity: .38; cursor: not-allowed; box-shadow: none; }
.running-hint { max-width: 190px; color: var(--ui-on-color-muted, var(--muted)); font-size: 12px; font-weight: 800; line-height: 1.35; text-align: right; }

.detail-actions,
.employee-primary-actions,
.report-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.report-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
.detail-actions form,
.employee-primary-actions form,
.report-actions form { display: contents; margin: 0; }
.round-complete,
.small-add-action,
.calendar-export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid rgba(66, 203, 213, .45);
  border-radius: var(--radius-md);
  color: var(--cyan);
  background: rgba(66, 203, 213, .055);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast);
}
.round-complete:hover,
.small-add-action:hover,
.calendar-export-button:hover { border-color: rgba(66, 203, 213, .72); background: rgba(66, 203, 213, .11); }
.round-complete:active,
.small-add-action:active,
.calendar-export-button:active { transform: scale(.98); }
.round-complete img,
.small-add-action img,
.calendar-export-button img { width: 19px; height: 19px; flex: 0 0 auto; filter: invert(79%) sepia(46%) saturate(582%) hue-rotate(133deg) brightness(95%) contrast(92%); }
.round-complete:disabled,
.round-complete.is-disabled,
.is-disabled { opacity: .46; pointer-events: none; }
.project-edit-action.active,
.employee-edit-trigger.active { color: var(--dark-text); background: linear-gradient(135deg, var(--cyan), var(--cyan-2)); }
.project-edit-action.active img,
.employee-edit-trigger.active img { filter: none; }
.employee-secondary-actions { margin-top: 12px; }
.employee-delete,
.danger-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 117, 111, .42);
  border-radius: var(--radius-md);
  color: #ffaaa6;
  background: var(--danger-soft);
  font-weight: 900;
  cursor: pointer;
}
.employee-delete img,
.danger-action img { width: 19px; height: 19px; filter: invert(68%) sepia(54%) saturate(1885%) hue-rotate(316deg) brightness(103%) contrast(102%); }

/* Swipe actions */
.project-swipe-actions {
  position: absolute;
  inset: 0 0 auto auto;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 122px;
  height: var(--pill-height);
  padding-right: 8px;
}
.project-swipe-actions form { margin: 0; }
.swipe-action {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 17px;
  cursor: pointer;
}
.swipe-action img { width: 21px; height: 21px; }
.swipe-action.success { background: linear-gradient(135deg, var(--cyan), var(--cyan-2)); }
.swipe-action.danger { background: linear-gradient(135deg, var(--orange), var(--orange-2)); }
.project-wrap:not(.is-open) .project-pill { transition: transform var(--duration) var(--ease-standard), border-radius var(--duration), box-shadow var(--duration); }
.project-wrap.is-swiped:not(.is-open) .project-pill { transform: translateX(-118px); }

/* Forms */
.native-form,
.grid-form,
.edit-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.native-form .full,
.grid-form .full,
.edit-panel .full { grid-column: 1 / -1; }
.native-form label,
.grid-form label,
.edit-panel label,
.login-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 850;
}
.field-label { display: block; margin: 0; color: var(--text-soft); font-size: 13px; font-weight: 850; }
input,
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  margin: 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, .07);
  font-size: 16px;
  line-height: 1.25;
  transition: border-color var(--duration-fast), background var(--duration-fast), box-shadow var(--duration-fast);
}
textarea { min-height: 106px; resize: vertical; line-height: 1.5; }
input::placeholder,
textarea::placeholder { color: rgba(215, 222, 234, .48); }
input:hover,
select:hover,
textarea:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .085); }
input:focus,
select:focus,
textarea:focus { border-color: rgba(66, 203, 213, .78); background: rgba(255, 255, 255, .1); box-shadow: 0 0 0 4px rgba(66, 203, 213, .11); }
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) { border-color: rgba(255, 117, 111, .7); }
select { appearance: none; padding-right: 42px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 15px) 22px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
select option { color: var(--dark-text); background: #fff; }
.check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; min-height: var(--control-height); padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255, 255, 255, .045); color: var(--text) !important; }
.check input { appearance: none; width: 24px; height: 24px; min-height: 0; flex: 0 0 auto; padding: 0; border-radius: 8px; background: rgba(255, 255, 255, .08); }
.check input:checked { border-color: var(--cyan); background: var(--cyan) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2307111f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E") center/16px no-repeat; }

.primary,
.secondary,
.native-action,
.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: var(--control-height);
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-weight: 930;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--duration-fast), filter var(--duration-fast), opacity var(--duration-fast), box-shadow var(--duration-fast);
}
.primary { border: 0; color: var(--dark-text); background: linear-gradient(135deg, var(--cyan), var(--cyan-2)); box-shadow: var(--shadow-sm); }
.secondary { border: 1px solid var(--line); color: var(--text); background: rgba(255, 255, 255, .07); }
.primary:hover,
.secondary:hover { filter: brightness(1.04); }
.primary:active,
.secondary:active { transform: scale(.985); }
.primary img,
.secondary img { width: 20px; height: 20px; }
.primary:disabled,
.secondary:disabled,
button:disabled { opacity: .46; cursor: not-allowed; }
.native-action { width: 100%; }
.linkbtn { margin-top: 14px; }
.datev-after-months { margin-top: 18px; }

.edit-panel {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(8, 15, 27, .28);
}
.project-description-field { display: grid; gap: 9px; }
.description-toolbar { display: flex; flex-wrap: wrap; gap: 7px; }
.description-toolbar button {
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, .06);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.project-description-editor { min-height: 150px; }
.project-color-field,
.employee-color-field { display: grid; align-content: start; gap: 9px; }
.color-choice-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.color-choice { position: relative; display: block; cursor: pointer; }
.color-choice input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; pointer-events: none; }
.color-choice .color-swatch { display: block; height: 48px; overflow: hidden; border: 3px solid transparent; border-radius: 15px; background-clip: padding-box; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); transition: transform var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast); }
.color-choice input:checked + .color-swatch { border-color: #fff; transform: scale(.97); box-shadow: 0 0 0 3px rgba(66, 203, 213, .28); }
.color-choice.c-cyan .color-swatch { background: linear-gradient(135deg, var(--cyan), var(--cyan-2)); }
.color-choice.c-orange .color-swatch { background: linear-gradient(135deg, var(--orange), var(--orange-2)); }
.color-choice.c-yellow .color-swatch { background: linear-gradient(135deg, var(--yellow), var(--yellow-2)); }
.color-choice.c-purple .color-swatch { background: linear-gradient(135deg, var(--purple), var(--purple-2)); }

/* Rows and report content */
.native-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .045);
}
.native-row + .native-row { margin-top: 10px; }
.native-row > div { min-width: 0; }
.native-row > div:not(.report-row-actions) strong,
.native-row > div:not(.report-row-actions) span,
.native-row > div:not(.report-row-actions) small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.native-row > div:not(.report-row-actions) strong { color: var(--text); font-size: 15px; }
.native-row > div:not(.report-row-actions) span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.native-row > div:not(.report-row-actions) small { margin-top: 5px; color: rgba(168, 180, 199, .78); font-size: 12px; }
.native-row > .row-icon {
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: center;
  width: 42px;
  height: 42px;
  margin: 0;
  overflow: visible;
  border-radius: 15px;
  background: rgba(255, 255, 255, .08);
  white-space: normal;
}
.native-row > .row-icon img {
  display: block;
  width: 21px;
  height: 21px;
  margin: auto;
  object-fit: contain;
  object-position: center;
  filter: invert(1);
  opacity: .75;
}
.entry-list { display: grid; gap: 10px; }
.entry-row + .entry-row { margin-top: 0; }
.edit-entry {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
}
.edit-entry img { width: 19px; height: 19px; filter: invert(1); opacity: .78; }
.report-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
.report-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  background: rgba(255, 255, 255, .08);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}
.pill img { width: 15px; height: 15px; filter: invert(1); opacity: .78; }
.pill.ok { color: #aaf7fb; background: rgba(66, 203, 213, .14); }
.pill.warn { color: #ffd0bf; background: rgba(255, 146, 108, .14); }

/* Empty, loading and status states */
.empty-state {
  display: grid;
  place-items: center;
  min-height: 118px;
  margin: 0;
  padding: 24px 18px;
  border: 1px dashed rgba(255, 255, 255, .18);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: rgba(8, 15, 27, .18);
  font-size: 14px;
  font-weight: 780;
  line-height: 1.45;
  text-align: center;
}
.alert {
  padding: 13px 15px;
  border: 1px solid rgba(255, 117, 111, .42);
  border-radius: var(--radius-md);
  color: #ffd3d0;
  background: var(--danger-soft);
  font-weight: 800;
  line-height: 1.4;
}
.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading > * { visibility: hidden; }
.is-loading::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  color: var(--dark-text);
  animation: spin .7s linear infinite;
}
.secondary.is-loading::after,
.round-complete.is-loading::after { color: var(--text); }
.ui-skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: rgba(255, 255, 255, .075) !important;
}
.ui-skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .12), transparent); animation: shimmer 1.3s infinite; }
#globalProgress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  width: 100%;
  height: 3px;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transition: opacity var(--duration-fast), transform 500ms var(--ease-standard);
}
#globalProgress.is-active { opacity: 1; transform: scaleX(.78); }
#globalProgress.is-complete { opacity: 0; transform: scaleX(1); }

/* Calendar */
.calendar-panel { overflow: visible; }
.calendar-topbar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; margin-bottom: 14px; }
.calendar-topbar h2 { margin: 0; text-align: center; }
.calendar-nav {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
}
.calendar-filter { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; }
.filter-pill {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: rgba(255, 255, 255, .045);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.filter-pill.active[data-filter-absence="vacation"] { border-color: rgba(66, 203, 213, .62); color: #aaf7fb; background: rgba(66, 203, 213, .14); }
.filter-pill.active[data-filter-absence="sick"] { border-color: rgba(255, 146, 108, .62); color: #ffd0bf; background: rgba(255, 146, 108, .14); }
.calendar-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mini-calendar { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(8, 15, 27, .22); }
.mini-calendar h3 { margin: 0 0 13px; color: var(--text); font-size: 16px; font-weight: 900; text-align: center; letter-spacing: -.02em; }
.cal-weekdays,
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-weekdays { margin-bottom: 5px; }
.cal-weekdays span { color: var(--muted); font-size: 10px; font-weight: 850; text-align: center; }
.cal-day {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  min-width: 0;
  min-height: 47px;
  padding: 5px 2px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, .035);
  cursor: default;
}
button.cal-day[data-cal-items]:not([data-cal-items=""]) { border-color: rgba(255, 255, 255, .12); cursor: pointer; }
button.cal-day[data-cal-items]:not([data-cal-items=""]):hover { background: rgba(255, 255, 255, .08); }
.cal-day.empty { visibility: hidden; }
.cal-date { font-size: 11px; font-weight: 850; }
.cal-dot-wrap { align-self: end; display: grid; grid-template-columns: repeat(4, 5px); gap: 3px; min-height: 13px; margin-top: 4px; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; }
.cal-dot.vacation { background: var(--cyan); }
.cal-dot.sick { background: var(--orange); }
.cal-dot.is-hidden { display: none; }
.calendar-export-button { width: 100%; margin-top: 16px; }
.absence-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.calendar-day-list { display: grid; gap: 10px; }
.calendar-day-entry { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255, 255, 255, .055); }
.calendar-day-entry strong { color: var(--text); }
.calendar-day-entry span { color: var(--muted); font-size: 13px; line-height: 1.45; }

/* Modal, bottom sheet, toast and confirmations */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(18px, var(--safe-top)) max(14px, var(--safe-right)) max(18px, var(--safe-bottom)) max(14px, var(--safe-left));
  overflow-y: auto;
  background: rgba(5, 9, 16, .76);
  backdrop-filter: blur(12px);
  overscroll-behavior: contain;
}
.modal-backdrop.open { display: flex; animation: backdrop-in var(--duration-fast) ease both; }
.sheet-modal,
.timer-modal {
  width: min(100%, 620px);
  max-height: calc(100dvh - 36px - var(--safe-top) - var(--safe-bottom));
  padding: 22px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at 50% 0%, rgba(66, 203, 213, .11), transparent 36%), linear-gradient(145deg, rgba(38, 50, 71, .99), rgba(15, 24, 38, .99));
  box-shadow: var(--shadow-lg);
  animation: modal-in var(--duration) var(--ease-standard) both;
}
.sheet-modal > header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.sheet-modal > header h2 { margin: 0; color: var(--text); font-size: 23px; letter-spacing: -.035em; }
.sheet-modal > header button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  font-size: 25px;
  cursor: pointer;
}
.timer-modal { width: min(100%, 500px); text-align: center; }
.timer-modal .modal-icon { display: grid; place-items: center; width: 70px; height: 70px; margin: 0 auto 16px; border-radius: 24px; background: rgba(255, 223, 145, .16); }
.timer-modal .modal-icon img { width: 32px; height: 32px; filter: invert(88%) sepia(45%) saturate(420%) hue-rotate(342deg) brightness(105%) contrast(102%); }
.timer-modal h2 { margin: 0 0 8px; font-size: 25px; letter-spacing: -.035em; }
.timer-modal p { margin: 0 0 16px; color: var(--muted); }
.timer-modal textarea { margin-bottom: 14px; }
.modal-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.modal-actions > button { min-height: var(--control-height); border-radius: var(--radius-md); font-weight: 900; }
.confirm-copy { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--text-soft); background: rgba(8, 15, 27, .25); line-height: 1.5; }
.confirm-copy p { margin: 0; }
.tibu-notice-sheet { display: grid; gap: 16px; }
.tibu-notice-message { margin: 0; color: var(--text-soft); line-height: 1.55; }
.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 18px);
  z-index: 130;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--text);
  background: rgba(15, 24, 38, .96);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 850;
  opacity: 0;
  transform: translate(-50%, 12px) scale(.98);
  transition: opacity var(--duration), transform var(--duration) var(--ease-standard);
  pointer-events: none;
}
.app-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.app-toast.is-error { border-color: rgba(255, 117, 111, .5); }

/* Navigation */
.bottom-nav {
  position: fixed;
  inset: auto 0 0;
  z-index: 60;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding: 8px max(8px, var(--safe-right)) calc(8px + var(--safe-bottom)) max(8px, var(--safe-left));
  border-top: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  background: rgba(15, 24, 38, .96);
  box-shadow: 0 -14px 44px rgba(0, 0, 0, .32);
  backdrop-filter: blur(22px);
}
.bottom-nav-inner {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(58px, 1fr);
  gap: 3px;
  width: min(100%, var(--content-width));
  height: 100%;
  margin: 0 auto;
}
.nav-item {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 7px 4px;
  border: 0;
  border-radius: 17px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.nav-item img { width: 21px; height: 21px; filter: invert(1); opacity: .55; }
.nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.active { color: var(--cyan); background: rgba(66, 203, 213, .12); }
.nav-item.active img { filter: invert(79%) sepia(46%) saturate(582%) hue-rotate(133deg) brightness(95%) contrast(92%); opacity: 1; }
.desktop-logout { display: none; }

/* Login */
.login-screen {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 40px);
  width: 100%;
  padding: 24px;
}
.login-panel,
.login-panel-brand { display: grid; gap: 22px; width: min(100%, 420px); }
.login-logo { width: min(245px, 74%); margin: 0 auto 20px; }
.login-form { display: grid; gap: 18px; }
.login-form input { color: var(--dark-text); background: rgba(246, 249, 252, .96); border-color: rgba(255, 255, 255, .22); }
.login-form input::placeholder { color: rgba(7, 17, 31, .45); }
.login-form input:focus { background: #fff; }
.login-btn { width: 100%; min-height: 58px; border: 0; color: var(--dark-text); background: linear-gradient(135deg, var(--cyan), var(--cyan-2)); box-shadow: var(--shadow-md); }

/* Shadow hosts must never clip component elevation. */
.screen,
.app-views,
.view,
.native-panel,
.pill-list,
.project-list,
.team-list,
.month-report-list { overflow: visible; }
.native-panel,
.project-wrap,
.team-wrap,
.month-report-wrap,
.project-pill,
.team-pill,
.month-report-pill { isolation: isolate; }

/* Motion */
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes detail-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Desktop app shell */
@media (min-width: 1040px) {
  .screen {
    padding: 14px 32px 42px calc(var(--sidebar-width) + 32px);
  }
  .native-header { top: 0; margin-bottom: 16px; background: transparent; box-shadow: none; backdrop-filter: none; }
  .native-header > .icon-link:first-child { visibility: hidden; }
  .bottom-nav {
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    height: auto;
    padding: 24px 16px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: rgba(14, 22, 35, .94);
    box-shadow: 16px 0 50px rgba(0, 0, 0, .18);
  }
  .bottom-nav-inner {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
    height: 100%;
  }
  .bottom-nav-inner::before {
    content: "";
    display: block;
    width: 132px;
    height: 50px;
    margin: 2px 10px 28px;
    background: url('/public/assets/brand/tibu-logo.png') left center / contain no-repeat;
  }
  .nav-item {
    grid-template-columns: 25px minmax(0, 1fr);
    place-items: center start;
    align-content: center;
    gap: 12px;
    min-height: 52px;
    padding: 10px 13px;
    font-size: 14px;
    text-align: left;
  }
  .nav-item img { width: 22px; height: 22px; }
  .desktop-logout { display: grid; margin-top: auto; }
  .app-toast { bottom: 28px; }
  .dashboard-insights { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .next-todo-card { grid-column: 1 / -1; }
  .insight-card { min-height: 154px; }
}

/* Tablet and mobile */
@media (max-width: 720px) {
  :root { --panel-padding: 18px; --content-gap: 12px; }
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mini-stat { min-height: 94px; }
  .dashboard-insights { gap: 10px; }
  .calendar-stack { grid-template-columns: 1fr; }
  .report-row { grid-template-columns: 42px minmax(0, 1fr); }
  .report-row-actions { grid-column: 1 / -1; justify-content: stretch; }
  .report-row-actions .pill { flex: 1; }
}

@media (max-width: 520px) {
  :root {
    --header-height: 58px;
    --bottom-nav-height: 78px;
    --pill-height: 76px;
    --panel-padding: 16px;
    --control-height: 50px;
  }
  .screen { padding-inline: max(12px, var(--safe-left)); padding-right: max(12px, var(--safe-right)); }
  .native-header { margin-bottom: 8px; }
  .native-panel { border-radius: 26px; }
  .native-panel h2 { font-size: 23px; }
  .segment-pills { width: 100%; }
  .segment { min-height: 40px; padding-inline: 10px; font-size: 13px; }
  .dashboard-insights { grid-template-columns: 1fr 1fr; }
  .insight-card { min-height: 128px; padding: 16px; }
  .insight-card strong { font-size: 25px; }
  .next-todo-card { min-height: 84px; padding: 15px; }
  .project-pill,
  .team-pill,
  .month-report-pill { grid-template-columns: 48px minmax(0, 1fr) 21px; gap: 12px; padding: 11px 16px 11px 11px; }
  .project-icon { width: 48px; height: 48px; border-radius: 16px; }
  .project-icon img { width: 24px; height: 24px; }
  .project-title { font-size: 16px; }
  .project-sub { font-size: 12px; }
  .project-detail,
  .team-detail,
  .month-report-detail { padding: 15px; border-radius: 16px 26px 26px 26px; }
  .meter { gap: 7px; }
  .meter-item { min-height: 70px; padding: 9px; }
  .meter-label { font-size: 9px; }
  .meter-value { font-size: 14px; }
  .project-timer-box { gap: 10px; min-height: 76px; padding: 11px 11px 11px 14px; }
  .timer-display { font-size: clamp(27px, 9vw, 36px); }
  .timer-icon-btn { width: 50px; height: 50px; border-radius: 16px; }
  .detail-actions,
  .employee-primary-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .round-complete { min-height: 52px; padding: 9px 7px; font-size: 11px; flex-direction: column; gap: 4px; }
  .round-complete img { width: 18px; height: 18px; }
  .native-form,
  .grid-form,
  .edit-panel { grid-template-columns: 1fr; }
  .native-form .full,
  .grid-form .full,
  .edit-panel .full { grid-column: auto; }
  .project-description-field.full,
  .project-color-field.full { grid-column: auto; }
  .color-choice-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .color-choice .color-swatch { height: 44px; }
  .entry-row { grid-template-columns: 42px minmax(0, 1fr) 42px; padding: 11px; }
  .calendar-panel { padding-inline: 12px; }
  .mini-calendar { padding: 12px 9px; }
  .cal-weekdays,
  .cal-grid { gap: 3px; }
  .cal-day { min-height: 46px; border-radius: 10px; }
  .absence-buttons { grid-template-columns: 1fr; }
  .modal-backdrop.open { align-items: flex-end; padding-inline: 0; padding-bottom: 0; }
  .sheet-modal,
  .timer-modal { width: 100%; max-height: calc(100dvh - var(--safe-top) - 12px); border-radius: 28px 28px 0 0; padding: 20px 16px calc(20px + var(--safe-bottom)); }
  .timer-modal { text-align: center; }
  .app-toast { bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 12px); }
  .login-screen { padding: 20px; }
  .login-logo { margin-bottom: 14px; }
}

@media (max-width: 390px) {
  .stats-strip { gap: 8px; }
  .mini-stat { min-height: 88px; padding: 12px; }
  .mini-stat span { font-size: 20px; }
  .dashboard-insights { grid-template-columns: 1fr; }
  .next-todo-card { grid-column: auto; }
  .project-timer-box { grid-template-columns: 1fr; }
  .timer-controls { justify-content: center; }
  .running-hint { max-width: none; text-align: center; }
  .detail-actions,
  .employee-primary-actions { grid-template-columns: 1fr 1fr 1fr; }
  .nav-item { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Component completion rules */
.confirm-sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.confirm-sheet .full { grid-column: 1 / -1; }
.calendar-day-sheet,
.tibu-notice-sheet { display: grid; gap: 16px; }
.timer-modal .modal-actions button:not(.save) {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, .07);
}
.timer-modal .modal-actions .save {
  border: 0;
  color: var(--dark-text);
  background: linear-gradient(135deg, var(--yellow), var(--yellow-2));
  box-shadow: var(--shadow-sm);
}
[aria-invalid="true"] {
  border-color: rgba(255, 117, 111, .82) !important;
  box-shadow: 0 0 0 4px rgba(255, 117, 111, .12) !important;
}

@media (max-width: 520px) {
  .confirm-sheet { grid-template-columns: 1fr; }
  .confirm-sheet .full { grid-column: auto; }
}

/* UI-Kit 1.1 hard guards: these rules intentionally sit last. */
.ui-color-surface .project-detail,
.ui-color-surface .team-detail {
  border-color: var(--ui-on-color-line);
  color: var(--ui-on-color);
  background: var(--ui-on-color-panel);
}
.ui-color-surface .project-description-content,
.ui-color-surface .meter-item,
.ui-color-surface .project-timer-box {
  border-color: var(--ui-on-color-line);
  background: var(--ui-on-color-overlay);
}
.ui-color-surface .project-icon img,
.ui-color-surface .chevron {
  filter: var(--ui-on-color-icon-filter) !important;
  opacity: .84;
}
.ui-color-surface .round-complete {
  border-color: var(--ui-on-color-line);
  color: var(--ui-on-color);
  background: var(--ui-on-color-overlay);
}
.ui-color-surface .round-complete:hover {
  border-color: var(--ui-on-color);
  color: var(--ui-on-color);
  background: var(--ui-on-color-panel);
}
.ui-color-surface .round-complete img {
  filter: var(--ui-on-color-icon-filter) !important;
}
.ui-color-surface .round-complete:disabled,
.ui-color-surface .round-complete.is-disabled {
  color: var(--ui-on-color) !important;
  opacity: .62;
}
.ui-color-surface .employee-delete {
  border-color: rgba(255, 117, 111, .52);
  color: var(--ui-on-color);
  background: rgba(255, 117, 111, .13);
}
.ui-color-surface.ui-on-dark .employee-delete img { filter: brightness(0) saturate(100%) !important; opacity: .82; }
.ui-color-surface.ui-on-light .employee-delete img { filter: invert(68%) sepia(54%) saturate(1885%) hue-rotate(316deg) brightness(103%) contrast(102%) !important; opacity: 1; }
.color-choice.ui-color-swatch { background: transparent !important; border-radius: 0 !important; }
.color-choice.ui-color-swatch .color-swatch { overflow: hidden; border-radius: 15px; background-clip: padding-box; }

/* UI-Kit 1.2: verbindlicher Zeitreport-Lifecycle */
.report-title-row {
  align-items: flex-start;
  gap: 18px;
}
.report-title-row > div:first-child { min-width: 0; }
.section-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.report-period-nav {
  display: grid;
  grid-template-columns: 44px minmax(100px, auto) 44px;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 14px auto 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,.045);
  box-shadow: var(--shadow-sm);
}
.report-period-nav a,
.report-period-nav strong {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
}
.report-period-nav a {
  font-size: 26px;
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.report-period-nav a:hover { background: rgba(255,255,255,.08); color: var(--cyan); }
.report-period-nav strong { padding: 0 14px; border-inline: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
.report-period-nav.compact { margin: 0; grid-template-columns: 38px minmax(160px,auto) 38px; }
.report-period-nav.compact a,
.report-period-nav.compact strong { min-height: 40px; }
.report-lifecycle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  font-size: 13px;
}
.report-lifecycle-line > span:last-child { color: inherit; opacity: .76; }
.report-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.report-status.is-open { color: #ffd7c9; background: rgba(255,146,108,.16); border-color: rgba(255,146,108,.26); }
.report-status.is-submitted { color: #9ff4fb; background: rgba(66,203,213,.14); border-color: rgba(66,203,213,.28); }
.report-status.is-change-requested { color: #ffe49a; background: rgba(255,212,115,.15); border-color: rgba(255,212,115,.3); }
.report-status.is-correction-open { color: #cbb8ff; background: rgba(134,84,255,.17); border-color: rgba(134,84,255,.32); }
.report-status.is-changes-pending { color: #ffe49a; background: rgba(255,212,115,.15); border-color: rgba(255,212,115,.3); }
.report-status.is-approved { color: #baf5d0; background: rgba(76,216,138,.14); border-color: rgba(76,216,138,.28); }
.report-reason,
.report-state-note,
.report-correction-intro {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7,16,29,.18);
  color: inherit;
  font-size: 13px;
  line-height: 1.5;
}
.report-state-note { border-color: rgba(255,212,115,.32); background: rgba(255,212,115,.1); }
.report-row-lifecycle { align-items: center; }
.report-row-lifecycle .report-person small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.35; }
.report-row-actions form { display: inline-flex; margin: 0; }
.report-row-actions .report-status { margin-right: 2px; }
.report-correction-button { cursor: pointer; }
.report-correction-form textarea { min-height: 120px; resize: vertical; }
.month-report-detail .report-actions { flex-wrap: wrap; }
.month-report-detail .report-actions > form,
.month-report-detail .report-actions > a,
.month-report-detail .report-actions > button { flex: 1 1 210px; }
.ui-color-surface .report-lifecycle-line,
.ui-color-surface .report-reason,
.ui-color-surface .report-state-note { color: var(--ui-on-color); }
.ui-color-surface .report-reason { border-color: var(--ui-on-color-line); background: var(--ui-on-color-overlay); }
.ui-color-surface .report-lifecycle-line > span:last-child { color: var(--ui-on-color); }

@media (max-width: 760px) {
  .report-title-row { display: grid; grid-template-columns: 1fr; }
  .report-title-row .small-add-action { width: 100%; justify-content: center; }
  .report-period-nav.compact { width: 100%; grid-template-columns: 42px minmax(0,1fr) 42px; }
  .report-row-lifecycle { grid-template-columns: 42px minmax(0,1fr); }
  .report-row-lifecycle .report-row-actions { grid-column: 1 / -1; width: 100%; justify-content: flex-start; padding-left: 0; }
  .report-row-actions .pill,
  .report-row-actions form { flex: 1 1 130px; }
  .report-row-actions form .pill { width: 100%; justify-content: center; }
}

@media (max-width: 520px) {
  .report-period-nav { width: 100%; grid-template-columns: 42px minmax(0,1fr) 42px; }
  .report-period-nav strong { padding-inline: 8px; }
  .month-report-detail .report-actions > form,
  .month-report-detail .report-actions > a,
  .month-report-detail .report-actions > button { flex-basis: 100%; width: 100%; }
}
.ui-color-surface .report-status {
  color: var(--ui-on-color) !important;
  border-color: var(--ui-on-color-line) !important;
  background: var(--ui-on-color-overlay) !important;
}
.report-version-history {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7,16,29,.14);
  overflow: hidden;
}
.report-version-history summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.report-version-history summary::-webkit-details-marker { display: none; }
.report-version-history summary::after {
  content: '›';
  margin-left: auto;
  font-size: 20px;
  transform: rotate(90deg);
  transition: transform var(--duration-fast) var(--ease-standard);
}
.report-version-history[open] summary::after { transform: rotate(-90deg); }
.report-version-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 12px;
}
.report-version-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: inherit;
  background: rgba(255,255,255,.045);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}
.report-version-links a:hover { border-color: var(--cyan); }
.report-version-history.compact {
  width: fit-content;
  max-width: 100%;
  margin: 7px 0 0;
  border-radius: 10px;
}
.report-version-history.compact summary { min-height: 32px; padding: 5px 9px; font-size: 11px; }
.report-version-history.compact .report-version-links { padding: 0 8px 8px; gap: 5px; }
.report-version-history.compact .report-version-links a { min-height: 28px; padding: 4px 8px; border-radius: 8px; font-size: 11px; }
.ui-color-surface .report-version-history {
  border-color: var(--ui-on-color-line);
  background: var(--ui-on-color-overlay);
  color: var(--ui-on-color);
}
.ui-color-surface .report-version-links a {
  border-color: var(--ui-on-color-line);
  color: var(--ui-on-color);
  background: var(--ui-on-color-overlay);
}

/* UI-Kit 1.2.2: compact, overflow-safe date/time fields in all time-entry dialogs. */
.native-form input[type="date"],
.native-form input[type="time"],
.timer-stop-form input[type="date"],
.timer-stop-form input[type="time"] {
  display: block;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.timer-stop-form { text-align: left; }
.timer-stop-form .modal-actions { margin-top: 2px; }
@media (max-width: 520px) {
  .sheet-modal.native-form,
  .timer-stop-form { min-width: 0; overflow-x: hidden; }
  .sheet-modal.native-form > label,
  .timer-stop-form > label { min-width: 0; max-width: 100%; overflow: hidden; }
  .timer-stop-form .modal-actions { grid-template-columns: 1fr; }
}



/* UI-Kit 1.2.2: verbindliches kompaktes Zeitraster. */
.time-entry-form,
.timer-stop-form {
  container-type: inline-size;
}
.time-entry-date,
.time-field-pair,
.time-field-pair > label {
  min-width: 0;
  max-width: 100%;
}
.time-field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.time-field-pair > label {
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: visible;
}
.time-entry-form input[type="date"],
.time-entry-form input[type="time"],
.timer-stop-form input[type="date"],
.timer-stop-form input[type="time"] {
  box-sizing: border-box;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-height: 48px;
  height: 48px;
  padding-block: 8px;
  padding-inline: 12px;
  overflow: hidden;
}
.time-entry-form input[type="date"]::-webkit-date-and-time-value,
.time-entry-form input[type="time"]::-webkit-date-and-time-value,
.timer-stop-form input[type="date"]::-webkit-date-and-time-value,
.timer-stop-form input[type="time"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}
.time-entry-form input[type="date"]::-webkit-calendar-picker-indicator,
.time-entry-form input[type="time"]::-webkit-calendar-picker-indicator,
.timer-stop-form input[type="date"]::-webkit-calendar-picker-indicator,
.timer-stop-form input[type="time"]::-webkit-calendar-picker-indicator {
  flex: 0 0 auto;
  margin-inline-start: 6px;
}
@container (max-width: 340px) {
  .time-field-pair { gap: 8px; }
  .time-entry-form input[type="time"],
  .timer-stop-form input[type="time"] { padding-inline: 9px; }
}

/* UI-Kit 1.2.5: iOS-sichere, exakt ausgerichtete Zeitfelder. */
.time-entry-form .time-field-pair,
.timer-stop-form .time-field-pair {
  width: 100%;
  max-width: 100%;
  grid-template-columns: minmax(0, calc((100% - 12px) / 2)) minmax(0, calc((100% - 12px) / 2));
  align-items: start;
  overflow: hidden;
}
.time-entry-form .time-field-pair > label,
.timer-stop-form .time-field-pair > label {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.time-entry-form input[type="date"],
.time-entry-form input[type="time"],
.timer-stop-form input[type="date"],
.timer-stop-form input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  flex: 0 1 auto;
}
@media (max-width: 390px) {
  .time-entry-form .time-field-pair,
  .timer-stop-form .time-field-pair {
    gap: 8px;
    grid-template-columns: minmax(0, calc((100% - 8px) / 2)) minmax(0, calc((100% - 8px) / 2));
  }
  .time-entry-form input[type="time"],
  .timer-stop-form input[type="time"] {
    padding-inline: 10px;
  }
}
