:root {
  --bg-page: #eef3ef;
  --bg-soft: #f7faf8;
  --surface: #ffffff;
  --surface-border: #d9e4dd;
  --surface-overlay: rgba(255, 255, 255, 0.9);
  --surface-border-strong: rgba(43, 97, 94, 0.16);
  --text-main: #12303b;
  --text-muted: #557078;
  --accent-sea: #1f8a83;
  --accent-sand: #c08c42;
  --accent-ember: #c95b3d;
  --accent-slate: #4a6777;
  --header-bg: rgba(248, 251, 249, 0.84);
  --header-border: rgba(39, 90, 87, 0.12);
  --nav-pill-bg: rgba(255, 255, 255, 0.86);
  --nav-pill-text: #34545f;
  --nav-pill-hover-border: rgba(31, 138, 131, 0.25);
  --nav-pill-hover-text: #134a56;
  --badge-bg: rgba(31, 138, 131, 0.08);
  --badge-border: rgba(25, 94, 96, 0.28);
  --badge-text: #16505a;
  --user-badge-bg: rgba(67, 120, 125, 0.08);
  --user-badge-border: rgba(25, 94, 96, 0.22);
  --user-badge-text: #1f5058;
  --outline-bg: rgba(245, 250, 248, 0.86);
  --outline-border: rgba(35, 93, 94, 0.3);
  --outline-text: #19515f;
  --outline-hover-bg: #eff8f4;
  --outline-hover-border: rgba(18, 77, 84, 0.45);
  --outline-hover-text: #113843;
  --modal-bg: rgba(255, 255, 255, 0.96);
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-soft: 0 10px 26px rgba(22, 66, 61, 0.08);
  --shadow-strong: 0 16px 36px rgba(20, 61, 68, 0.18);
}

:root[data-theme="sand"] {
  --bg-page: #f5efe4;
  --bg-soft: #fbf7ef;
  --surface: #fffaf2;
  --surface-border: #e6d9be;
  --surface-overlay: rgba(255, 250, 242, 0.92);
  --surface-border-strong: rgba(128, 94, 58, 0.19);
  --text-main: #3f3224;
  --text-muted: #7d6752;
  --accent-sea: #b1722f;
  --accent-sand: #d0974e;
  --accent-ember: #b8573a;
  --accent-slate: #6f5b48;
  --header-bg: rgba(255, 247, 235, 0.9);
  --header-border: rgba(134, 103, 64, 0.2);
  --nav-pill-bg: rgba(255, 248, 238, 0.92);
  --nav-pill-text: #6b4e2f;
  --nav-pill-hover-border: rgba(181, 114, 47, 0.35);
  --nav-pill-hover-text: #5d3f1f;
  --badge-bg: rgba(208, 151, 78, 0.18);
  --badge-border: rgba(154, 105, 49, 0.26);
  --badge-text: #6f4f2a;
  --user-badge-bg: rgba(127, 93, 55, 0.15);
  --user-badge-border: rgba(127, 93, 55, 0.24);
  --user-badge-text: #5f4526;
  --outline-bg: rgba(255, 250, 241, 0.95);
  --outline-border: rgba(154, 105, 49, 0.3);
  --outline-text: #6a4a25;
  --outline-hover-bg: rgba(255, 243, 228, 0.98);
  --outline-hover-border: rgba(137, 87, 34, 0.44);
  --outline-hover-text: #573b1d;
  --modal-bg: rgba(255, 250, 244, 0.97);
  --shadow-soft: 0 12px 24px rgba(95, 74, 52, 0.12);
  --shadow-strong: 0 16px 36px rgba(90, 68, 47, 0.2);
}

:root[data-theme="forest"] {
  --bg-page: #e8f2ec;
  --bg-soft: #f1f8f4;
  --surface: #f9fffb;
  --surface-border: #cae1d3;
  --surface-overlay: rgba(249, 255, 251, 0.92);
  --surface-border-strong: rgba(42, 105, 74, 0.18);
  --text-main: #1f3c31;
  --text-muted: #4d7262;
  --accent-sea: #2f8f63;
  --accent-sand: #799c4a;
  --accent-ember: #bf5e42;
  --accent-slate: #3f6f5d;
  --header-bg: rgba(241, 249, 244, 0.9);
  --header-border: rgba(53, 112, 82, 0.18);
  --nav-pill-bg: rgba(245, 253, 247, 0.94);
  --nav-pill-text: #2b5a49;
  --nav-pill-hover-border: rgba(47, 143, 99, 0.34);
  --nav-pill-hover-text: #1e4b3a;
  --badge-bg: rgba(47, 143, 99, 0.15);
  --badge-border: rgba(44, 116, 83, 0.28);
  --badge-text: #2b5f4b;
  --user-badge-bg: rgba(55, 111, 88, 0.14);
  --user-badge-border: rgba(55, 111, 88, 0.24);
  --user-badge-text: #24533f;
  --outline-bg: rgba(243, 252, 246, 0.95);
  --outline-border: rgba(44, 116, 83, 0.3);
  --outline-text: #275b46;
  --outline-hover-bg: rgba(236, 249, 240, 0.98);
  --outline-hover-border: rgba(37, 98, 70, 0.42);
  --outline-hover-text: #1b4736;
  --modal-bg: rgba(247, 255, 250, 0.97);
  --shadow-soft: 0 10px 24px rgba(32, 90, 62, 0.12);
  --shadow-strong: 0 16px 36px rgba(27, 84, 58, 0.2);
}

:root[data-theme="dark"] {
  --bg-page: #141a1f;
  --bg-soft: #1b252d;
  --surface: #1e2a33;
  --surface-border: #334654;
  --surface-overlay: rgba(30, 42, 51, 0.92);
  --surface-border-strong: rgba(86, 117, 136, 0.34);
  --text-main: #e5edf2;
  --text-muted: #a3bccb;
  --accent-sea: #3db7a8;
  --accent-sand: #d7b269;
  --accent-ember: #d97558;
  --accent-slate: #3f77a3;
  --header-bg: rgba(20, 30, 37, 0.9);
  --header-border: rgba(97, 130, 149, 0.25);
  --nav-pill-bg: rgba(31, 45, 55, 0.94);
  --nav-pill-text: #d3e2eb;
  --nav-pill-hover-border: rgba(81, 170, 160, 0.44);
  --nav-pill-hover-text: #ffffff;
  --badge-bg: rgba(61, 183, 168, 0.16);
  --badge-border: rgba(75, 173, 162, 0.35);
  --badge-text: #b8f2eb;
  --user-badge-bg: rgba(71, 119, 163, 0.2);
  --user-badge-border: rgba(90, 140, 186, 0.36);
  --user-badge-text: #d0e4f8;
  --outline-bg: rgba(33, 49, 60, 0.95);
  --outline-border: rgba(93, 126, 147, 0.38);
  --outline-text: #d5e7f2;
  --outline-hover-bg: rgba(39, 57, 70, 0.98);
  --outline-hover-border: rgba(111, 151, 176, 0.46);
  --outline-hover-text: #ffffff;
  --modal-bg: rgba(26, 37, 46, 0.97);
  --shadow-soft: 0 14px 28px rgba(0, 0, 0, 0.35);
  --shadow-strong: 0 18px 40px rgba(0, 0, 0, 0.5);
}

:root[data-theme="vivid"] {
  --bg-page: #fff5f2;
  --bg-soft: #fff9f8;
  --surface: #ffffff;
  --surface-border: #ffd6c9;
  --surface-overlay: rgba(255, 255, 255, 0.94);
  --surface-border-strong: rgba(235, 128, 98, 0.22);
  --text-main: #3a2030;
  --text-muted: #7f4e66;
  --accent-sea: #ff6f61;
  --accent-sand: #ffc857;
  --accent-ember: #ff3d6e;
  --accent-slate: #6f5ef6;
  --header-bg: rgba(255, 244, 241, 0.92);
  --header-border: rgba(238, 136, 109, 0.22);
  --nav-pill-bg: rgba(255, 255, 255, 0.9);
  --nav-pill-text: #65314a;
  --nav-pill-hover-border: rgba(255, 111, 97, 0.34);
  --nav-pill-hover-text: #462034;
  --badge-bg: rgba(255, 61, 110, 0.11);
  --badge-border: rgba(255, 61, 110, 0.28);
  --badge-text: #9f2148;
  --user-badge-bg: rgba(111, 94, 246, 0.1);
  --user-badge-border: rgba(111, 94, 246, 0.24);
  --user-badge-text: #4637c9;
  --outline-bg: rgba(255, 255, 255, 0.96);
  --outline-border: rgba(232, 132, 106, 0.34);
  --outline-text: #763a55;
  --outline-hover-bg: rgba(255, 243, 237, 0.98);
  --outline-hover-border: rgba(215, 84, 48, 0.44);
  --outline-hover-text: #57253d;
  --modal-bg: rgba(255, 249, 246, 0.98);
  --shadow-soft: 0 10px 26px rgba(206, 88, 62, 0.17);
  --shadow-strong: 0 18px 40px rgba(156, 59, 98, 0.27);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(60rem 30rem at -10% -10%, rgba(31, 138, 131, 0.16), transparent),
    radial-gradient(50rem 26rem at 110% 8%, rgba(192, 140, 66, 0.14), transparent),
    var(--bg-page);
}

html[data-theme="sand"] body {
  background:
    radial-gradient(60rem 30rem at -10% -10%, rgba(176, 114, 47, 0.18), transparent),
    radial-gradient(50rem 26rem at 110% 8%, rgba(208, 151, 78, 0.18), transparent),
    var(--bg-page);
}

html[data-theme="forest"] body {
  background:
    radial-gradient(60rem 30rem at -10% -10%, rgba(47, 143, 99, 0.2), transparent),
    radial-gradient(50rem 26rem at 110% 8%, rgba(121, 156, 74, 0.18), transparent),
    var(--bg-page);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(56rem 28rem at -8% -8%, rgba(61, 183, 168, 0.2), transparent),
    radial-gradient(52rem 30rem at 110% 5%, rgba(63, 119, 163, 0.22), transparent),
    var(--bg-page);
}

html[data-theme="vivid"] body {
  background:
    radial-gradient(56rem 26rem at -8% -8%, rgba(255, 61, 110, 0.18), transparent),
    radial-gradient(50rem 26rem at 110% 4%, rgba(111, 94, 246, 0.2), transparent),
    var(--bg-page);
}

h1,
h2,
h3,
.brand-copy strong {
  font-family: "Sora", sans-serif;
  letter-spacing: -0.02em;
}

.top-shell {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: inherit;
}

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 0.8rem;
  color: #fff;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-sea), var(--accent-slate) 70%);
  box-shadow: 0 8px 20px rgba(26, 95, 103, 0.28);
}

.brand-copy {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy small {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.header-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.global-search {
  position: relative;
  min-width: min(420px, 68vw);
}

.global-search__input {
  min-width: min(420px, 68vw);
}

.global-search__results {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  width: min(560px, 86vw);
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--line-color);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  z-index: 70;
}

.global-search__item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.62rem 0.74rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line-color);
}

.global-search__item:last-child {
  border-bottom: 0;
}

.global-search__item:hover {
  background: var(--outline-hover-bg);
}

.global-search__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.global-search__title {
  line-height: 1.25;
}

.global-search__subtitle,
.global-search__empty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.global-search__empty {
  padding: 0.62rem 0.74rem;
}

.notif-center {
  position: relative;
}

.notif-center__toggle {
  position: relative;
}

.notif-center__badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  padding: 0 0.2rem;
  font-size: 0.68rem;
  line-height: 1.05rem;
  text-align: center;
  background: #c95b3d;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.notif-center__panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: auto;
  width: min(420px, calc(100vw - 24px));
  max-height: min(68vh, 520px);
  border: 1px solid var(--line-color);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  z-index: 75;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notif-center__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.62rem 0.74rem;
  border-bottom: 1px solid var(--line-color);
}

.notif-center__list {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.notif-center__item {
  display: block;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line-color);
  padding: 0.62rem 0.74rem;
  line-height: 1.2;
}

.notif-center__item:last-child {
  border-bottom: 0;
}

.notif-center__item:hover {
  background: var(--outline-hover-bg);
}

.notif-center__item.is-unread {
  border-left: 3px solid var(--accent-sea);
  padding-left: calc(0.74rem - 3px);
}

.notif-center__title {
  display: block;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.notif-center__text {
  display: block;
  margin-bottom: 0.2rem;
}

.notif-center__meta {
  display: block;
}

.notif-center__text,
.notif-center__meta,
.notif-center__empty {
  color: var(--text-muted);
  font-size: 0.83rem;
}

.notif-center__empty {
  padding: 0.65rem 0.74rem;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--badge-border);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.78rem;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--user-badge-border);
  border-radius: 999px;
  padding: 0.18rem 0.58rem;
  background: var(--user-badge-bg);
  color: var(--user-badge-text);
  font-size: 0.78rem;
  font-weight: 600;
}

.header-logout {
  padding: 0.15rem 0.62rem;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.main-nav__link {
  color: var(--nav-pill-text);
  text-decoration: none;
  border: 1px solid transparent;
  background: var(--nav-pill-bg);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 180ms ease;
}

.main-nav__link:hover {
  transform: translateY(-1px);
  border-color: var(--nav-pill-hover-border);
  color: var(--nav-pill-hover-text);
}

.main-nav__link.is-active {
  background: linear-gradient(135deg, var(--accent-sea), var(--accent-slate));
  color: #fff;
  box-shadow: 0 8px 18px rgba(24, 87, 96, 0.25);
}

.hero-panel,
.surface-card,
.kpi-card {
  animation: riseIn 420ms ease both;
}

.hero-panel {
  border-radius: var(--radius-lg);
  padding: clamp(1.1rem, 2vw, 1.6rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: #e9f4f3;
  background:
    linear-gradient(130deg, var(--accent-slate), var(--accent-sea)),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.08), transparent 60%);
  box-shadow: var(--shadow-strong);
}

.hero-panel h1 {
  margin: 0;
  font-size: clamp(1.3rem, 2.1vw, 1.8rem);
}

.hero-panel .lead {
  font-size: 1rem;
  color: rgba(232, 244, 241, 0.9);
  max-width: 56ch;
}

.calendar-filter-bar {
  min-width: min(480px, 92vw);
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.calendar-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  max-height: 132px;
  overflow: auto;
}

.calendar-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0.18rem 0.58rem;
  color: #eaf4f3;
  font-size: 0.82rem;
  line-height: 1.1;
  white-space: nowrap;
}

.calendar-filter-chip input {
  margin: 0;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: rgba(232, 244, 241, 0.84);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 0.73rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.kpi-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.kpi-card {
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.05rem;
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  opacity: 0.85;
}

.kpi-card[data-accent="sea"]::after {
  background: linear-gradient(90deg, var(--accent-sea), #4db9a8);
}

.kpi-card[data-accent="sand"]::after {
  background: linear-gradient(90deg, var(--accent-sand), #d8b66f);
}

.kpi-card[data-accent="ember"]::after {
  background: linear-gradient(90deg, var(--accent-ember), #e8865d);
}

.kpi-card[data-accent="slate"]::after {
  background: linear-gradient(90deg, var(--accent-slate), #7090a0);
}

.kpi-card p {
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.86rem;
}

.kpi-card strong {
  font-family: "Sora", sans-serif;
  font-size: 1.5rem;
}

.surface-card {
  background: var(--surface-overlay);
  border: 1px solid var(--surface-border-strong);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.surface-card h2 {
  margin: 0;
  font-size: 1.08rem;
}

:root[data-theme="dark"] .form-label,
:root[data-theme="dark"] .main-nav__link,
:root[data-theme="dark"] .surface-card h2,
:root[data-theme="dark"] .surface-card__head span,
:root[data-theme="dark"] .muted,
:root[data-theme="dark"] td,
:root[data-theme="dark"] th,
:root[data-theme="dark"] .table,
:root[data-theme="dark"] .empty-state {
  color: var(--text-main);
}

:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select,
:root[data-theme="dark"] textarea {
  background: rgba(25, 38, 47, 0.92);
  border-color: rgba(101, 133, 151, 0.38);
  color: var(--text-main);
}

:root[data-theme="dark"] .table > :not(caption) > * > * {
  border-color: rgba(84, 114, 133, 0.34);
}

:root[data-theme="dark"] .table thead th {
  color: #b9ceda;
  border-bottom-color: rgba(90, 122, 142, 0.4);
}

:root[data-theme="dark"] .table tbody tr {
  border-color: rgba(76, 106, 126, 0.28);
}

:root[data-theme="dark"] .table tbody tr:hover {
  background: rgba(56, 84, 103, 0.28);
}

:root[data-theme="dark"] .status-chip {
  border-color: rgba(92, 129, 149, 0.44);
  background: rgba(34, 52, 64, 0.9);
  color: #d7e8f2;
}

:root[data-theme="dark"] .status-chip.is-active {
  color: #ffffff;
}

:root[data-theme="dark"] .stack-list li,
:root[data-theme="dark"] .history-list li,
:root[data-theme="dark"] .task-item,
:root[data-theme="dark"] .checklist-section,
:root[data-theme="dark"] .checklist-item,
:root[data-theme="dark"] .availability-week,
:root[data-theme="dark"] .anw-cell {
  background: rgba(25, 38, 47, 0.9);
  border-color: rgba(90, 124, 143, 0.36);
}

:root[data-theme="dark"] .checklist-item-check span,
:root[data-theme="dark"] .task-item strong,
:root[data-theme="dark"] .task-item small,
:root[data-theme="dark"] .anw-cell strong,
:root[data-theme="dark"] .anw-cell small,
:root[data-theme="dark"] .stack-list span,
:root[data-theme="dark"] .history-list span {
  color: var(--text-main);
}

.surface-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.surface-card__head span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

.form-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #355762;
}

.form-control,
.form-select,
textarea {
  border-radius: 11px;
  border-color: #c7d9d2;
  background: #fbfdfc;
  color: var(--text-main);
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  box-shadow: 0 0 0 0.18rem rgba(31, 138, 131, 0.18);
  border-color: #67ada4;
}

.btn {
  border-radius: 12px;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(140deg, var(--accent-sea), var(--accent-slate));
  border: 0;
  box-shadow: 0 8px 18px rgba(25, 90, 102, 0.25);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  filter: brightness(0.95);
}

.btn-outline-light {
  color: var(--outline-text);
  border-color: var(--outline-border);
  background: var(--outline-bg);
}

.btn-outline-light:hover,
.btn-outline-light:focus-visible {
  color: var(--outline-hover-text);
  border-color: var(--outline-hover-border);
  background: var(--outline-hover-bg);
}

.status-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-chip {
  border: 1px solid #c2d3cc;
  background: #f7fbf9;
  color: #214b57;
  font-size: 0.83rem;
  border-radius: 999px;
  padding: 0.35rem 0.72rem;
  font-weight: 600;
}

.status-chip:hover {
  border-color: rgba(31, 138, 131, 0.4);
}

.status-chip.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-chip.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(140deg, #1f8a83, #2c6f84);
}

.table {
  color: var(--text-main);
  --bs-table-bg: transparent;
}

.table thead th {
  color: #40616a;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom-color: #d4e2dd;
}

.table tbody tr {
  border-color: #e2ece7;
}

.table tbody tr:hover {
  background: rgba(230, 241, 237, 0.45);
}

.table tbody tr.is-selected {
  background: rgba(31, 138, 131, 0.14);
}

.order-list-row {
  cursor: pointer;
}

.order-list-row.is-selected {
  background: rgba(31, 138, 131, 0.14);
}

.order-list-row td:first-child strong {
  color: #0f4f56;
}

.stack-list,
.task-column,
.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stack-list li,
.history-list li {
  border: 1px solid #d6e4df;
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.7rem;
  background: #fcfefd;
}

.stack-list li:last-child,
.history-list li:last-child {
  margin-bottom: 0;
}

.stack-list strong,
.history-list strong {
  display: block;
  font-size: 0.94rem;
}

.stack-list li small {
  display: block;
  margin-top: 0.22rem;
  color: #56707a;
}

.calendar-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  display: inline-block;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.stack-list span,
.history-list span {
  font-size: 0.82rem;
  color: #557078;
}

.task-column {
  min-height: 260px;
  max-height: 520px;
  overflow: auto;
  padding-right: 0.25rem;
}

.task-item {
  background: #fbfffd;
  border: 1px solid #d4e3de;
  border-radius: 12px;
  padding: 0.72rem;
  margin-bottom: 0.65rem;
}

.task-item:last-child {
  margin-bottom: 0;
}

.task-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.table-actions-inline {
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.list-pagination__size {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.list-pagination__size .form-select {
  min-width: 86px;
}

.customer-picker-trigger {
  cursor: pointer;
}

.settings-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 1rem;
}

.settings-sidebar {
  position: sticky;
  top: 108px;
  align-self: start;
}

.settings-sidebar__title {
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.settings-nav {
  display: grid;
  gap: 0.45rem;
}

.settings-nav__item {
  border: 1px solid var(--outline-border);
  background: var(--outline-bg);
  color: var(--outline-text);
  border-radius: 11px;
  text-align: left;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
}

.settings-nav__item.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-sea), var(--accent-slate));
  box-shadow: 0 8px 16px rgba(24, 87, 96, 0.22);
}

.settings-main {
  min-width: 0;
}

.settings-panel {
  display: block;
}

.company-logo-preview-wrap {
  border: 1px dashed var(--surface-border-strong);
  border-radius: 12px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  padding: 0.6rem;
}

#companyLogoPreview {
  max-width: 100%;
  max-height: 110px;
  object-fit: contain;
  display: none;
}

#companyLogoPreview.is-visible {
  display: block;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(12, 24, 30, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-window {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--modal-bg);
  border: 1px solid var(--surface-border-strong);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(12, 36, 44, 0.26);
  padding: 1rem;
}

.modal-window--md {
  width: min(760px, 100%);
}

.modal-window__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.modal-window__head h3 {
  margin: 0;
  font-size: 1.02rem;
}

body.modal-open {
  overflow: hidden;
}

body.task-detail-open {
  overflow: hidden;
}

.modal-overlay.task-detail-overlay-active {
  align-items: center;
  justify-content: center;
}

.modal-overlay.task-detail-overlay-active .surface-card.task-detail-modal {
  position: relative;
  z-index: 1;
  animation: none !important;
  width: min(980px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  margin: 0;
  box-shadow: var(--shadow-strong);
  border-color: rgba(31, 138, 131, 0.42);
}

@media (max-width: 992px) {
  .modal-overlay.task-detail-overlay-active .surface-card.task-detail-modal {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }
}

.hours-log-input {
  width: 5.4rem;
  min-width: 5.4rem;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.3rem;
  padding: 0.12rem 0.48rem;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mini-progress {
  position: relative;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(36, 100, 108, 0.14);
  overflow: hidden;
  margin-bottom: 0.18rem;
}

.mini-progress > span {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  background: linear-gradient(90deg, var(--accent-sea), #2c6f84);
}

.task-item strong {
  display: block;
  font-size: 0.9rem;
}

.task-item small {
  color: var(--text-muted);
  font-size: 0.79rem;
  display: block;
}

.fc .fc-event.fc-private-block {
  border-style: dashed;
  opacity: 0.86;
}

.fc .fc-event.fc-private-block .fc-event-title {
  font-weight: 700;
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.task-item--selectable {
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.task-item--selectable:hover {
  transform: translateY(-1px);
  border-color: rgba(32, 116, 114, 0.38);
  box-shadow: 0 8px 18px rgba(22, 82, 88, 0.1);
}

.task-item--selectable.is-selected {
  border-color: rgba(31, 138, 131, 0.6);
  background: rgba(31, 138, 131, 0.08);
}

.task-table-row {
  cursor: pointer;
}

.task-table-row.is-selected {
  background: rgba(31, 138, 131, 0.14);
}

.task-progress {
  position: relative;
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(36, 100, 108, 0.14);
  overflow: hidden;
  margin-top: 0.28rem;
}

.task-progress > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--accent-sea), var(--accent-slate));
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.73rem;
  font-weight: 700;
}

.badge-chip.status-offen,
.badge-chip.status-open {
  background: #d9f1ec;
  color: #1f6f68;
}

.badge-chip.status-in-bearbeitung,
.badge-chip.status-working {
  background: #e5edf5;
  color: #2f5678;
}

.badge-chip.status-wartend {
  background: #f4e9cf;
  color: #8a6626;
}

.badge-chip.status-re-versendet {
  background: #e9e8fb;
  color: #5045a3;
}

.badge-chip.status-geplant,
.badge-chip.status-bestaetigt {
  background: #e4edf9;
  color: #2f5678;
}

.badge-chip.status-durchgefuehrt {
  background: #ddf0e0;
  color: #2f7b47;
}

.badge-chip.status-abgesagt {
  background: #fde4da;
  color: #9a3d2a;
}

.badge-chip.status-erledigt,
.badge-chip.status-abgeschlossen {
  background: #ddf0e0;
  color: #2f7b47;
}

.badge-chip.status-kontaktiert {
  background: #d9f1ec;
  color: #1f6f68;
}

.badge-chip.status-angebot-erstellt {
  background: #e4edf9;
  color: #2f5678;
}

.badge-chip.status-zum-auftrag-weitergefuehrt {
  background: #ddf0e0;
  color: #2f7b47;
}

.badge-chip.status-angebot-abgelehnt {
  background: #fde4da;
  color: #9a3d2a;
}

.badge-chip.status-archiviert {
  background: #e8ebee;
  color: #5f6f79;
}

.badge-chip.status-storniert {
  background: #fde4da;
  color: #9a3d2a;
}

.badge-chip.prio-express,
.badge-chip.prio-dringend {
  background: #fde4da;
  color: #9a3d2a;
}

.badge-chip.prio-normal {
  background: #e7efeb;
  color: #4c6662;
}

.history-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.history-list time {
  color: #5f7880;
  font-size: 0.8rem;
  white-space: nowrap;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed #c0d2ca;
  border-radius: 10px;
  text-align: center;
  color: #5b7680;
  font-size: 0.9rem;
}

.chart-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  min-height: 0;
}

.chart-wrap--sm {
  min-height: 260px;
  height: 260px;
}

.chart-wrap--md {
  min-height: 320px;
  height: 320px;
}

.chart-wrap--lg {
  min-height: 300px;
  height: 300px;
}

.chart-wrap > canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  display: block;
}

.dashboard-scope-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.dashboard-scope-picker .form-select {
  min-width: 180px;
}

#dashboardPlanOverflow {
  display: grid;
  gap: 0.55rem;
}

.plan-bars {
  display: grid;
  gap: 0.45rem;
}

.plan-bar-row {
  display: grid;
  gap: 0.16rem;
}

.plan-bar-row > small {
  color: #4f6872;
  font-size: 0.75rem;
}

.plan-bar-track {
  display: flex;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(60, 106, 116, 0.12);
  overflow: hidden;
}

.plan-bar-track span {
  display: block;
  height: 100%;
}

.plan-bar-track .is-blocked {
  background: linear-gradient(90deg, #c95b3d, #e78663);
}

.plan-bar-track .is-planned {
  background: linear-gradient(90deg, #4f82e6, #6ea3ff);
}

.plan-bar-track .is-focus {
  background: linear-gradient(90deg, #1f8a83, #55c5b4);
}

.plan-bar-track .is-reserve {
  background: rgba(34, 84, 97, 0.2);
}

.plan-overflow-item {
  border: 1px solid #d4e3de;
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  background: #fbfffd;
}

.plan-overflow-item strong {
  display: block;
  font-size: 0.9rem;
}

.plan-overflow-item span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.anwesenheit-table th {
  text-align: center;
  min-width: 165px;
  white-space: nowrap;
}

.anwesenheit-table th:first-child {
  min-width: 220px;
  text-align: left;
}

.anwesenheit-table td {
  vertical-align: top;
}

.anwesenheit-summary-card h3 {
  margin: 0;
  font-size: 1rem;
}

.anwesenheit-summary-card p {
  margin: 0.28rem 0 0;
  font-size: 0.84rem;
  color: #496570;
}

.anwesenheit-summary-card small {
  display: block;
  margin-top: 0.22rem;
  color: #57727c;
  font-size: 0.76rem;
}

.anw-user-cell {
  min-width: 220px;
}

.anw-user-cell strong {
  display: block;
  font-size: 0.9rem;
}

.anw-user-cell small {
  display: block;
  color: #58737d;
  font-size: 0.78rem;
  margin-top: 0.1rem;
}

.anw-cell {
  min-width: 160px;
  display: grid;
  gap: 0.18rem;
}

.anw-cell.is-empty {
  min-height: 52px;
  place-items: center;
}

.anw-cell.is-off {
  opacity: 0.72;
}

.anw-cell strong {
  font-size: 0.76rem;
  color: #315c68;
}

.anw-cell small {
  color: #58727c;
  font-size: 0.72rem;
  line-height: 1.2;
}

.anw-cell-bar {
  display: flex;
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(60, 106, 116, 0.12);
  overflow: hidden;
}

.anw-cell-bar.is-summary {
  margin-top: 0.25rem;
}

.anw-cell-bar span {
  display: block;
  height: 100%;
}

.anw-cell-bar .is-blocked {
  background: linear-gradient(90deg, #c95b3d, #e78663);
}

.anw-cell-bar .is-planned {
  background: linear-gradient(90deg, #4f82e6, #6ea3ff);
}

.anw-cell-bar .is-focus {
  background: linear-gradient(90deg, #1f8a83, #55c5b4);
}

.anw-cell-bar .is-reserve {
  background: rgba(34, 84, 97, 0.2);
}

.hero-panel__hint {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(242, 251, 248, 0.95);
}

.checklist-board {
  display: grid;
  gap: 0.75rem;
}

.checklist-section {
  border: 1px solid #d2e2dd;
  border-radius: 12px;
  padding: 0.65rem;
  background: #fcfefd;
}

.checklist-section-head {
  display: flex;
  justify-content: space-between;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.checklist-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.38rem;
}

.checklist-item {
  border: 1px solid #dde9e4;
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.checklist-item.is-done {
  background: rgba(42, 160, 143, 0.08);
}

.checklist-item-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.checklist-item-check span {
  color: #234b57;
  font-size: 0.89rem;
}

.order-progress-track {
  height: 0.56rem;
  border-radius: 999px;
  background: rgba(60, 106, 116, 0.14);
  overflow: hidden;
}

.order-progress-track > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #1f8a83, #2c6f84);
}

#userScheduleGrid {
  display: grid;
  gap: 0.4rem;
  max-width: 560px;
}

#availabilityScheduleGrid {
  display: grid;
  gap: 0.4rem;
  max-width: 560px;
}

.schedule-row {
  display: grid;
  grid-template-columns: minmax(170px, 240px) 110px 110px;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-start;
}

.schedule-day {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: #365b64;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}

.login-shell {
  width: 100%;
  max-width: 440px;
}

.login-card {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(43, 97, 94, 0.16);
  box-shadow: var(--shadow-soft);
  padding: 1.3rem;
}

.login-card h1 {
  margin: 0;
  font-size: 1.4rem;
}

.availability-visual {
  display: grid;
  gap: 0.55rem;
}

.availability-week {
  border: 1px solid #d4e3de;
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  background: #fbfffd;
}

.availability-week strong {
  display: block;
  font-size: 0.86rem;
}

.availability-week > span {
  display: block;
  color: #5b7781;
  font-size: 0.76rem;
  margin-bottom: 0.36rem;
}

.availability-week-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
}

#taskDetailCard.is-open {
  border-color: rgba(31, 138, 131, 0.42);
}

.availability-day {
  display: grid;
  gap: 0.12rem;
}

.availability-day small {
  text-align: center;
  color: #5f7b84;
  font-size: 0.68rem;
}

.availability-day-bar {
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(36, 97, 109, 0.14);
  overflow: hidden;
}

.availability-day-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-sea), var(--accent-slate));
}

#teamCalendar {
  min-height: 610px;
}

.fc .fc-toolbar-title {
  font-family: "Sora", sans-serif;
  font-size: 1.1rem;
}

.fc .fc-button {
  background: var(--accent-slate);
  border-color: var(--accent-slate);
  border-radius: 8px;
  text-transform: capitalize;
  color: #fff;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active,
.fc .fc-button:hover {
  background: var(--accent-sea);
  border-color: var(--accent-sea);
}

.fc-theme-standard td,
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
  border-color: var(--surface-border);
}

.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number {
  color: var(--text-main);
  text-decoration: none;
}

.fc .fc-list-day-cushion {
  background: rgba(38, 98, 108, 0.08);
}

.fc .fc-list-day-cushion a,
.fc .fc-list-event-title a {
  color: var(--text-main);
  text-decoration: none;
}

.fc .fc-list-event-time {
  color: var(--text-main);
}

.fc .fc-list-event:hover td {
  background: rgba(43, 97, 94, 0.08);
}

:root[data-theme="dark"] .fc .fc-list-day-cushion {
  background: rgba(58, 92, 112, 0.28);
}

:root[data-theme="dark"] .fc .fc-list-event:hover td {
  background: rgba(63, 100, 123, 0.32);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 992px) {
  .hero-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .calendar-filter-bar {
    min-width: 100%;
    width: 100%;
  }

  #teamCalendar {
    min-height: 520px;
  }

  .chart-wrap--md {
    min-height: 280px;
    height: 280px;
  }

  .chart-wrap--lg {
    min-height: 260px;
    height: 260px;
  }

  .settings-workspace {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    position: static;
  }

  .settings-nav {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
}

@media (max-width: 576px) {
  .top-shell {
    position: static;
  }

  .header-meta {
    width: 100%;
    justify-content: space-between;
  }

  .global-search,
  .global-search__input {
    min-width: 100%;
    width: 100%;
  }

  .global-search__results {
    width: 100%;
    right: auto;
    left: 0;
  }

  .notif-center__panel {
    top: calc(100% + 0.35rem);
    left: 0;
    right: auto;
    width: min(96vw, 420px);
    max-height: min(66vh, 460px);
  }

  .kpi-card strong {
    font-size: 1.25rem;
  }

  .schedule-row {
    grid-template-columns: 1fr 1fr;
  }

  .schedule-day {
    grid-column: 1 / -1;
  }

  .availability-week-days {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
