@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

: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: min(1400px, calc(100vw - 0.5rem));
  margin: 0 auto;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

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

.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;
}

/* Login / forgot / reset — full-bleed Trango Towers backdrop */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 2rem;
  background-color: #1a2438;
  background-image:
    radial-gradient(ellipse 55% 70% at 50% 45%, rgba(8, 12, 22, 0.42) 0%, rgba(8, 12, 22, 0.12) 55%, transparent 75%),
    linear-gradient(180deg, rgba(8, 12, 22, 0.18) 0%, transparent 40%, rgba(8, 12, 22, 0.35) 100%),
    url("/img/login-kom-emine.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Narrow card — do not use .container (that shell is ~1100px wide) */
.auth-page .auth-shell {
  box-sizing: border-box;
  width: min(24rem, calc(100vw - 2rem));
  max-width: 24rem;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  background: transparent;
  border: none;
  box-shadow: none;
}

.auth-header {
  flex-direction: column;
  align-items: stretch;
}

/* Beat later .panel { background: opaque } */
.auth-page .panel.auth-panel {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(232, 238, 247, 0.18);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.auth-page .auth-brand h1,
.auth-page .subtle,
.auth-page .text-danger {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65), 0 1px 12px rgba(0, 0, 0, 0.5);
}

/*
 * The login photograph is bright, so the standard muted grey lands around 2.6:1 against
 * the sky above the card - unreadable, worst on a phone where the card sits lower. This
 * lifts it to 4.66:1 there and 6.98:1 on the card, while staying softer than the heading.
 * Scoped to .auth-page: .subtle elsewhere sits on opaque dark panels.
 */
.auth-page .subtle {
  color: #d5dde9;
}

.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.1rem;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
}

.site-nav a,
.site-nav-more-toggle {
  text-decoration: none;
  color: #cbd5e1;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.35rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

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

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

.site-nav-more {
  position: relative;
  flex-shrink: 0;
}

.site-nav-more-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.site-nav-more-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.75;
}

.site-nav-more-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 50;
  min-width: 11rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--idvkm-border-soft);
  background: var(--idvkm-panel);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  gap: 0.1rem;
}

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

.site-nav-more-menu[hidden] {
  display: none !important;
}

.site-nav-more.is-open .site-nav-more-menu[hidden] {
  display: flex !important;
}

.site-nav-more-menu a {
  display: block;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

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

.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;
}

.page-intro > .subtle {
  margin: 0 0 0.35rem;
  max-width: 52rem;
}

.page-howto {
  margin: 0.15rem 0 0;
  max-width: 40rem;
}

.page-howto > summary {
  cursor: pointer;
  color: var(--idvkm-accent, #4c93d7);
  font-size: 0.88rem;
  font-weight: 600;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.page-howto > summary::-webkit-details-marker {
  display: none;
}

.page-howto > summary::before {
  content: "▸";
  font-size: 0.75rem;
  line-height: 1;
}

.page-howto[open] > summary::before {
  content: "▾";
}

.page-howto-body {
  margin-top: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--idvkm-border-soft, rgba(76, 147, 215, 0.22));
  background: color-mix(in srgb, var(--idvkm-elevated) 90%, transparent);
  color: var(--idvkm-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.page-howto-body p {
  margin: 0 0 0.45rem;
}

.page-howto-body p:last-child {
  margin-bottom: 0;
}

.page-howto-body ul {
  margin: 0.25rem 0 0;
  padding-left: 1.15rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.15rem 0.35rem;
}

.empty-state > p {
  margin: 0;
  max-width: 36rem;
}

.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.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;
}

.app-shell > .panel,
.app-shell .page-tab-panel > .panel,
.app-shell .time-report-app > .panel,
.app-shell .booking-report-app > .panel,
.app-shell .hours-matrix-app > .panel,
.app-shell .leave-report-app > .panel,
.app-shell .booking-detail-report-app > .panel,
.app-shell .invoice-report-app > .panel {
  margin-top: 0;
  margin-bottom: 0;
}

/* Reports need more than the default 1100px shell so list tables can wrap instead of scrolling. */
#reports-app.reports-shell {
  max-width: min(1600px, calc(100vw - 1.5rem));
  width: 100%;
  box-sizing: border-box;
}

.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-header-inner {
    flex-wrap: wrap;
  }

  .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;
    flex-wrap: wrap;
    gap: 0.15rem;
    padding-top: 0.35rem;
  }

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

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

  /* On phones, flatten More into the hamburger list */
  .site-nav-more {
    display: contents;
  }

  .site-nav-more-toggle {
    display: none;
  }

  .site-nav-more-menu,
  .site-nav-more.is-open .site-nav-more-menu,
  .site-nav-more-menu[hidden],
  .site-nav-more.is-open .site-nav-more-menu[hidden] {
    display: contents !important;
    position: static;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: 0;
    background: transparent;
  }
}

.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;
}

.period-nav-heading,
.ts-week-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.period-nav-badge,
.ts-week-period-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.period-hours-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--idvkm-text);
  background: color-mix(in srgb, var(--idvkm-accent, #4c93d7) 16%, var(--idvkm-elevated, #121a2b));
  border: 1px solid color-mix(in srgb, var(--idvkm-accent, #4c93d7) 35%, var(--idvkm-border));
}

.period-nav-badge.is-current,
.ts-week-period-badge.is-current {
  color: #052e16;
  background: #bbf7d0;
  border-color: #4ade80;
}

.period-nav-badge.is-past,
.ts-week-period-badge.is-past {
  color: #0f172a;
  background: #cbd5e1;
  border-color: #94a3b8;
}

.period-nav-badge.is-future,
.ts-week-period-badge.is-future {
  color: #1e3a8a;
  background: #bfdbfe;
  border-color: #60a5fa;
}

.period-nav-panel.is-period-current,
#ts-week-panel.is-week-current,
#ts-week-panel.is-period-current {
  border-color: rgba(74, 222, 128, 0.55);
  box-shadow: inset 3px 0 0 #22c55e;
}

.period-nav-panel.is-period-past,
#ts-week-panel.is-week-past,
#ts-week-panel.is-period-past {
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: inset 3px 0 0 #64748b;
}

.period-nav-panel.is-period-future,
#ts-week-panel.is-week-future,
#ts-week-panel.is-period-future {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: inset 3px 0 0 #3b82f6;
}

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

.planning-horizon {
  margin: 0.55rem 0 0;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--idvkm-border-soft, rgba(148, 163, 184, 0.35));
  background: rgba(14, 165, 233, 0.08);
  color: var(--idvkm-text, #0f172a);
  font-size: 0.9rem;
  font-weight: 500;
}

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;
}

@media (max-width: 800px) {
  #home-app {
    display: flex;
    flex-direction: column;
  }

  #home-app > .page-intro {
    order: 0;
  }

  #home-week-panel {
    order: 1;
  }

  #home-app > #summary-cards {
    order: 2;
  }

  #home-utilization-panel {
    order: 3;
  }

  #home-sankey-panel {
    order: 4;
  }
}

.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-visible,
.toolbar select:focus-visible,
.stack input:focus-visible,
.stack select:focus-visible,
.stack textarea:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.goals-field input:focus-visible,
.goals-field select:focus-visible,
.goals-field textarea:focus-visible,
.drawer input:focus-visible,
.drawer select:focus-visible,
.drawer textarea:focus-visible {
  outline: 2px solid var(--idvkm-accent);
  outline-offset: 1px;
  border-color: var(--idvkm-accent);
}

.toolbar input:focus:not(:focus-visible),
.toolbar select:focus:not(:focus-visible),
.stack input:focus:not(:focus-visible),
.stack select:focus:not(:focus-visible),
.stack textarea:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
  border-color: var(--idvkm-accent);
}

.auth-password-wrap {
  position: relative;
  display: block;
  min-width: 0;
}

.auth-password-wrap input {
  width: 100%;
  padding-right: 2.6rem;
  box-sizing: border-box;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--idvkm-muted, #94a3b8);
  cursor: pointer;
  line-height: 0;
}

.auth-password-toggle:hover {
  color: var(--idvkm-text, #e2e8f0);
  background: color-mix(in srgb, var(--idvkm-elevated, #1e293b) 70%, transparent);
}

.auth-password-toggle:focus-visible {
  outline: 2px solid var(--idvkm-accent, #4c93d7);
  outline-offset: 1px;
}

.auth-password-toggle .auth-eye {
  width: 1.15rem;
  height: 1.15rem;
  display: none;
}

.auth-password-toggle[aria-pressed="false"] .auth-eye-show,
.auth-password-toggle[aria-pressed="true"] .auth-eye-hide {
  display: block;
}

.skeleton {
  display: block;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--idvkm-elevated) 92%, #000) 0%,
    color-mix(in srgb, var(--idvkm-accent, #4c93d7) 18%, var(--idvkm-elevated)) 50%,
    color-mix(in srgb, var(--idvkm-elevated) 92%, #000) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.25s ease-in-out infinite;
}

.skeleton-line {
  height: 0.85rem;
  margin: 0.45rem 0;
  max-width: 100%;
}

.skeleton-line.is-short {
  max-width: 40%;
}

.skeleton-block {
  min-height: 10rem;
  width: 100%;
}

.skeleton-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.skeleton-card {
  height: 4.25rem;
  border-radius: 10px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Native date picker: orange calendar icon so it stays visible on dark inputs. */
input[type="date"] {
  color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  /* Default Chrome/Edge icon → bright orange */
  filter: invert(52%) sepia(98%) saturate(1800%) hue-rotate(360deg) brightness(105%) contrast(102%);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  filter: invert(62%) sepia(98%) saturate(1800%) hue-rotate(360deg) brightness(110%) contrast(102%);
}

/* Searchable select — long dropdowns with filter + scroll (searchable-select.js) */
.goals-search-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.goals-search-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.goals-search-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.4rem;
  padding: 0.5rem 2rem 0.5rem 0.6rem;
  border: 1px solid var(--idvkm-border);
  border-radius: 8px;
  background: var(--idvkm-input);
  color: var(--idvkm-text);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.goals-search-select-trigger::after {
  content: "";
  position: absolute;
  right: 0.65rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--idvkm-muted);
  border-bottom: 2px solid var(--idvkm-muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.goals-search-select-trigger:focus {
  outline: 2px solid rgba(76, 147, 215, 0.35);
  border-color: var(--idvkm-accent);
}

.goals-search-select-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.goals-search-select-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goals-search-select-panel {
  position: absolute;
  z-index: 80;
  left: 0;
  right: 0;
  top: calc(100% + 0.25rem);
  background: var(--idvkm-panel);
  border: 1px solid var(--idvkm-border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.drawer .goals-search-select-panel {
  z-index: 90;
}

.goals-search-select-search {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--idvkm-border-soft);
  background: var(--idvkm-elevated);
}

.goals-search-select-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--idvkm-border);
  border-radius: 6px;
  padding: 0.45rem 0.55rem 0.45rem 1.85rem;
  font-size: 0.92rem;
  background: var(--idvkm-input)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.006a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E")
    no-repeat 0.55rem center;
  color: var(--idvkm-text);
}

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

.goals-search-select-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 14rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.goals-search-select-list [role="option"] {
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  color: var(--idvkm-text);
  font-size: 0.92rem;
  line-height: 1.35;
}

.goals-search-select-list [role="option"]:hover,
.goals-search-select-list [role="option"].is-selected {
  background: rgba(76, 147, 215, 0.15);
}

.goals-search-select-list [role="option"].is-selected {
  font-weight: 600;
}

.goals-search-select-empty {
  padding: 0.65rem 0.75rem;
  color: var(--idvkm-muted);
  font-size: 0.88rem;
  cursor: default;
}

.goals-search-select.is-open .goals-search-select-trigger {
  border-color: var(--idvkm-accent);
}

/* Native date picker: keep calendar control visible; value is always yyyy-MM-dd. */
#project-termination-date {
  max-width: 14rem;
  min-height: 2.4rem;
}

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

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

.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 .tabbed-surface-body > .page-tab-panel {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

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

#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 .page-tabs-sub {
  margin: 0.35rem 0 0.85rem;
  border-bottom-color: var(--idvkm-border-soft);
}

#notifications-app .page-tabs-sub .page-tab {
  font-size: 0.84rem;
  padding: 0.5rem 0.85rem;
  font-weight: 600;
}

#notifications-app .template-subtab-panel {
  gap: 0.85rem;
}

#notifications-app .template-subtab-panel[hidden] {
  display: none !important;
}

#notifications-app .mail-template-cards {
  display: grid;
  gap: 1rem;
}

#notifications-app .mail-template-card {
  border: 1px solid var(--idvkm-border-soft);
  border-radius: 12px;
  background: var(--idvkm-surface);
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#notifications-app .mail-template-card-head {
  margin: 0 0 0.85rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--idvkm-border-soft);
}

#notifications-app .mail-template-card-head h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--idvkm-text);
}

#notifications-app .mail-template-card-head .subtle {
  margin: 0;
}

#notifications-app .mail-template-card .stack {
  gap: 0.75rem;
}

@media (min-width: 960px) {
  #notifications-app .mail-template-cards {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

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

#notifications-app .schedule-status-cards {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

#notifications-app .schedule-status-card {
  padding: 0.9rem 1rem;
  border: 1px solid var(--idvkm-border);
  border-radius: 0.65rem;
  background: var(--idvkm-elevated);
  color: var(--idvkm-text);
}

#notifications-app .schedule-status-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--idvkm-text);
}

#notifications-app .schedule-status-when {
  margin: 0 0 0.75rem;
  color: var(--idvkm-muted);
  font-size: 0.92rem;
}

#notifications-app .schedule-status-meta {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

#notifications-app .schedule-status-meta div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.35rem;
  align-items: baseline;
}

#notifications-app .schedule-status-meta dt {
  margin: 0;
  color: var(--idvkm-muted);
  font-size: 0.82rem;
}

#notifications-app .schedule-status-meta dd {
  margin: 0;
  color: var(--idvkm-text);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

#notifications-app .schedule-advanced {
  margin-top: 0.5rem;
}

#notifications-app .schedule-advanced-summary {
  cursor: pointer;
  font-weight: 600;
  list-style-position: outside;
}

#notifications-app .schedule-advanced-block {
  margin-top: 0.85rem;
}

#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: 0;
}

/*
 * settings.js switches sections with the hidden attribute, and a `display` set on the
 * class outranks the user-agent [hidden] { display: none } rule — without this guard every
 * section renders at once and the tabs appear to do nothing.
 */
.settings-section[hidden] {
  display: none;
}

.settings-section,
#holidays-app,
#job-titles-app,
#notifications-app {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

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

.reports-tab-groups {
  align-items: flex-end;
  gap: 0.75rem 1.1rem;
}

.reports-tab-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.15rem;
  min-width: 0;
}

.reports-tab-group-label {
  display: inline-flex;
  align-items: center;
  margin: 0 0.35rem 0.35rem 0;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--idvkm-muted);
  background: color-mix(in srgb, var(--idvkm-elevated) 80%, transparent);
  border: 1px solid var(--idvkm-border-soft, rgba(76, 147, 215, 0.22));
}

.settings-section-tabs.reports-tab-groups {
  margin-bottom: 0.75rem;
}

#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;
}

.gi {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  display: block;
}

.btn[data-icon],
.btn-icon,
a.btn[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-icon {
  padding: 0.45rem 0.55rem;
}

.lr-order-link .gi,
a.btn .gi {
  width: 0.95rem;
  height: 0.95rem;
}

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

.btn:focus-visible,
.btn-icon:focus-visible {
  outline: 2px solid var(--idvkm-accent);
  outline-offset: 2px;
}

.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;
}

/* display:flex on .drawer outranks the UA [hidden] rule — keep closed drawers off-screen. */
.drawer[hidden],
.drawer-backdrop[hidden] {
  display: none !important;
}

.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;
  padding-right: env(safe-area-inset-right, 0px);
  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: calc(0.85rem + env(safe-area-inset-top, 0px)) 1rem 0.85rem;
  border-bottom: 1px solid var(--idvkm-border-soft);
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.drawer-header .btn {
  flex-shrink: 0;
}

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

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  /*
   * .stack is a grid, and a grid's rows stretch to fill their container by default. The
   * drawer body is as tall as the drawer, so fields spread out with odd gaps between
   * them - very visible once the script hides a row or two.
   */
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.85rem 1rem 1rem;
  overscroll-behavior: contain;
}

.drawer-body input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.drawer-body select,
.drawer-body textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.drawer-body input[type="color"] {
  width: 100%;
  max-width: 12rem;
  height: 2.5rem;
  padding: 0.15rem;
  box-sizing: border-box;
}

.drawer-footer {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  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-footer.toolbar-actions {
  justify-content: flex-end;
}

.drawer-body .toolbar-actions {
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

.drawer-body > .drawer-section-title:first-child,
.drawer-body > section:first-child .drawer-section-title {
  margin-top: 0.15rem;
}

.drawer-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 40rem) {
  .drawer-field-row {
    grid-template-columns: 1fr;
  }
}

.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;
}

/*
 * A display on the class outranks the user-agent [hidden] { display: none } rule, so a
 * label the script hides would otherwise stay on screen - which is how the admin-only
 * person picker leaked into the employee view of the leave drawer.
 */
.stack label[hidden] {
  display: none;
}

.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 .allocation-remove.btn-icon {
  padding: 0.4rem 0.45rem;
}

.allocation-row .allocation-remove .gi {
  width: 0.95rem;
  height: 0.95rem;
}

.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;
  }

  .drawer-header {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .drawer-body {
    padding: 0.75rem;
  }

  .drawer-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .drawer-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .drawer-body .toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .drawer-body .toolbar-actions .btn {
    width: 100%;
    justify-content: center;
  }

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

  .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: var(--idvkm-muted);
}

.forecast-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

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

.forecast-bar.ok {
  background: var(--idvkm-accent);
}

.forecast-bar.under {
  background: var(--idvkm-warn);
}

.forecast-bar.over {
  background: var(--idvkm-danger);
}

.forecast-value {
  text-align: right;
  font-weight: 600;
  color: var(--idvkm-text);
}

/* 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;
  padding: 0.45rem 0.4rem;
  border-radius: 8px;
}

.booking-row.is-clickable {
  cursor: pointer;
}

.booking-row.is-clickable:hover,
.booking-row.is-clickable:focus-visible {
  background: rgba(148, 163, 184, 0.12);
  outline: none;
}

.booking-row.is-active {
  background: rgba(59, 130, 246, 0.12);
}

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

.booking-chart-hit {
  cursor: pointer;
}

.booking-drilldown-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.85rem 1.25rem;
  margin-bottom: 0.75rem;
}

.booking-drilldown-header .panel-section-title {
  margin: 0;
}

.booking-bar-project {
  fill: var(--idvkm-accent);
}

.booking-stack-project {
  background: var(--idvkm-accent);
}

.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;
  }
}

/* Hours matrix: employee × project rows (employee may repeat); day/week columns */
.hours-matrix-wrap,
.report-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--idvkm-border-soft);
  border-radius: 10px;
}

.hours-matrix-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.report-table-wrap {
  overflow: visible;
}

.hours-matrix-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
}

.hours-matrix-wrap .hours-matrix-table {
  width: max-content;
}

.hours-matrix-table th,
.hours-matrix-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--idvkm-border-soft);
  border-right: 1px solid var(--idvkm-border-soft);
}

.hours-matrix-wrap .hours-matrix-table th,
.hours-matrix-wrap .hours-matrix-table td {
  white-space: nowrap;
}

.report-table-wrap .hours-matrix-table th,
.report-table-wrap .hours-matrix-table td {
  white-space: normal;
}

.hours-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--idvkm-panel);
  color: var(--idvkm-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  vertical-align: bottom;
}

.hours-matrix-table .hm-sticky-emp,
.hours-matrix-table .hm-sticky-proj {
  position: sticky;
  z-index: 1;
  background: var(--idvkm-panel);
  text-align: left;
  white-space: normal;
}

.hours-matrix-table .hm-sticky-emp {
  left: 0;
  min-width: 8.5rem;
  max-width: 11rem;
  font-weight: 600;
  color: var(--idvkm-text);
}

.hours-matrix-table .hm-sticky-proj {
  left: 8.5rem;
  min-width: 10rem;
  max-width: 14rem;
}

.hours-matrix-table thead .hm-sticky-emp,
.hours-matrix-table thead .hm-sticky-proj {
  z-index: 3;
}

.hours-matrix-table .hm-emp-repeat {
  color: var(--idvkm-muted);
  font-weight: 500;
}

.hours-matrix-table .hm-swatch {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hours-matrix-table .hm-col {
  min-width: 3.25rem;
}

.hours-matrix-table .hm-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--idvkm-muted);
}

.hours-matrix-table .hm-cell.has-hours {
  color: var(--idvkm-text);
  font-weight: 600;
}

.hours-matrix-table .hm-total-cell {
  color: var(--idvkm-text);
}

.hours-matrix-table .hm-total,
.hours-matrix-table .hm-total-cell {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(148, 163, 184, 0.08);
}

.hours-matrix-table .hm-totals-row th,
.hours-matrix-table .hm-totals-row td {
  border-bottom: none;
  border-top: 1px solid var(--idvkm-border-soft);
}

.hours-matrix-table .hm-grand {
  color: var(--idvkm-accent-bright);
}

.hours-matrix-table tr.is-goals .hm-sticky-proj {
  color: #7dd3fc;
}

.hm-goals-pill {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  vertical-align: middle;
  background: rgba(14, 165, 233, 0.18);
  color: #7dd3fc;
}

.hours-matrix-mobile {
  display: none;
  gap: 0.75rem;
}

.hm-card {
  border: 1px solid var(--idvkm-border-soft);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  background: var(--idvkm-panel);
}

.hm-card.is-goals {
  border-color: rgba(14, 165, 233, 0.35);
}

.hm-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.55rem;
}

.hm-card-project {
  margin-top: 0.2rem;
  color: var(--idvkm-muted);
  font-size: 0.9rem;
}

.hm-card-total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--idvkm-accent-bright);
  white-space: nowrap;
}

.hm-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.45rem;
}

.hm-card-cell {
  display: grid;
  gap: 0.1rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.08);
  font-size: 0.82rem;
}

@media (max-width: 860px) {
  .hours-matrix-desktop {
    display: none;
  }

  .hours-matrix-mobile {
    display: grid;
  }
}

@media (min-width: 861px) {
  .hours-matrix-mobile {
    display: none !important;
  }
}

.leave-report-subtabs {
  margin: 0.35rem 0 0.85rem;
}

.leave-report-table .lr-job-title {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--idvkm-muted);
  white-space: normal;
}

.leave-report-table .lr-period {
  font-variant-numeric: tabular-nums;
  color: var(--idvkm-text);
}

.leave-report-table .lr-order {
  font-variant-numeric: tabular-nums;
  color: var(--idvkm-muted);
  font-size: 0.8rem;
  white-space: normal;
}

.leave-report-table .lr-order-link,
#leave-report-app .lr-order-link {
  color: var(--idvkm-accent-bright);
  text-decoration: none;
  font-weight: 600;
}

.leave-report-table .lr-order-link:hover,
#leave-report-app .lr-order-link:hover {
  text-decoration: underline;
}

.leave-report-table .lr-doc-actions,
#leave-report-app .lr-doc-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
}

.leave-report-table .lr-order-link,
#leave-report-app .lr-order-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.leave-report-table .lr-docs-link,
#leave-report-app .lr-docs-link {
  padding: 0.15rem;
}

.leave-report-table .lr-docs-link:hover,
#leave-report-app .lr-docs-link:hover {
  text-decoration: none;
  color: var(--idvkm-text);
}

.leave-report-table .lr-month-col {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
  color: var(--idvkm-text);
  vertical-align: top;
}

#lr-annual-table .lr-month-col {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 5.5rem;
  background: var(--idvkm-panel);
}

#lr-annual-table .hm-sticky-emp {
  left: 5.5rem;
}

#lr-annual-table thead .lr-month-col {
  z-index: 4;
}

#lr-annual-table thead .hm-sticky-emp {
  left: 5.5rem;
}

.leave-report-table .lr-note {
  white-space: normal;
}

.booking-notes-table .booking-note-cell {
  white-space: normal;
  min-width: 8rem;
  word-break: break-word;
}

.booking-notes-table .booking-task-cell {
  white-space: normal;
  min-width: 8rem;
  word-break: break-word;
}

.booking-notes-table .booking-task-key {
  font-weight: 600;
  color: var(--idvkm-text);
}

.booking-notes-table .booking-task-title {
  color: var(--idvkm-muted);
}

.booking-notes-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.booking-notes-table .booking-estimate-cell {
  white-space: nowrap;
}

.rc-columns-mount {
  display: inline-flex;
  align-items: center;
}

.rc-columns {
  position: relative;
}

.rc-columns-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 30;
  min-width: 12.5rem;
  padding: 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--idvkm-border-soft);
  background: var(--idvkm-panel);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  display: none;
  gap: 0.15rem;
}

.rc-columns.is-open .rc-columns-menu {
  display: grid;
}

.rc-columns-menu[hidden] {
  display: none !important;
}

.rc-columns-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  color: var(--idvkm-text);
  font-size: 0.86rem;
  cursor: pointer;
}

.rc-columns-item:hover {
  background: rgba(148, 163, 184, 0.12);
}

.rc-columns-item.is-required {
  opacity: 0.75;
  cursor: default;
}

.rc-columns-item input {
  margin: 0;
}

[data-col].rc-col-hidden,
[data-col][hidden] {
  display: none !important;
}

.leave-report-table .lr-id-col,
.leave-report-table .lr-egn-col {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.leave-report-table .lr-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.leave-report-table .lr-col-unit {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--idvkm-muted);
}

#lr-balances-table thead th {
  vertical-align: bottom;
  max-width: 9rem;
  white-space: normal;
  line-height: 1.25;
}

.leave-report-table tr.lr-month-start td,
.leave-report-table tr.lr-month-start th {
  border-top: 1px solid var(--idvkm-border);
}

.lr-annual-month {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.lr-annual-month h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--idvkm-text);
}

#reports-app > .page-tab-panel,
#leave-report-app,
#booking-detail-report-app,
#lr-panel-annual,
#lr-panel-monthly,
#lr-panel-balances {
  min-width: 0;
  max-width: 100%;
}

#reports-app > .page-tab-panel,
.time-report-app,
.booking-report-app,
.hours-matrix-app,
.booking-detail-report-app,
#leave-report-app {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

/* Grid items default to min-width: auto and would grow with the table. */
#lr-annual-table-wrap,
#lr-monthly-table-wrap,
#lr-balances-table-wrap,
#bn-table-wrap,
#hm-table-wrap {
  min-width: 0;
  max-width: 100%;
}

.booking-detail-report-app > .panel {
  min-width: 0;
}

.status-pill.is-pending {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

#leave-report-app .is-error {
  color: #fca5a5;
}

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

.forecast-status.ok {
  background: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
}

.forecast-status.warn {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
}

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

.issue-card {
  border: 1px solid var(--idvkm-border);
  border-radius: 10px;
  padding: 0.8rem;
  background: var(--idvkm-elevated);
  color: var(--idvkm-text);
}

.issue-card h3 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  color: var(--idvkm-text);
}

.issue-card.over {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.1);
}

.issue-card.under {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1);
}

.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;
  color: var(--idvkm-text);
}

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

.issue-list span {
  color: var(--idvkm-muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

/* Year goals */

.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: 0;
}

#goals-content {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

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

.goals-goal-panel {
  margin-bottom: 0;
}

.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 var(--idvkm-border);
  border-radius: 8px;
  font: inherit;
  margin-bottom: 0.75rem;
  background: var(--idvkm-input);
  color: var(--idvkm-text);
}

.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: 6.5rem;
  max-width: 10rem;
  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-checkin-timeline {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--idvkm-border-soft, rgba(76, 147, 215, 0.22));
  border-radius: 10px;
  background: color-mix(in srgb, var(--idvkm-elevated) 88%, transparent);
}

.goals-checkin-timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.65rem;
}

.goals-checkin-timeline-head strong {
  color: var(--idvkm-text);
  font-size: 0.92rem;
}

.goals-checkin-timeline-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
  position: relative;
}

.goals-checkin-timeline-track::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0.72rem;
  height: 2px;
  background: color-mix(in srgb, var(--idvkm-accent, #4c93d7) 35%, var(--idvkm-border));
  z-index: 0;
  pointer-events: none;
}

.goals-checkin-node {
  appearance: none;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0.15rem 0.25rem 0.35rem;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: center;
  min-width: 0;
  font: inherit;
}

.goals-checkin-node:focus-visible {
  outline: 2px solid var(--idvkm-accent);
  outline-offset: 2px;
  border-radius: 8px;
}

.goals-checkin-node-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 2px solid var(--idvkm-border);
  background: var(--idvkm-panel);
  box-shadow: 0 0 0 3px var(--idvkm-panel);
}

.goals-checkin-node-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--idvkm-text);
  line-height: 1.2;
}

.goals-checkin-node-meta {
  font-size: 0.68rem;
  color: var(--idvkm-muted);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goals-checkin-node.goals-row-checkin-btn--cc-none .goals-checkin-node-dot {
  border-color: var(--idvkm-border);
  background: var(--idvkm-elevated);
}

.goals-checkin-node.goals-row-checkin-btn--cc-employee .goals-checkin-node-dot {
  border-color: rgba(98, 160, 234, 0.85);
  background: #93c5fd;
}

.goals-checkin-node.goals-row-checkin-btn--cc-manager .goals-checkin-node-dot,
.goals-checkin-node.is-done.goals-row-checkin-btn--cc-manager .goals-checkin-node-dot {
  border-color: rgba(52, 211, 153, 0.85);
  background: #6ee7b7;
}

.goals-checkin-node:hover .goals-checkin-node-label {
  color: var(--idvkm-accent);
}

@media (max-width: 720px) {
  .goals-checkin-timeline-track {
    display: flex;
    overflow-x: auto;
    gap: 0.35rem;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .goals-checkin-timeline-track::before {
    display: none;
  }

  .goals-checkin-node {
    flex: 0 0 4.75rem;
  }
}

.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: var(--idvkm-elevated);
  border-color: var(--idvkm-border);
  color: var(--idvkm-muted);
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-none:hover {
  background: var(--idvkm-input);
  border-color: var(--idvkm-accent);
  color: var(--idvkm-text);
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-employee {
  background: rgba(76, 147, 215, 0.16);
  border-color: rgba(98, 160, 234, 0.55);
  color: #93c5fd;
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-employee:hover {
  background: rgba(76, 147, 215, 0.28);
  border-color: var(--idvkm-accent);
  color: var(--idvkm-text);
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-manager {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-manager:hover {
  background: rgba(52, 211, 153, 0.24);
  border-color: var(--idvkm-ok);
  color: var(--idvkm-text);
}

.goals-year-table .goals-cell-input {
  width: 100%;
  min-width: 160px;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--idvkm-border);
  border-radius: 6px;
  font: inherit;
  resize: vertical;
  background: var(--idvkm-input);
  color: var(--idvkm-text);
}

.goals-year-table .goals-cell-read {
  min-height: 2.5rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--idvkm-text);
}

.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 var(--idvkm-border);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
  background: var(--idvkm-input);
  color: var(--idvkm-text);
}

.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: rgba(76, 147, 215, 0.08);
}

.goals-month-row--reviewed th {
  border-left: 3px solid var(--idvkm-ok);
  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: var(--idvkm-muted);
}

.goals-modal-icon-btn:hover {
  color: var(--idvkm-text);
  background: var(--idvkm-elevated);
}

.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 var(--idvkm-border);
  border-radius: 6px;
  font: inherit;
  background: var(--idvkm-input);
  color: var(--idvkm-text);
}

.goals-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--idvkm-border-soft);
}

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

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

#goals-dialog {
  z-index: 1100;
}

#goals-dialog-backdrop {
  z-index: 1099;
}

#goals-dialog-body {
  white-space: pre-wrap;
}

#goals-dialog-input {
  width: 100%;
}

.ts-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0.65rem 0.15rem 0;
  font-size: 0.82rem;
}

.ts-legend span {
  color: var(--idvkm-muted);
}

.checkin-notes[readonly] {
  background: var(--idvkm-input);
  color: var(--idvkm-muted);
}

/* 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-toolbar-row > .toolbar-actions {
  margin-left: auto;
}

#ts-sticky-save-btn {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35), 0 0 18px rgba(56, 189, 248, 0.28);
  animation: ts-save-pulse 1.6s ease-in-out infinite;
}

@keyframes ts-save-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3), 0 0 12px rgba(56, 189, 248, 0.2); }
  50% { box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.55), 0 0 22px rgba(56, 189, 248, 0.4); }
}

.ts-sticky-save {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: rgba(15, 23, 42, 0.94);
  border-top: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.ts-sticky-save-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ts-sticky-save-msg {
  margin: 0;
  color: var(--idvkm-text);
  font-size: 0.95rem;
}

.ts-sticky-save-msg strong {
  color: var(--idvkm-accent-bright);
}

body.ts-has-sticky-save {
  padding-bottom: 5.5rem;
}

@media (max-width: 640px) {
  .ts-sticky-save-inner {
    align-items: stretch;
  }
  .ts-sticky-save-inner .toolbar-actions {
    width: 100%;
    justify-content: stretch;
  }
  .ts-sticky-save-inner .toolbar-actions .btn {
    flex: 1;
  }
}

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

.timesheet-scroll {
  overflow-x: auto;
  max-width: 100%;
}

/*
 * .app-shell is a grid, and a grid item defaults to min-width: auto, so a sheet
 * wider than the page would stretch its panel instead of scrolling inside it.
 */
.timesheet-app > * {
  min-width: 0;
}

.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 var(--idvkm-border-soft);
  border-right: 1px solid var(--idvkm-border-soft);
  padding: 0.35rem 0.4rem;
  vertical-align: middle;
}

.timesheet-grid thead th {
  background: var(--idvkm-surface);
  color: var(--idvkm-text);
  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: var(--idvkm-elevated);
  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: var(--idvkm-surface);
  z-index: 3;
}

.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 {
  width: 6.6rem;
  min-width: 6.2rem;
  text-align: center;
  vertical-align: top;
}

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

.timesheet-grid thead .ts-col-day.is-weekend {
  background: var(--idvkm-elevated);
}

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

/* Week | Month switch above the period navigator. */
.timesheet-mode-tabs {
  margin-bottom: 0;
}

.timesheet-mode-tabs #ts-this-period {
  margin: 0 0 0.35rem 0.75rem;
}

.timesheet-app .week-nav-panel {
  border-top-left-radius: 0;
}

/*
 * The month sheet is the same grid over 28-31 columns, so every column has to
 * shrink. It still scrolls sideways, with the project name pinned to the left.
 */
.timesheet-grid.is-month {
  min-width: 1420px;
  font-size: 0.84rem;
}

.timesheet-grid.is-month th,
.timesheet-grid.is-month td {
  padding: 0.3rem 0.15rem;
}

.timesheet-grid.is-month .ts-col-project {
  min-width: 170px;
}

.timesheet-grid.is-month .ts-col-day {
  width: 2.9rem;
  min-width: 2.9rem;
}

.timesheet-grid.is-month thead .ts-col-day {
  font-size: 0.68rem;
  letter-spacing: 0;
  padding: 0.3rem 0.1rem;
  white-space: nowrap;
}

/* A visible seam every Monday, so a day column can be found by eye. */
.timesheet-grid.is-month .ts-col-day.is-week-start {
  border-left: 2px solid var(--idvkm-border);
}

.timesheet-grid.is-month .ts-day-cell {
  gap: 0.15rem;
}

.timesheet-grid.is-month .ts-hour-input {
  padding: 0.3rem 0.1rem;
}

/* No room for the word; the chip becomes a dot that keeps its note state. */
.timesheet-grid.is-month .ts-note-chip {
  font-size: 0;
  line-height: 0;
  padding: 0.28rem;
  border-radius: 999px;
}

.timesheet-grid.is-month .ts-note-chip::after {
  content: "";
  display: block;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 999px;
  background: currentColor;
}

.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 var(--idvkm-border);
  border-radius: 6px;
  text-align: center;
  font: inherit;
  background: var(--idvkm-input);
  color: var(--idvkm-text);
  box-sizing: border-box;
}

.ts-hour-input:focus {
  outline: 2px solid rgba(76, 147, 215, 0.45);
  border-color: var(--idvkm-accent);
}

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

.ts-hour-input.is-booked-zero {
  border-color: var(--idvkm-accent);
  background: rgba(76, 147, 215, 0.16);
}

.ts-hour-input.is-unbooked {
  color: var(--idvkm-muted);
}

.ts-note-chip {
  appearance: none;
  border: 1px dashed var(--idvkm-border);
  background: transparent;
  color: var(--idvkm-muted);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  cursor: pointer;
  align-self: center;
}

.ts-note-chip.has-note {
  border-style: solid;
  border-color: var(--idvkm-accent);
  background: rgba(76, 147, 215, 0.18);
  color: #7dd3fc;
}

.ts-note-chip:disabled {
  opacity: 0.55;
  cursor: default;
}

.ts-note-drawer {
  width: min(26rem, 100vw);
  max-width: 100vw;
}

.ts-note-drawer .ts-note-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  overscroll-behavior: contain;
}

.ts-note-drawer .ts-note-body label {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.ts-note-drawer .ts-note-body input,
.ts-note-drawer .ts-note-body select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ts-note-drawer .ts-note-body > .toolbar-actions {
  margin-top: auto;
  padding-top: 0.35rem;
  flex-wrap: wrap;
}

.ts-note-body {
  padding: 0;
}

.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: var(--idvkm-text);
}

.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 var(--idvkm-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: var(--idvkm-elevated);
}

.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: var(--idvkm-text);
  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-holiday-mark {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.3rem;
  border-radius: 50%;
  background: #fbbf24;
  vertical-align: middle;
}

.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-chip {
  border-color: rgba(148, 163, 184, 0.45);
  color: var(--idvkm-muted);
}

.ts-note-chip.has-note {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(14, 165, 233, 0.15);
  color: #7dd3fc;
}

.ts-note-chip.ts-issue-chip {
  font-size: 0.68rem;
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ts-note-chip.ts-issue-chip.has-note {
  border-color: rgba(249, 115, 22, 0.55);
  color: #fdba74;
  font-weight: 600;
}

.period-nav-badge.is-current,
.ts-week-period-badge.is-current {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(74, 222, 128, 0.55);
}

.period-nav-badge.is-past,
.ts-week-period-badge.is-past {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.45);
}

.period-nav-badge.is-future,
.ts-week-period-badge.is-future {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.55);
}

.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);
}

.checkin-notes[readonly] {
  background: var(--idvkm-input);
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-none {
  background: rgba(148, 163, 184, 0.12);
  border-color: var(--idvkm-border);
  color: var(--idvkm-muted);
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-none:hover {
  background: rgba(148, 163, 184, 0.22);
  border-color: var(--idvkm-muted);
  color: var(--idvkm-text);
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-employee {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(96, 165, 250, 0.45);
  color: #93c5fd;
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-employee:hover {
  background: rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-manager {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.goals-row-checkin-btn.goals-row-checkin-btn--cc-manager:hover {
  background: rgba(52, 211, 153, 0.28);
  color: #a7f3d0;
}

.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;
}

/* ---- Issues tracker ---- */
#issues-app {
  overflow-x: clip;
}

#issues-app > .panel {
  max-width: 100%;
  min-width: 0;
}

.issues-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
}

.issues-toolbar .goals-field {
  flex: 1 1 10rem;
  min-width: 0;
  max-width: 100%;
}

.issues-toolbar .goals-field input,
.issues-toolbar .goals-field select {
  width: 100%;
}

.issues-toolbar .toolbar-actions {
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.issues-view-toggle {
  display: inline-flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.issues-view-toggle .btn.is-active {
  background: var(--idvkm-accent-deep);
  border-color: var(--idvkm-accent);
  color: var(--idvkm-text);
}

.issues-list {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Dedicated hierarchy view (not a table) */
.issues-tree {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.issues-tree-project {
  border: 1px solid var(--idvkm-border-soft);
  border-radius: 0.65rem;
  background: rgba(15, 23, 42, 0.45);
  overflow: hidden;
}

.issues-tree-project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--idvkm-elevated);
  border-bottom: 1px solid var(--idvkm-border-soft);
}

.issues-tree-project-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: var(--idvkm-text);
}

.issues-tree-nodes {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 0.9rem 1rem;
}

.issue-tree-node {
  border: 1px solid var(--idvkm-border);
  border-radius: 0.55rem;
  background: var(--idvkm-elevated);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.issue-tree-node:hover {
  border-color: rgba(76, 147, 215, 0.55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.issue-tree-node.is-story {
  border-left: 3px solid var(--idvkm-accent);
}

.issue-tree-node.is-child {
  border-left: 3px solid rgba(148, 163, 184, 0.45);
  background: var(--idvkm-panel);
}

.issue-tree-node-main {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
}

.issue-tree-node-body {
  flex: 1 1 auto;
  min-width: 0;
}

.issue-tree-node-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin-bottom: 0.3rem;
}

.issue-tree-key {
  font-size: 0.85rem;
  color: var(--idvkm-accent-bright);
}

.issue-tree-node-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--idvkm-text);
  overflow-wrap: anywhere;
  margin-bottom: 0.25rem;
}

.issue-tree-node-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  font-size: 0.82rem;
}

.issue-tree-progress {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--idvkm-muted);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--idvkm-border-soft);
  background: rgba(0, 0, 0, 0.18);
}

.issue-tree-children {
  position: relative;
  margin: 0 0.75rem 0.75rem 2rem;
  padding: 0.15rem 0 0.15rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.issue-tree-children::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2rem;
  bottom: 0.85rem;
  width: 2px;
  background: rgba(76, 147, 215, 0.35);
  border-radius: 1px;
}

.issue-tree-child-wrap {
  position: relative;
}

.issue-tree-child-wrap::before {
  content: "";
  position: absolute;
  left: -0.85rem;
  top: 1.15rem;
  width: 0.75rem;
  height: 2px;
  background: rgba(76, 147, 215, 0.35);
}

.issue-tree-toggle {
  appearance: none;
  box-sizing: border-box;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  margin: 0.1rem 0 0;
  flex: 0 0 auto;
  border: 1px solid var(--idvkm-border);
  border-radius: 0.3rem;
  background: var(--idvkm-bg);
  color: var(--idvkm-text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.issue-tree-toggle:hover {
  border-color: var(--idvkm-accent);
  color: var(--idvkm-accent-bright);
}

.issue-tree-toggle.is-expanded {
  border-color: rgba(76, 147, 215, 0.55);
  color: var(--idvkm-accent-bright);
  background: rgba(76, 147, 215, 0.12);
}

.issue-tree-toggle.is-leaf {
  border-color: transparent;
  background: transparent;
  cursor: default;
  visibility: hidden;
}

#issue-tree-toggle.is-active {
  background: var(--idvkm-accent-deep);
  border-color: var(--idvkm-accent);
  color: var(--idvkm-text);
}

.issues-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

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

.issues-table th {
  color: var(--idvkm-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.issues-row {
  cursor: pointer;
}

.issues-row:hover {
  background: var(--idvkm-elevated);
}

.issue-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.1rem 0.45rem;
  border-radius: 0.35rem;
  font-size: 0.78rem;
  background: var(--idvkm-elevated);
  border: 1px solid var(--idvkm-border);
  color: var(--idvkm-text);
  text-transform: capitalize;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.2;
}

.issue-type-pill {
  gap: 0.35rem;
  padding: 0.15rem 0.5rem 0.15rem 0.35rem;
  font-weight: 600;
}

.issue-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  border-radius: 0.25rem;
  background: rgba(0, 0, 0, 0.22);
}

.issue-type-icon svg {
  width: 0.85rem;
  height: 0.85rem;
  display: block;
}

.issue-type-label {
  text-transform: capitalize;
}

.issue-bookable-pill.is-bookable {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.issue-bookable-pill.is-nonbookable {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.4);
  color: var(--idvkm-muted);
}

.estimate-pill {
  text-transform: none;
}

.estimate-pill-symbol {
  font-size: 0.7rem;
  line-height: 1;
}

.estimate-pill-hours {
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

.estimate-pill.is-above {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.estimate-pill.is-below {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

.estimate-pill.is-fine {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.issue-bookable-inline {
  color: var(--idvkm-muted);
  font-style: italic;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.issue-pill.status-done,
.issue-pill.status-cancelled {
  color: var(--idvkm-muted);
}

.issue-pill.status-in_progress,
.issue-pill.status-in_review {
  border-color: rgba(76, 147, 215, 0.55);
  color: var(--idvkm-accent-bright);
}

/* Blocked is stalled, not in flight: amber so it does not read as progress. */
.issue-pill.status-blocked {
  border-color: rgba(251, 191, 36, 0.6);
  color: var(--idvkm-warn);
  background: rgba(251, 191, 36, 0.12);
}

.issue-pill.type-bug {
  border-color: rgba(248, 113, 113, 0.65);
  color: var(--idvkm-danger);
  background: rgba(248, 113, 113, 0.12);
}

.issue-pill.type-story {
  border-color: rgba(76, 147, 215, 0.65);
  color: var(--idvkm-accent-bright);
  background: rgba(76, 147, 215, 0.14);
}

.issue-pill.type-task {
  border-color: rgba(148, 163, 184, 0.55);
  color: var(--idvkm-text);
  background: rgba(148, 163, 184, 0.12);
}

.issue-pill.type-improvement {
  border-color: rgba(52, 211, 153, 0.6);
  color: var(--idvkm-ok);
  background: rgba(52, 211, 153, 0.12);
}

.issue-link-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--idvkm-accent-bright);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.issue-link-btn:hover {
  text-decoration: underline;
}

.issue-parent-link {
  margin: 0 0 0.5rem;
  color: var(--idvkm-muted);
  font-size: 0.9rem;
}

.issue-child-marker {
  color: var(--idvkm-muted);
  margin-right: 0.15rem;
}

.issue-progress {
  font-variant-numeric: tabular-nums;
  color: var(--idvkm-muted);
  font-size: 0.85rem;
}

.issue-card-parent,
.issue-card-progress {
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}

.issue-children-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.issue-children-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.45rem 0.55rem;
  background: var(--idvkm-elevated);
  border: 1px solid var(--idvkm-border-soft);
  border-radius: 0.4rem;
}

.issue-child-title {
  color: var(--idvkm-text);
  overflow-wrap: anywhere;
}

/* Board: assignee swimlanes × status columns; status headers flush inside each lane */
.issues-board {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.issues-swim-board {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: min(100%, 48rem);
}

.issues-swim-lane {
  background: var(--idvkm-panel);
  border: 1px solid var(--idvkm-border-soft);
  border-radius: 0.55rem;
  overflow: hidden;
}

.issues-swim-lane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.75rem;
  background: var(--idvkm-elevated);
  border-bottom: 1px solid var(--idvkm-border-soft);
}

.issues-swim-lane-name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--idvkm-text);
}

.issues-swim-lane-grid {
  display: grid;
  grid-template-columns: repeat(var(--board-cols, 4), minmax(10rem, 1fr));
  grid-template-rows: auto 1fr;
  grid-auto-flow: column;
  gap: 0;
  align-items: stretch;
}

.issues-swim-col-title {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: capitalize;
  color: var(--idvkm-muted);
  padding: 0.5rem 0.55rem;
  background: var(--idvkm-panel);
  border-bottom: 1px solid var(--idvkm-border-soft);
  border-right: 1px solid var(--idvkm-border-soft);
  text-align: center;
}

.issues-swim-lane-grid > .issues-swim-col-title:nth-last-child(2) {
  border-right: none;
}

.issues-swim-cell,
.issue-column-body {
  min-height: 5.5rem;
  max-height: 18rem;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--idvkm-bg);
  border-right: 1px solid var(--idvkm-border-soft);
  min-width: 0;
}

.issues-swim-lane-grid > .issues-swim-cell:last-child {
  border-right: none;
}

.issues-swim-cell.is-drop-target,
.issue-column-body.is-drop-target {
  outline: 1px dashed var(--idvkm-accent);
  outline-offset: -2px;
  background: rgba(76, 147, 215, 0.08);
}

.issue-card-assignee {
  color: var(--idvkm-text);
  font-weight: 600;
}

.issue-card {
  background: var(--idvkm-elevated);
  border: 1px solid var(--idvkm-border);
  border-radius: 0.4rem;
  padding: 0.4rem 0.5rem;
  cursor: grab;
  touch-action: manipulation;
  min-width: 0;
}

.issue-card.is-dragging {
  opacity: 0.55;
}

.issue-card-key {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
  flex-wrap: nowrap;
}

.issue-card-title {
  font-size: 0.88rem;
  line-height: 1.25;
  margin-bottom: 0.2rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.issue-card-meta {
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.issues-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 0.75rem;
  align-items: end;
}

.issue-booked-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 3.4rem;
  justify-content: flex-end;
  padding-bottom: 0.2rem;
}

.issue-booked-wrap strong {
  font-variant-numeric: tabular-nums;
  color: var(--idvkm-text);
  font-size: 1rem;
}

.issue-estimate-status {
  min-height: 1.35rem;
}

.issues-comments {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  max-height: 240px;
  overflow-y: auto;
}

.issue-comment {
  background: var(--idvkm-elevated);
  border: 1px solid var(--idvkm-border-soft);
  border-radius: 0.4rem;
  padding: 0.55rem 0.7rem;
}

.issue-comment-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-bottom: 0.3rem;
}

.issue-comment-head .issue-comment-meta {
  flex: 1 1 auto;
}

.issue-comment-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 0.65rem;
  align-items: baseline;
}

.issue-comment-edit-btn,
.issue-comment-delete {
  border: none;
  background: transparent;
  color: var(--idvkm-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  padding: 0;
  text-decoration: underline;
}

.issue-comment-edit-btn:hover {
  color: var(--idvkm-accent);
}

.issue-comment-delete:hover {
  color: var(--idvkm-danger, #e57373);
}

.issue-comment-edit {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.issue-comment-edit[hidden] {
  display: none !important;
}

.issue-comment-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.issue-comment-body {
  white-space: pre-wrap;
  color: var(--idvkm-text);
  overflow-wrap: anywhere;
}

.issue-mention {
  color: var(--idvkm-accent);
  font-weight: 600;
}

.issue-comment-compose {
  position: relative;
  display: block;
}

.issue-comment-compose textarea {
  width: 100%;
}

.issue-mention-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  margin: 0 0 0.25rem;
  padding: 0.25rem 0;
  list-style: none;
  max-height: 10rem;
  overflow-y: auto;
  background: var(--idvkm-elevated);
  border: 1px solid var(--idvkm-border-soft);
  border-radius: 0.4rem;
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.35);
  z-index: 5;
}

.issue-mention-menu li {
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  color: var(--idvkm-text);
}

.issue-mention-menu li.is-active,
.issue-mention-menu li:hover {
  background: rgba(76, 147, 215, 0.18);
}

.issue-comment-hint {
  margin: 0.35rem 0 0.55rem;
}

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

@media (max-width: 900px) {
  .issues-toolbar .toolbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .issues-toolbar .toolbar-actions .btn,
  .issues-view-toggle {
    flex: 1 1 auto;
  }

  .issues-view-toggle .btn {
    flex: 1 1 auto;
  }

  .issues-swim-lane-grid {
    grid-template-columns: repeat(var(--board-cols, 4), minmax(9rem, 1fr));
  }
}

@media (max-width: 640px) {
  .issues-toolbar .goals-field {
    flex: 1 1 100%;
  }

  .issues-swim-board {
    min-width: 0;
  }

  .issues-swim-lane-grid {
    display: flex;
    flex-direction: column;
  }

  .issues-swim-col-title {
    border-right: none;
    border-radius: 0;
  }

  .issues-swim-cell {
    max-height: 14rem;
    border-right: none;
    border-bottom: 1px solid var(--idvkm-border-soft);
  }

  .issues-swim-cell:last-child {
    border-bottom: none;
  }

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

.whisky-schedule-hint {
  align-self: center;
  white-space: nowrap;
  font-size: 0.85rem;
}

#whisky-search-app .toolbar-actions {
  align-items: center;
  flex-wrap: wrap;
}

/* Whisky live scrape log (Get prices) */
.whisky-scrape-log {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 1rem;
  max-height: 16rem;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--idvkm-ink, #1a1a1a);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
}

.whisky-sale {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #7a3410;
  background: rgba(180, 83, 9, 0.14);
  border-radius: 3px;
}

.whisky-oos {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #6b7280;
  background: rgba(107, 114, 128, 0.12);
  border-radius: 3px;
}

.whisky-add-bottle {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem 1rem;
  margin: 0.75rem 0 1rem;
}

.whisky-add-bottle .inline-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--idvkm-muted, #5a5a5a);
}

.whisky-add-bottle .inline-field[hidden] {
  display: none !important;
}

.whisky-add-bottle input,
.whisky-add-bottle select {
  min-width: 12rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 4px;
  font: inherit;
  color: inherit;
  background: #fff;
}

.whisky-add-bottle input:focus,
.whisky-add-bottle select:focus {
  outline: 2px solid rgba(31, 111, 91, 0.35);
  outline-offset: 1px;
}

.whisky-detail-title {
  cursor: pointer;
  display: inline-block;
}

.whisky-detail-title:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

#whisky-edit-bottle-panel[hidden] {
  display: none !important;
}

.whisky-edit-bottle {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem 1rem;
  margin: 0.25rem 0 0;
}

.whisky-edit-bottle .inline-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--idvkm-muted, #5a5a5a);
}

.whisky-edit-bottle .whisky-edit-description-field {
  flex: 1 1 100%;
}

.whisky-edit-bottle input,
.whisky-edit-bottle textarea {
  min-width: 8rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 4px;
  font: inherit;
  color: inherit;
  background: #fff;
}

.whisky-edit-bottle textarea {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
}

.whisky-edit-bottle input:focus,
.whisky-edit-bottle textarea:focus {
  outline: 2px solid rgba(31, 111, 91, 0.35);
  outline-offset: 1px;
}

.whisky-edit-bottle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

#whisky-description-panel[hidden] {
  display: none !important;
}

.whisky-collapsible-title {
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
}

.whisky-collapsible-title:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.whisky-collapsible-panel.is-collapsed .whisky-collapsible-body {
  display: none;
}

.whisky-collapsible-panel:not(.is-collapsed) .whisky-collapsible-body {
  margin-top: 0.65rem;
}

.whisky-collapsible-panel.is-collapsed {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.whisky-detail-description {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.9rem;
}

.whisky-offer-maps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.whisky-offer-map-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem 1rem;
}

.whisky-offer-map-row .inline-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 18rem;
  font-size: 0.85rem;
  color: var(--idvkm-muted, #5a5a5a);
}

.whisky-offer-map-row .inline-field > span:first-child {
  font-weight: 600;
  color: inherit;
}

.whisky-offer-map-row select {
  width: 100%;
  min-width: 16rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 4px;
  font: inherit;
  color: inherit;
  background: #fff;
}

.whisky-offer-map-row select:focus {
  outline: 2px solid rgba(31, 111, 91, 0.35);
  outline-offset: 1px;
}

.whisky-offer-map-row .whisky-offer-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.table-sort,
#whisky-table .whisky-sort {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
}

.table-sort:hover,
.table-sort.is-active,
#whisky-table .whisky-sort:hover,
#whisky-table .whisky-sort.is-active {
  color: var(--idvkm-accent, #4c93d7);
}

.table-sort:focus-visible,
#whisky-table .whisky-sort:focus-visible {
  outline: 2px solid rgba(76, 147, 215, 0.35);
  outline-offset: 2px;
}

.table-sort-arrow {
  font-weight: 600;
  white-space: pre;
}

#whisky-table .whisky-row-actions {
  white-space: nowrap;
  text-align: right;
}

.whisky-star-text {
  color: #eab308;
  letter-spacing: 0.06em;
}

.whisky-rating-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0.75rem 0 1rem;
}

.whisky-stars {
  display: inline-flex;
  gap: 0.15rem;
}

.whisky-star {
  appearance: none;
  background: none;
  border: 0;
  padding: 0 0.05rem;
  margin: 0;
  font-size: 1.45rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}

.whisky-star.is-on {
  color: #eab308;
}

.whisky-star:focus-visible {
  outline: 2px solid rgba(31, 111, 91, 0.35);
  outline-offset: 2px;
  border-radius: 4px;
}

.whisky-comment-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0.5rem 0 1.25rem;
}

.whisky-comment-field {
  width: 100%;
}

.whisky-comment-form textarea {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 4px;
  font: inherit;
  color: inherit;
  background: #fff;
}

.whisky-comment-form textarea:focus {
  outline: 2px solid rgba(31, 111, 91, 0.35);
  outline-offset: 1px;
}

.whisky-comments {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.whisky-comment {
  border-top: 1px solid var(--idvkm-border, rgba(0, 0, 0, 0.12));
  padding-top: 0.75rem;
}

.whisky-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.35rem;
}

.whisky-comment-body {
  margin: 0;
  white-space: pre-wrap;
}

.liver-disclaimer {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.08);
  color: var(--idvkm-text);
}

.liver-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0 0 1rem;
}

.liver-kpi {
  border: 1px solid var(--idvkm-border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: var(--idvkm-elevated);
}

.liver-kpi-label,
.liver-kpi-hint {
  margin: 0;
  color: var(--idvkm-muted);
  font-size: 0.82rem;
}

.liver-kpi-value {
  margin: 0.25rem 0 0.2rem;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--idvkm-text);
}

.liver-kpi-index.is-speyside .liver-kpi-value { color: var(--idvkm-ok); }
.liver-kpi-index.is-elevated .liver-kpi-value { color: var(--idvkm-accent-bright); }
.liver-kpi-index.is-management .liver-kpi-value { color: var(--idvkm-warn); }
.liver-kpi-index.is-cask .liver-kpi-value,
.liver-kpi-index.is-islay .liver-kpi-value { color: var(--idvkm-danger); }

.liver-protocol {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: var(--idvkm-text);
}

.liver-protocol li + li {
  margin-top: 0.45rem;
}

.liver-toolbar-title {
  margin: 0;
  flex: 1;
}

@media (max-width: 900px) {
  .liver-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ---- Invoicing: Reports > Invoices, the rate editor, and Settings > Billing ---- */

/* Figures line up column to column, so a wrong total is visible at a glance. */
.invoice-lines-table .num,
.invoice-list-table .num,
.project-rates-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.invoice-lines-table tfoot th,
.invoice-lines-table tfoot td {
  background: var(--idvkm-elevated);
  font-weight: 600;
}

.invoice-lines-table tfoot th {
  text-align: right;
  color: var(--idvkm-muted);
}

.invoice-lines-table tfoot tr.invoice-grand th,
.invoice-lines-table tfoot tr.invoice-grand td {
  color: var(--idvkm-text);
  font-size: 1rem;
  border-top: 2px solid var(--idvkm-accent);
}

.invoice-role {
  display: block;
  font-size: 0.76rem;
}

/* Everything standing between here and an invoice, in one place above the button. */
.invoice-problems {
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.invoice-problems-title {
  margin: 0 0 0.4rem;
  font-weight: 600;
  color: var(--idvkm-warn);
}

.invoice-problems ul {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--idvkm-text);
}

.invoice-issue-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

.invoice-notes-field {
  flex: 1 1 22rem;
  min-width: 0;
}

.invoice-voided td {
  color: var(--idvkm-muted);
}

.invoice-voided td:first-child {
  text-decoration: line-through;
}

/*
 * Rates on the project drawer.
 *
 * The :not([hidden]) guard matters: a bare `display: flex` outranks the user-agent
 * [hidden] { display: none } rule, so the section would stay on screen even when the
 * script hides it — which is what happens for Add Project, where there is no project to
 * price yet.
 */
.project-rates-section[hidden] {
  display: none;
}

.project-rates-section:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/*
 * One rate, laid out for the ~500px project drawer: person across the top, then the
 * money and the validity window two-up. A single wide row is not possible at this
 * width, so every field is labelled rather than relying on a shared header.
 */
.project-rate-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.5rem;
  padding: 0.6rem;
  border: 1px solid var(--idvkm-border-soft);
  border-radius: 8px;
  background: var(--idvkm-elevated);
  min-width: 0;
}

.project-rate-row .pr-field-wide {
  grid-column: 1 / -1;
}

.project-rate-row .pr-field {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.project-rate-row .pr-field > span {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--idvkm-muted);
}

.project-rate-row input,
.project-rate-row select {
  width: 100%;
  min-width: 0;
}

.project-rate-row .pr-remove {
  grid-column: 1 / -1;
  justify-self: start;
}

.project-rate-default input[readonly] {
  background: var(--idvkm-elevated);
  color: var(--idvkm-muted);
}

.billing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.75rem;
}

/* Same idiom as .stack label: caption above its control, never beside it. */
.billing-grid label,
.billing-footer-note {
  display: grid;
  gap: 0.3rem;
  align-content: start;
}

.billing-footer-note {
  margin-top: 0.75rem;
}

/*
 * Issuing an invoice cannot be undone, so a disabled Issue button has to look disabled.
 * Scoped to invoicing on purpose: the app has no global .btn:disabled style, and adding
 * one here would restyle every button on every page.
 */
.invoice-issue-row .btn:disabled,
#ir-issue:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Admin/HR-only block in the leave drawer: filing on behalf of someone else. */
.leave-admin-options {
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--idvkm-border);
  border-radius: 9px;
  background: var(--idvkm-elevated);
}

.leave-admin-options[hidden] {
  display: none;
}

#leave-admin-hint {
  margin: 0;
  font-size: 0.82rem;
}
