:root {
  --idvkm-bg: #0b1220;
  --idvkm-surface: #121a2b;
  --idvkm-panel: #151e31;
  --idvkm-elevated: #1a2438;
  --idvkm-input: #0f172a;
  --idvkm-border: #2a364c;
  --idvkm-border-soft: #243044;
  --idvkm-text: #e8eef7;
  --idvkm-muted: #9aa8bc;
  --idvkm-accent: #4c93d7;
  --idvkm-accent-bright: #62a0ea;
  --idvkm-accent-deep: #2f74c0;
  --idvkm-danger: #f87171;
  --idvkm-ok: #34d399;
  --idvkm-warn: #fbbf24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(76, 147, 215, 0.18), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(47, 116, 192, 0.12), transparent 50%),
    var(--idvkm-bg);
  color: var(--idvkm-text);
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 12, 22, 0.92);
  color: #e2e8f0;
  border-bottom: 1px solid rgba(76, 147, 215, 0.22);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
  margin-right: 0.25rem;
}

.site-brand:hover {
  color: var(--idvkm-accent-bright);
}

.site-brand-logo {
  display: block;
  height: 34px;
  width: auto;
  border-radius: 0;
  background: transparent;
}

.site-brand-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--idvkm-accent-bright);
}

.site-brand:hover .site-brand-text {
  color: #93c5fd;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.auth-brand-logo {
  height: 44px;
  width: auto;
  border-radius: 0;
  background: transparent;
}

.auth-brand h1 {
  margin: 0;
  color: var(--idvkm-text);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
}

.site-nav a:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.15);
}

.site-nav a.is-active {
  color: #fff;
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(147, 197, 253, 0.35);
}

.site-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.site-user-name {
  color: #94a3b8;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
}

a.site-user-name:hover {
  color: #e2e8f0;
  background: rgba(248, 250, 252, 0.08);
  border-color: rgba(148, 163, 184, 0.35);
}

a.site-user-name.is-active {
  color: #fff;
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(147, 197, 253, 0.35);
}

.profile-panel {
  max-width: 32rem;
}

.profile-meta {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.profile-meta div {
  display: grid;
  gap: 0.2rem;
}

.profile-meta dt {
  margin: 0;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-meta dd {
  margin: 0;
  color: #e2e8f0;
  font-size: 1rem;
  word-break: break-word;
}

.profile-password-form label {
  display: grid;
  gap: 0.35rem;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.profile-password-form input[type="password"] {
  width: 100%;
}

.site-logout {
  text-decoration: none;
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.site-logout:hover {
  background: rgba(248, 250, 252, 0.08);
}

.site-nav-toggle {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: transparent;
  padding: 0.45rem;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.site-nav-toggle span {
  display: block;
  height: 2px;
  background: #e2e8f0;
  border-radius: 2px;
}

.page-intro {
  margin-bottom: 0.15rem;
}

.page-intro h1 {
  margin: 0 0 0.25rem;
  font-size: 1.55rem;
}

.container {
  max-width: 1100px;
  margin: 1.25rem auto 2rem;
  padding: 1.5rem 2rem 2rem;
  background: rgba(18, 26, 43, 0.92);
  border: 1px solid var(--idvkm-border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.app-shell {
  display: grid;
  gap: 1rem;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header h1 {
  margin: 0 0 0.25rem;
}

.subtle {
  color: var(--idvkm-muted);
  margin: 0;
}

.text-danger {
  color: var(--idvkm-danger);
}

.top-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.top-nav a {
  text-decoration: none;
  border: 1px solid var(--idvkm-border);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  color: var(--idvkm-text);
}

.top-nav a:hover {
  background: var(--idvkm-elevated);
}

@media (max-width: 860px) {
  .site-nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .site-user {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding-top: 0.35rem;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.65rem 0.75rem;
  }
}

.panel {
  border: 1px solid var(--idvkm-border);
  border-radius: 12px;
  padding: 1rem;
  background: var(--idvkm-panel);
}

.panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  color: var(--idvkm-text);
}

.week-nav-panel {
  padding: 0.7rem 1rem;
}

.week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.week-nav strong {
  display: block;
  text-align: center;
}

.week-nav .subtle {
  text-align: center;
}

.week-copy-toggle {
  margin-top: 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--idvkm-muted);
  font-size: 0.9rem;
}

label.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
  font-weight: normal;
  color: var(--idvkm-muted);
  font-size: 0.95rem;
}

label.checkbox-row input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
}

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

.card {
  border: 1px solid rgba(76, 147, 215, 0.28);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  background: linear-gradient(180deg, rgba(76, 147, 215, 0.12), rgba(15, 23, 42, 0.35));
}

.card h3 {
  font-size: 0.85rem;
  margin: 0;
  color: var(--idvkm-muted);
  font-weight: 600;
}

.card p {
  margin: 0.35rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--idvkm-text);
}

.sankey-wrap {
  width: 100%;
  min-height: 240px;
}

.sankey-svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 560px;
}

.sankey-label {
  fill: #dbe7f5;
  font-size: 11px;
}

.sankey-node-rect {
  cursor: pointer;
  transition: filter 0.12s ease;
}

.sankey-node-rect:hover {
  filter: brightness(0.92);
}

.sankey-link {
  cursor: pointer;
}

.sankey-link:hover {
  stroke-opacity: 0.75;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.toolbar .inline-field {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  color: var(--idvkm-muted, #64748b);
}

.toolbar input,
.toolbar select,
.stack input,
.stack select,
.stack textarea,
input,
select,
textarea {
  border: 1px solid var(--idvkm-border);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font-size: 0.95rem;
  background: var(--idvkm-input);
  color: var(--idvkm-text);
}

.toolbar input:focus,
.toolbar select:focus,
.stack input:focus,
.stack select:focus,
.stack textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(76, 147, 215, 0.35);
  border-color: var(--idvkm-accent);
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.panel-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--idvkm-muted);
}

/* Folder-style tabs that connect to the panel / table below */
.page-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.15rem;
  margin: 0;
  padding: 0 0.15rem;
  border: none;
  border-bottom: 1px solid var(--idvkm-border);
  border-radius: 0;
  background: transparent;
}

.page-tab {
  appearance: none;
  position: relative;
  z-index: 0;
  margin: 0 0 -1px;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--idvkm-muted);
  border-radius: 10px 10px 0 0;
  padding: 0.65rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.page-tab:hover {
  color: var(--idvkm-text);
  background: rgba(148, 163, 184, 0.08);
}

.page-tab.is-active {
  z-index: 1;
  color: var(--idvkm-text);
  background: var(--idvkm-panel);
  border-color: var(--idvkm-border);
  border-bottom-color: var(--idvkm-panel);
  box-shadow: none;
}

.page-tab-panel[hidden] {
  display: none !important;
}

.page-tab-panel.is-active {
  display: block;
}

.page-tab-panel.panel {
  margin-top: 0;
  border-top-left-radius: 0;
}

.tabbed-surface {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tabbed-surface > .page-tabs {
  margin: 0;
}

.tabbed-surface-body {
  border: 1px solid var(--idvkm-border);
  border-radius: 0 12px 12px 12px;
  background: var(--idvkm-panel);
  padding: 1rem;
  min-width: 0;
}

.tabbed-surface-body > .page-tab-panel.panel {
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin: 0;
}

.tabbed-surface-body > .page-tab-panel:not(.panel) {
  margin: 0;
}

.tabbed-surface-body .panel {
  background: var(--idvkm-elevated);
}

#notifications-app .page-tab-panel .panel {
  margin-top: 1rem;
}

#notifications-app .page-tab-panel .panel:first-child,
#notifications-app .tabbed-surface-body > .page-tab-panel.panel {
  margin-top: 0;
}

#notifications-app .page-tab-panel.panel {
  margin-top: 0;
}

#notifications-app .quartz-summary {
  margin-top: 0.5rem;
}

#notifications-app .server-clock {
  margin: 0.35rem 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--idvkm-text);
  font-variant-numeric: tabular-nums;
}

#notifications-app .schedule-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

#notifications-app .schedule-form .goals-field {
  display: grid;
  gap: 0.25rem;
  min-width: 10rem;
}

#notifications-app .schedule-form input[type="time"] {
  min-width: 8.5rem;
}

#notifications-app .quartz-card .sent-email-card-title {
  display: block;
  margin-bottom: 0.65rem;
}

#notifications-app .page-tab-panel .panel > .toolbar {
  margin-bottom: 0.35rem;
}

.settings-section-tabs {
  margin-bottom: 1rem;
}

#reports-app > .page-tabs {
  margin-bottom: 0;
}

#reports-app > .page-tab-panel.panel,
#reports-app > .page-tab-panel.is-active {
  border-top-left-radius: 0;
}

.btn {
  border: 1px solid var(--idvkm-border);
  background: var(--idvkm-elevated);
  color: var(--idvkm-text);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.btn:hover {
  background: #22304a;
}

.btn-primary {
  background: var(--idvkm-accent-deep);
  border-color: var(--idvkm-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--idvkm-accent);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--idvkm-border-soft);
  text-align: left;
  padding: 0.55rem;
}

.data-table th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--idvkm-muted);
}

/* Sent emails admin: responsive cards (no horizontal scroll) */
#sent-emails-app .sent-emails-toolbar {
  align-items: flex-end;
}

#sent-emails-app .sent-emails-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  flex: 1 1 auto;
  min-width: 0;
}

#sent-emails-app .sent-emails-filter {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--idvkm-muted);
  flex: 1 1 10rem;
  min-width: 0;
}

#sent-emails-app .sent-emails-filter input,
#sent-emails-app .sent-emails-filter select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#sent-emails-app .sent-emails-meta {
  margin: 0 0 0.75rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#sent-emails-app .table-scroll {
  overflow: visible;
}

#sent-emails-app .sent-email-cards {
  display: grid;
  gap: 0.75rem;
}

#sent-emails-app .sent-email-card {
  border: 1px solid var(--idvkm-border-soft);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.28);
  min-width: 0;
}

#sent-emails-app .sent-email-card--sent {
  background-color: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.28);
}

#sent-emails-app .sent-email-card--pending {
  background-color: transparent;
}

#sent-emails-app .sent-email-card--failed {
  background-color: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.28);
}

#sent-emails-app .sent-email-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

#sent-emails-app .sent-email-card-title {
  display: block;
  font-size: 1rem;
  color: var(--idvkm-text);
  overflow-wrap: anywhere;
}

#sent-emails-app .sent-email-card-sub {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

#sent-emails-app .sent-email-card-status {
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#sent-emails-app .sent-email-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  margin: 0;
}

#sent-emails-app .sent-email-card-grid > div {
  min-width: 0;
}

#sent-emails-app .sent-email-card-grid .sent-email-card-span {
  grid-column: 1 / -1;
}

#sent-emails-app .sent-email-card-grid dt {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--idvkm-muted);
}

#sent-emails-app .sent-email-card-grid dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#sent-emails-app .sent-email-card-grid code {
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

#sent-emails-app .sent-email-card-actions {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  #sent-emails-app .sent-emails-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  #sent-emails-app .sent-emails-filters {
    width: 100%;
  }

  #sent-emails-app .sent-emails-filter {
    flex: 1 1 100%;
  }

  #sent-emails-app .toolbar-actions {
    width: 100%;
  }

  #sent-emails-app .toolbar-actions .btn {
    width: 100%;
  }

  #sent-emails-app .sent-email-card-grid {
    grid-template-columns: 1fr;
  }

  #sent-emails-app .sent-email-card-actions .btn {
    width: 100%;
  }
}

/* Keep legacy row tint selectors harmless if present elsewhere */
#sent-emails-app .sent-email-row--sent td {
  background-color: rgba(52, 211, 153, 0.12);
}

#sent-emails-app .sent-email-row--sent:hover td {
  background-color: rgba(52, 211, 153, 0.2);
}

#sent-emails-app .sent-email-row--pending td {
  background-color: transparent;
}

#sent-emails-app .sent-email-row--pending:hover td {
  background-color: rgba(148, 163, 184, 0.08);
}

#sent-emails-app .sent-email-row--failed td {
  background-color: rgba(248, 113, 113, 0.12);
}

#sent-emails-app .sent-email-row--failed:hover td {
  background-color: rgba(248, 113, 113, 0.2);
}

.click-row {
  cursor: pointer;
}

.click-row:hover {
  background: rgba(76, 147, 215, 0.1);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 50;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--idvkm-surface);
  border-left: 1px solid var(--idvkm-border);
  padding: 0;
  transform: translateX(100%);
  transition: transform 0.12s ease;
  overflow: hidden;
  color: var(--idvkm-text);
  z-index: 51;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--idvkm-border-soft);
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.drawer-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.85rem 1rem 1rem;
  overscroll-behavior: contain;
}

.drawer-footer {
  flex: 0 0 auto;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--idvkm-border-soft);
  background: var(--idvkm-surface);
}

.drawer-section-title {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
}

.drawer-open {
  overflow: hidden;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.stack {
  display: grid;
  gap: 0.6rem;
}

.stack label {
  display: grid;
  gap: 0.3rem;
}

.stack label.inline-check,
.stack label.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.stack label.inline-check input[type="checkbox"],
.stack label.checkbox-row input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  margin: 0;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.allocation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(72px, 100px) auto;
  gap: 0.45rem;
  align-items: center;
}

.allocation-row select,
.allocation-row input {
  min-width: 0;
  max-width: 100%;
}

.allocation-rows {
  min-width: 0;
}

@media (max-width: 480px) {
  .drawer {
    width: 100vw;
    border-left: none;
  }

  .allocation-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "project project"
      "fte remove";
  }

  .allocation-row select {
    grid-area: project;
  }

  .allocation-row input {
    grid-area: fte;
  }

  .allocation-row button {
    grid-area: remove;
  }
}

.allocation-capacity {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: var(--idvkm-elevated);
  border: 1px solid var(--idvkm-border);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.allocation-capacity.is-over {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fcd34d;
}

.form-status {
  margin: 0;
  min-height: 1.25rem;
  font-size: 0.9rem;
  color: var(--idvkm-muted);
}

.form-status.is-error {
  color: var(--idvkm-danger);
}

.form-status.is-ok {
  color: var(--idvkm-ok);
}

.form-status.is-busy {
  color: var(--idvkm-accent-bright);
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.4rem;
  border: 1px solid rgba(15, 23, 42, 0.2);
}

.forecast-bars {
  display: grid;
  gap: 0.4rem;
}

.forecast-row {
  display: grid;
  grid-template-columns: 180px 1fr 60px;
  align-items: center;
  gap: 0.7rem;
}

.forecast-week {
  font-size: 0.9rem;
  color: #334155;
}

.forecast-track {
  height: 14px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.forecast-bar {
  height: 100%;
  border-radius: 999px;
}

.forecast-bar.ok {
  background: #3b82f6;
}

.forecast-bar.under {
  background: #f59e0b;
}

.forecast-bar.over {
  background: #ef4444;
}

.forecast-value {
  text-align: right;
  font-weight: 600;
  color: #0f172a;
}

/* Weekly booking report */
.booking-period-tabs {
  margin: 0;
  flex: 0 0 auto;
}

.booking-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin: 0 0 1rem;
}

.booking-swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
  margin-right: 0.35rem;
  vertical-align: -1px;
}

.booking-swatch.booked { background: var(--idvkm-accent); }
.booking-swatch.capacity { background: #64748b; }
.booking-swatch.over { background: var(--idvkm-danger); }
.booking-swatch.under { background: var(--idvkm-warn); }

.booking-chart-wrap {
  width: 100%;
  overflow-x: auto;
  min-height: 320px;
}

.booking-chart {
  display: block;
  max-width: none;
}

.booking-grid {
  stroke: var(--idvkm-border-soft);
  stroke-width: 1;
}

.booking-axis-label,
.booking-x-label {
  fill: var(--idvkm-muted);
  font-size: 11px;
  font-family: inherit;
}

.booking-bar-used { fill: var(--idvkm-accent); }
.booking-bar-free { fill: #475569; }
.booking-bar-over-seg { fill: var(--idvkm-danger); }
.booking-bar-outline {
  fill: none;
  stroke: rgba(226, 232, 240, 0.35);
  stroke-width: 1;
  pointer-events: none;
}

.booking-bars {
  display: grid;
  gap: 0.85rem;
}

.booking-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr minmax(110px, 140px);
  align-items: start;
  gap: 0.75rem;
}

.booking-name {
  font-weight: 600;
  color: var(--idvkm-text);
  padding-top: 0.15rem;
}

.booking-track {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: var(--idvkm-input);
  overflow: hidden;
  border: 1px solid var(--idvkm-border-soft);
}

.booking-track-stack {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 0;
}

.booking-stack-seg {
  height: 100%;
  min-width: 0;
}

.booking-stack-used { background: var(--idvkm-accent); }
.booking-stack-free { background: #475569; }
.booking-stack-over { background: var(--idvkm-danger); }

.booking-dual {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.35rem;
}

.booking-mini-label {
  font-size: 0.82rem;
  color: var(--idvkm-muted);
}

.booking-meta {
  text-align: right;
  font-weight: 600;
  padding-top: 0.15rem;
  color: var(--idvkm-text);
}

.booking-meta.over { color: var(--idvkm-danger); }
.booking-meta.under { color: var(--idvkm-warn); }
.booking-meta.ok { color: var(--idvkm-accent-bright); }

@media (max-width: 720px) {
  .booking-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .booking-meta {
    text-align: left;
  }
}

.forecast-status {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.forecast-status.ok {
  background: #dcfce7;
  color: #166534;
}

.forecast-status.warn {
  background: #fee2e2;
  color: #991b1b;
}

.issue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.8rem;
}

.issue-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.8rem;
  background: #fff;
}

.issue-card h3 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}

.issue-card.over {
  border-color: #fecaca;
  background: #fff7f7;
}

.issue-card.under {
  border-color: #fde68a;
  background: #fffdf4;
}

.issue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.issue-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding-top: 0.45rem;
}

.issue-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.issue-list span {
  color: #475569;
  font-size: 0.88rem;
  white-space: nowrap;
}

/* Year goals */
.goals-app.container {
  max-width: min(1200px, 96vw);
}

.goals-toolbar .goals-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}

.goals-toolbar .goals-field {
  display: grid;
  gap: 0.25rem;
  min-width: 6rem;
}

.goals-toolbar .goals-field-grow {
  flex: 1;
  min-width: 200px;
}

.goals-toolbar .toolbar-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.goals-employee-banner {
  margin-bottom: 1rem;
}

.goals-employee-name {
  margin: 0 0 0.15rem;
}

.goals-goal-panel {
  margin-bottom: 1rem;
}

.goals-goal-panel h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.goals-goal-panel .goal-title-input {
  width: 100%;
  max-width: 42rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  margin-bottom: 0.75rem;
}

.goals-goal-panel .goal-title-readonly {
  margin: 0 0 0.75rem;
}

.goals-table-wrap {
  overflow-x: auto;
}

.goals-year-table th:first-child {
  min-width: 9.5rem;
  max-width: 14rem;
  white-space: normal;
  vertical-align: top;
}

.goals-month-th-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.goals-month-name {
  font-weight: 600;
}

.goals-row-checkin-btn {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  flex-shrink: 0;
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-none {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-none:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-employee {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-employee:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-manager {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-manager:hover {
  background: #d1fae5;
  border-color: #34d399;
}

.goals-year-table .goals-cell-input {
  width: 100%;
  min-width: 160px;
  padding: 0.45rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font: inherit;
  resize: vertical;
  background: #f8fafc;
}

.goals-year-table .goals-cell-read {
  min-height: 2.5rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #334155;
}

.goal-desc-label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  max-width: 52rem;
}

.goal-desc-input {
  padding: 0.5rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  resize: vertical;
  background: #fafafa;
}

.goal-desc-read {
  margin-bottom: 0.85rem;
  max-width: 52rem;
}

.goal-desc-read .subtle {
  display: block;
  margin-bottom: 0.25rem;
}

.goals-month-row--reviewed {
  background: #f0fdf4;
}

.goals-month-row--reviewed th {
  border-left: 3px solid #10b981;
  padding-left: 0.45rem;
}

.goals-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 1000;
}

.goals-modal-backdrop[hidden] {
  display: none !important;
}

.goals-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  padding: 1rem;
  pointer-events: none;
}

.goals-modal[hidden] {
  display: none !important;
}

.goals-modal:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.goals-modal-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 34rem;
  max-height: min(90vh, 640px);
  overflow-y: auto;
  position: relative;
}

.goals-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.goals-modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.goals-modal-icon-btn {
  flex-shrink: 0;
  padding: 0.15rem 0.55rem;
  font-size: 1.35rem;
  line-height: 1;
  border: none;
  background: transparent;
  color: #64748b;
}

.goals-modal-icon-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.goals-modal-hint {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.goals-modal-field {
  margin-bottom: 0.85rem;
}

.goals-modal .checkin-date-input {
  max-width: 12rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font: inherit;
}

.goals-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

.goals-modal-actions .goals-checkin-delete {
  margin-inline-end: auto;
}

body.goals-modal-open {
  overflow: hidden;
}

.checkin-notes[readonly] {
  background: #f1f5f9;
  color: #334155;
}

/* PlanMill-like weekly timesheet */
.time-report-filters {
  align-items: flex-end;
}

.time-report-filters .goals-field {
  display: grid;
  gap: 0.25rem;
  min-width: 7.5rem;
}

.time-report-filters .goals-field-grow {
  flex: 1 1 14rem;
  min-width: 12rem;
}

.time-report-filters .goals-field select {
  min-width: 100%;
}

.tr-type-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.tr-type-pill {
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
}

.timesheet-toolbar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.timesheet-sheet-panel {
  padding: 0.75rem;
}

.timesheet-scroll {
  overflow-x: auto;
}

.timesheet-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 860px;
  font-size: 0.9rem;
}

.timesheet-grid th,
.timesheet-grid td {
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #eef2f7;
  padding: 0.35rem 0.4rem;
  vertical-align: middle;
}

.timesheet-grid thead th {
  background: #0f172a;
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  z-index: 2;
}

.timesheet-grid tfoot th,
.timesheet-grid tfoot td {
  background: #f8fafc;
  font-weight: 700;
}

.timesheet-grid .ts-col-project {
  min-width: 220px;
  text-align: left;
  position: sticky;
  left: 0;
  background: inherit;
  z-index: 1;
}

.timesheet-grid thead .ts-col-project {
  background: #0f172a;
  z-index: 3;
}

.timesheet-grid tbody .ts-col-project {
  background: #fff;
}

.timesheet-grid tfoot .ts-col-project {
  background: #f8fafc;
}

.timesheet-grid .ts-col-day {
  width: 6.6rem;
  min-width: 6.2rem;
  text-align: center;
  vertical-align: top;
}

.timesheet-grid .ts-col-day.is-weekend {
  background: #f1f5f9;
}

.timesheet-grid thead .ts-col-day.is-weekend {
  background: #1e293b;
}

.timesheet-grid .ts-col-total {
  width: 4.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.timesheet-grid .ts-col-actions {
  width: 2.4rem;
  text-align: center;
  border-right: none;
}

.ts-day-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: stretch;
}

.ts-hour-input {
  width: 100%;
  max-width: none;
  padding: 0.35rem 0.25rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  text-align: center;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}

.ts-hour-input:focus {
  outline: 2px solid rgba(59, 130, 246, 0.35);
  border-color: #3b82f6;
}

.ts-hour-input:disabled {
  background: #f8fafc;
  color: #64748b;
}

.ts-hour-input.is-booked-zero {
  border-color: #38bdf8;
  background: #e0f2fe;
}

.ts-hour-input.is-unbooked {
  color: #94a3b8;
}

.ts-note-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.2rem 0.3rem;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  font-size: 0.7rem;
  background: #f8fafc;
  color: #334155;
}

.ts-note-input:focus {
  outline: 2px solid rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
}

.ts-note-input:disabled {
  opacity: 0.6;
}

.ts-note-input::placeholder {
  color: #94a3b8;
}

.ts-project-swatch {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  margin-right: 0.45rem;
  vertical-align: middle;
}

.ts-project-name {
  font-weight: 600;
  color: #0f172a;
}

.ts-alloc-badge {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: rgba(23, 96, 160, 0.12);
  color: #1760a0;
}

.ts-day-total.is-over {
  color: #b42318;
}

.btn-sm {
  padding: 0.15rem 0.45rem;
  font-size: 0.85rem;
  line-height: 1.2;
}

.ts-remove-row {
  border-color: #fecaca;
  color: #b42318;
}

.timesheet-hint {
  margin: 0.75rem 0.5rem 0.25rem;
}

/* Monthly time report */
.time-report-sheet-panel {
  padding: 0.75rem;
}

.time-report-grid .tr-hours {
  font-variant-numeric: tabular-nums;
}

.time-report-sections {
  display: grid;
  gap: 1rem;
  margin-top: 0.75rem;
}

@media (min-width: 900px) {
  .time-report-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.time-report-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: #fff;
}

.time-report-card-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.time-report-card-head h3 {
  margin: 0;
  font-size: 1rem;
  flex: 1;
  min-width: 0;
}

.time-report-card-total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  white-space: nowrap;
}

.time-report-detail {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.time-report-detail th,
.time-report-detail td {
  text-align: left;
  padding: 0.35rem 0.25rem;
  border-bottom: 1px solid #f1f5f9;
}

.time-report-detail th:last-child,
.time-report-detail td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.time-report-detail tr:last-child td {
  border-bottom: none;
}

#tr-status.is-error {
  color: #b42318;
}

.goals-snackbar {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(1rem);
  z-index: 1200;
  max-width: min(32rem, calc(100vw - 2rem));
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.goals-snackbar.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.goals-snackbar.is-error {
  background: #991b1b;
}

.status-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  vertical-align: middle;
}

.status-pill.is-active {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.status-pill.is-inactive {
  background: rgba(100, 116, 139, 0.16);
  color: #475569;
}

.is-inactive-row td {
  color: #64748b;
}

.ts-inactive-badge {
  background: rgba(100, 116, 139, 0.16) !important;
  color: #94a3b8 !important;
}

/* ---- Dark theme polish for remaining light surfaces ---- */
.timesheet-grid th,
.timesheet-grid td {
  border-bottom-color: var(--idvkm-border-soft);
  border-right-color: rgba(42, 54, 76, 0.7);
}

.timesheet-grid thead th {
  background: #0a1220;
  color: #dbe7f5;
}

.timesheet-grid tfoot th,
.timesheet-grid tfoot td {
  background: var(--idvkm-elevated);
}

.timesheet-grid .ts-col-project {
  background: inherit;
}

.timesheet-grid thead .ts-col-project {
  background: #0a1220;
}

.timesheet-grid tbody .ts-col-project {
  background: var(--idvkm-panel);
}

.timesheet-grid tfoot .ts-col-project {
  background: var(--idvkm-elevated);
}

.timesheet-grid .ts-col-day.is-weekend {
  background: rgba(15, 23, 42, 0.55);
}

.timesheet-grid thead .ts-col-day.is-weekend {
  background: #111827;
}

.ts-hour-input {
  border-color: var(--idvkm-border);
  background: var(--idvkm-input);
  color: var(--idvkm-text);
}

.ts-hour-input:disabled {
  background: #0d1524;
  color: var(--idvkm-muted);
}

.ts-hour-input.is-booked-zero {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(14, 165, 233, 0.15);
}

.ts-note-input {
  border-color: var(--idvkm-border-soft);
  background: rgba(15, 23, 42, 0.45);
  color: var(--idvkm-text);
}

.ts-note-input:disabled {
  opacity: 0.55;
}

.ts-note-input::placeholder {
  color: var(--idvkm-muted);
}

.ts-project-name {
  color: var(--idvkm-text);
}

.ts-alloc-badge {
  background: rgba(76, 147, 215, 0.18);
  color: var(--idvkm-accent-bright);
}

.time-report-card {
  border-color: var(--idvkm-border);
  background: var(--idvkm-elevated);
}

.time-report-card-head h3,
.time-report-card-total {
  color: var(--idvkm-text);
}

.time-report-detail th,
.time-report-detail td {
  border-bottom-color: var(--idvkm-border-soft);
}

.goals-goal-panel,
.goals-modal-inner,
.goals-employee-banner {
  background: var(--idvkm-elevated);
  border-color: var(--idvkm-border);
  color: var(--idvkm-text);
}

.goals-modal-backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.goals-year-table th,
.goals-year-table td,
.goals-cell-read,
.goal-title-readonly,
.goal-desc-read {
  color: var(--idvkm-text);
}

.goals-year-table .goals-cell-input,
.goals-goal-panel .goal-title-input,
.goals-modal .checkin-date-input,
.checkin-notes {
  background: var(--idvkm-input);
  color: var(--idvkm-text);
  border-color: var(--idvkm-border);
}

.goals-month-row--reviewed,
.goals-month-row--reviewed th {
  background: rgba(76, 147, 215, 0.08);
}

.status-pill.is-active {
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
}

.status-pill.is-inactive {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.is-inactive-row td {
  color: var(--idvkm-muted);
}

.forecast-bar,
.forecast-track {
  background: #0f172a;
}

.color-dot {
  border-color: rgba(226, 232, 240, 0.25);
}

a {
  color: var(--idvkm-accent-bright);
}

code {
  color: #cbd5e1;
}
