/* Technovators Intern Register — inspired by technovators.co.za
   Similar mood (dark tech + green), not a 1:1 copy of the public site. */

:root {
  --ink: #e8eef4;
  --ink-soft: #93a4b5;
  --ink-mute: #6f8194;
  --desk: #0c1218;
  --desk-lift: #121a22;
  --panel: #162029;
  --panel-soft: rgba(22, 32, 41, 0.88);
  --line: rgba(120, 200, 110, 0.16);
  --line-soft: rgba(232, 238, 244, 0.08);
  --brand: #3ebd4a;
  --brand-deep: #1f6b2c;
  --brand-bright: #5ad466;
  --accent: #f0b429;
  --accent-soft: rgba(240, 180, 41, 0.14);
  --accent-ink: #1a1400;
  --warn: #e6a23c;
  --danger: #e86a62;
  --ok: #3ebd4a;
  --paper: var(--panel);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --control-h: 40px;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Manrope", "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-stamp: cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="light"] {
  color-scheme: light;
  --ink: #18242d;
  --ink-soft: #53616d;
  --ink-mute: #6d7b86;
  --desk: #e7ece3;
  --desk-lift: #f3f2e8;
  --panel: #f7f4e8;
  --panel-soft: rgba(247, 244, 232, 0.95);
  --line: rgba(31, 107, 44, 0.2);
  --line-soft: rgba(24, 36, 45, 0.12);
  --brand: #238d2f;
  --brand-deep: #176b22;
  --brand-bright: #168229;
  --danger: #b42318;
  --ok: #238d2f;
  --paper: #f7f4e8;
  --shadow: 0 14px 40px rgba(23, 42, 52, 0.12);
  --shadow-lg: 0 24px 60px rgba(23, 42, 52, 0.18);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  scrollbar-color: var(--brand) #080c10;
  scrollbar-width: thin;
}

html[data-theme="light"] {
  scrollbar-color: var(--brand) #e2eaed;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #080c10;
}

html[data-theme="light"] ::-webkit-scrollbar-track {
  background: #e2eaed;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-bright), var(--brand-deep));
}

body {
  line-height: 1.55;
  background:
    radial-gradient(ellipse 70% 45% at 10% -5%, rgba(62, 189, 74, 0.14), transparent 50%),
    radial-gradient(ellipse 50% 40% at 95% 5%, rgba(240, 180, 41, 0.08), transparent 45%),
    linear-gradient(165deg, #101820 0%, var(--desk) 48%, #090d12 100%);
  background-attachment: fixed;
}

html[data-theme="light"] body {
  background:
    radial-gradient(ellipse 70% 45% at 10% -5%, rgba(62, 189, 74, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 40% at 95% 5%, rgba(240, 180, 41, 0.1), transparent 45%),
    linear-gradient(165deg, #f5f2e6 0%, var(--desk) 48%, #dde8dd 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(62, 189, 74, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 189, 74, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 40% 20%, black 15%, transparent 72%);
}

::selection {
  background: rgba(62, 189, 74, 0.35);
  color: #fff;
}

a {
  color: var(--brand-bright);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-shell,
.app-shell {
  position: relative;
  z-index: 1;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeRise 0.65s var(--ease-out) both;
}

.auth-card {
  position: relative;
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--panel-soft);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 11px;
  color: var(--ink-soft);
  background: rgba(8, 12, 16, 0.42);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--display);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  color: var(--ink);
  background: rgba(62, 189, 74, 0.12);
  border-color: rgba(62, 189, 74, 0.35);
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.auth-card > .theme-toggle {
  position: absolute;
  top: 14px;
  left: 18px;
}

.page-live-bar .theme-toggle {
  margin-left: 8px;
}

html[data-theme="light"] .theme-toggle {
  background: rgba(247, 244, 232, 0.92);
}

.auth-brand {
  padding: 42px 36px;
  background:
    linear-gradient(155deg, rgba(62, 189, 74, 0.12), transparent 60%),
    #101820;
  border-right: 1px solid var(--line-soft);
}

.auth-brand img {
  width: 180px;
  margin-bottom: 26px;
}

.auth-brand h1 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  line-height: 1.1;
  color: #fff;
}

.auth-brand p {
  margin: 0;
  max-width: 32ch;
  color: var(--ink-soft);
}

.auth-form {
  padding: 42px 36px;
}

.auth-form h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  color: #fff;
}

.auth-form .lede {
  margin: 0 0 20px;
  color: var(--ink-soft);
}

.welcome-message {
  position: relative;
  display: grid;
  gap: 2px;
  min-height: 3.4em;
  padding: 2px 0 2px 12px;
  overflow: hidden;
  max-width: 100%;
}

.welcome-message::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--brand-bright);
  box-shadow: 0 0 8px var(--brand), 0 0 20px rgba(90, 212, 102, 0.7);
  animation: welcomeBeacon 2.8s ease-in-out 900ms infinite;
}

.welcome-message__line {
  display: block;
  white-space: nowrap;
  line-height: 1.4;
}

.welcome-message__word {
  display: inline-block;
  margin-right: 0.22em;
  transform-origin: 50% 100%;
  animation: welcomeWordLaunch 900ms var(--ease-out) both;
  animation-delay: calc(80ms + (var(--word-index) * 70ms));
}

.welcome-message__line--primary {
  color: #fff;
  font-weight: 700;
}

.welcome-message__line--primary .welcome-message__word {
  animation-name: welcomeWordLaunch, welcomeWordSurge;
  animation-duration: 900ms, 3.2s;
  animation-timing-function: var(--ease-out), ease-in-out;
  animation-iteration-count: 1, infinite;
  animation-fill-mode: both, both;
  animation-delay: calc(80ms + (var(--word-index) * 70ms)), 1.1s;
}

.welcome-message__line--primary .welcome-message__word--brand {
  color: var(--brand-bright);
}

.welcome-message__line--secondary {
  color: var(--brand-bright);
  font-weight: 600;
  font-size: 0.92em;
}

.role-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  background: var(--desk);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.role-toggle button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}

.role-toggle button.active {
  background: var(--brand);
  color: #061008;
}

.field {
  margin-bottom: 14px;
  min-width: 0;
  max-width: 100%;
}

/* Native fieldset min-width:min-content overflows cards on phones */
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  max-width: 100%;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-family: var(--display);
}

.field input,
.field select,
.field textarea,
.inline-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line-soft);
  background: var(--desk);
  color: var(--ink);
  border-radius: 10px;
  padding: 11px 12px;
  min-height: var(--control-h);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  /* Keep native calendar/clear icons from covering typed values */
  background-clip: padding-box;
}

.field input[type="date"],
.field input[type="month"],
.field input[type="datetime-local"],
.field input[type="time"] {
  display: block;
  -webkit-appearance: none;
  appearance: none;
  color-scheme: dark;
}

html[data-theme="light"] .field input[type="date"],
html[data-theme="light"] .field input[type="month"],
html[data-theme="light"] .field input[type="datetime-local"],
html[data-theme="light"] .field input[type="time"] {
  color-scheme: light;
}

.field input[type="date"]::-webkit-date-and-time-value,
.field input[type="month"]::-webkit-date-and-time-value {
  text-align: left;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field input[type="date"],
.field input[type="month"],
.field input[type="time"],
.field input[type="file"],
.filter-field input[type="date"],
.filter-field input[type="month"] {
  padding-right: 12px;
  line-height: 1.25;
}

.field input[type="file"] {
  min-height: 0;
  padding: 10px;
}

/* Stop browser autofill paint from looking like a second overlay on dark fields */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus,
.inline-input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  transition: background-color 99999s ease-out;
  box-shadow: 0 0 0 1000px var(--desk) inset;
}

.field-has-error input,
.field-has-error select,
.field-has-error textarea,
.input-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(232, 106, 98, 0.2) !important;
}

.field-error-msg {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffb4b0;
  line-height: 1.35;
}

.day-card-has-error {
  border-color: rgba(232, 106, 98, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(232, 106, 98, 0.25);
}

#timesheetTimeHint code {
  color: var(--accent);
  font-family: ui-monospace, "Cascadia Code", monospace;
}

.timesheet-month-rule {
  margin: 7px 0 0;
  color: var(--ink-mute);
  font-size: 0.76rem;
  line-height: 1.35;
}

.timesheet-month-rule.is-current {
  color: var(--brand-bright);
}

.timesheet-readonly #weeksEditor {
  opacity: 0.78;
}

.evaluation-readonly textarea:disabled,
.evaluation-readonly input:disabled {
  opacity: 0.78;
  cursor: not-allowed;
}

.timesheet-signature-readonly {
  opacity: 0.78;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(62, 189, 74, 0.18);
  outline: none;
}

.password-field {
  position: relative;
}

.password-input-wrap {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.password-input-wrap input,
.password-field > input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 1;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--brand-bright);
  background: rgba(62, 189, 74, 0.12);
  transform: translateY(-50%);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: var(--display);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-bright), var(--brand));
  color: #061008;
  box-shadow: 0 8px 22px rgba(62, 189, 74, 0.22);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: transparent;
  border-color: rgba(62, 189, 74, 0.45);
  color: var(--brand-bright);
}

.btn-secondary:hover {
  background: rgba(62, 189, 74, 0.12);
}

.btn-danger {
  background: rgba(232, 106, 98, 0.14);
  border-color: rgba(232, 106, 98, 0.45);
  color: #ffb4b0;
}

.btn-ok {
  background: rgba(62, 189, 74, 0.14);
  border-color: rgba(62, 189, 74, 0.4);
  color: #b6f0bc;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-soft);
  color: var(--ink-soft);
}

.btn[hidden] {
  display: none !important;
}

.btn-block {
  width: 100%;
}

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

.auth-note {
  margin: 0 0 18px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.auth-switch {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--brand-bright);
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.auth-switch:hover,
.auth-switch:focus-visible {
  color: var(--ink);
}

html[data-theme="light"] .auth-switch {
  color: var(--brand-deep);
}

.hint {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px dashed var(--line-soft);
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.hint code {
  color: var(--accent);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.88em;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(62, 189, 74, 0.08), transparent 28%),
    #0e151c;
  border-right: 1px solid var(--line-soft);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  padding: 14px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line-soft);
  display: grid;
  gap: 8px;
}

.sidebar .brand img {
  width: 146px;
}

.sidebar .brand strong {
  font-family: var(--display);
  font-size: 1.05rem;
  color: #fff;
}

.sidebar .brand span {
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-btn[hidden] {
  display: none;
}

.nav-btn {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-btn.active {
  background: rgba(62, 189, 74, 0.14);
  color: var(--brand-bright);
  border-color: rgba(62, 189, 74, 0.3);
}

.nav-btn-label {
  display: inline-block;
}

.nav-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-ink);
  background: var(--accent);
}

.nav-badge[hidden] {
  display: none !important;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.user-chip {
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line-soft);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.main {
  padding: var(--space-5) var(--space-6) 48px;
  animation: fadeRise 0.5s var(--ease-out) both;
}

.page-live-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.live-clock {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(8, 12, 16, 0.56);
  color: var(--ink-soft);
  font-size: 0.76rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.live-clock time {
  color: var(--brand-bright);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(102, 255, 51, 0.55), 0 0 18px rgba(102, 255, 51, 0.25);
  white-space: nowrap;
}

.auth-card > .live-clock {
  grid-column: 1 / -1;
  justify-self: end;
  margin: 14px 18px 0;
}

.site-footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-mute);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.site-footer a {
  color: var(--brand-bright);
  font-weight: 800;
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #b6f0bc;
  text-decoration: underline;
  outline: none;
}

.site-footer a:focus-visible {
  border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(102, 255, 51, 0.18);
}

.auth-shell .site-footer {
  width: min(940px, 100%);
  margin-top: -2px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line-soft);
}

.topbar > div:first-child {
  min-width: 0;
  flex: 1;
}

.topbar .actions {
  flex-shrink: 0;
  align-items: center;
}

.email-batch-actions {
  justify-content: flex-end;
}

#bulkEmailModal .modal {
  width: min(1280px, calc(100vw - 48px));
  height: min(860px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-6);
  overflow: hidden;
}

#bulkEmailModal .card-header {
  margin-bottom: 0;
}

#bulkEmailModal .section-note {
  margin: 0;
  max-width: 72ch;
  line-height: 1.5;
}

.bulk-email-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1.5fr) minmax(280px, 360px);
  gap: var(--space-5);
  min-height: 0;
  flex: 1 1 auto;
}

.bulk-email-interns,
.bulk-email-detail,
.bulk-email-basket {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: var(--space-5);
  background: var(--desk-lift);
}

.bulk-email-interns .filter-field {
  margin: 0 0 var(--space-4);
}

#bulkEmailInternList {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.bulk-email-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.bulk-email-detail-body {
  overflow: visible;
  max-height: none;
}

.bulk-intern-btn {
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  min-height: 52px;
  padding: 14px 16px;
  text-align: left;
}

.bulk-intern-btn span:first-child {
  min-width: 0;
}

.bulk-intern-btn.active {
  border-color: var(--brand);
  background: rgba(62, 189, 74, 0.14);
  color: var(--ink);
}

.bulk-intern-count {
  flex-shrink: 0;
  color: var(--brand-bright);
  font-size: 0.82rem;
}

#bulkEmailDetail h3 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

.bulk-kind-choice {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-5) 0;
}

.bulk-kind-choice .btn {
  flex: 1 1 140px;
  min-height: 48px;
}

.bulk-month-list {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.bulk-month-list label,
.bulk-email-select-months {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.bulk-month-list label {
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel);
}

.bulk-month-list label:has(input:checked) {
  border-color: var(--brand);
  background: rgba(62, 189, 74, 0.16);
}

.bulk-email-select-months {
  min-height: 40px;
  padding: 4px 4px 0;
}

.bulk-month-list input,
.bulk-email-select-months input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--brand-bright);
  color-scheme: light;
}

#bulkEmailModal .bulk-email-basket .section-note {
  margin-bottom: var(--space-3);
}

.bulk-email-basket ul {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.bulk-email-basket li {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
  min-height: 72px;
  padding: var(--space-4);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel);
}

.bulk-email-basket-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bulk-email-basket-label strong {
  font-weight: 700;
  line-height: 1.3;
}

.bulk-email-basket-label span {
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1.35;
}

.bulk-email-basket li .btn {
  align-self: flex-end;
}

@media (max-width: 980px) {
  #bulkEmailModal .modal {
    width: min(100%, calc(100vw - 24px));
    height: calc(100vh - 24px);
    padding: var(--space-4);
    gap: var(--space-4);
  }

  .bulk-email-layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .bulk-email-interns {
    max-height: 240px;
  }

  .bulk-email-detail,
  .bulk-email-basket {
    overflow: visible;
    min-height: auto;
  }
}

#bulkEmailModal .actions {
  flex-shrink: 0;
  margin-top: 0;
  padding-top: 0;
}

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

.data th.select-col,
.data td.select-col {
  width: 2.75rem;
  text-align: center;
}

.data th.select-col input,
.data td.select-col input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--brand-bright);
  color-scheme: light;
  cursor: pointer;
  vertical-align: middle;
}

.data th.select-col input:disabled,
.data td.select-col input:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.3vw, 2rem);
  color: #fff;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--ink-soft);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: panelIn 0.35s var(--ease-out) both;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.stats-six {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 1200px) {
  .stats-six {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.stat-card .value.value-status {
  font-size: 1.15rem;
  line-height: 1.25;
}

.month-status-lines {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.month-status-line {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.4;
}

.month-status-line strong {
  color: var(--ink);
  font-weight: 700;
}

.month-status-line .badge {
  margin-left: 6px;
  vertical-align: middle;
}

.stat-card {
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(62, 189, 74, 0.3);
}

.stat-card .label {
  color: var(--ink-mute);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-family: var(--display);
}

.stat-card .value {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.card {
  background: var(--panel-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.card-inset {
  margin-top: 12px;
  background: rgba(8, 12, 16, 0.5);
  box-shadow: none;
  border-color: var(--line);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line-soft);
}

.card-header h2,
.card-header h3 {
  margin: 0;
  min-width: 0;
  color: #fff;
}

.card-header .actions {
  flex-shrink: 0;
  align-items: center;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.table-wrap {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

table.data th,
table.data td {
  padding: var(--space-3) 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line-soft);
}

table.data th {
  background: rgba(62, 189, 74, 0.08);
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  font-family: var(--display);
  white-space: nowrap;
}

table.data tbody tr:hover td {
  background: rgba(62, 189, 74, 0.05);
}

table.data td.actions,
table.data .actions {
  white-space: nowrap;
  vertical-align: middle;
}

table.data td.actions .actions,
table.data td .actions {
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
}

table.data .btn {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-family: var(--display);
}

.badge-draft {
  background: rgba(147, 164, 181, 0.16);
  color: #c5d0da;
}

.badge-submitted {
  background: var(--accent-soft);
  color: #ffd978;
}

.badge-approved {
  background: rgba(62, 189, 74, 0.16);
  color: var(--brand-bright);
}

.badge-rejected {
  background: rgba(232, 106, 98, 0.16);
  color: #ffb4b0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.modal .actions,
.modal form > .actions {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line-soft);
  align-items: center;
}

.modal .card-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line-soft);
}

.week-block {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: rgba(8, 12, 16, 0.4);
}

.week-block h4 {
  margin: 0 0 12px;
  color: #fff;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
}

.time-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-width: 0;
}

.time-pair .field {
  margin-bottom: 0;
  min-width: 0;
}

.time-pair input,
.day-card input[type="time"],
.day-card input[type="text"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 8px;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.signature-pad {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #f7faf8;
  overflow: hidden;
}

.signature-canvas {
  display: block;
  width: 100%;
  height: 110px;
  cursor: crosshair;
  touch-action: none;
  background: #fff;
}

.signature-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 10px;
  border-top: 1px solid #d5e3da;
  background: #eef3f0;
  color: #0c1f14;
}

.signature-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.signature-hint {
  color: #5b6b62;
  font-size: 0.82rem;
}

.signature-clear,
.signature-save,
.signature-use {
  font-size: 0.85rem;
}

.signature-use:disabled {
  opacity: 0.45;
}

.signature-pad-readonly {
  pointer-events: none;
}

.signature-pad-readonly .signature-canvas {
  cursor: default;
  background: #f8fafc;
}

.signature-gallery {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.signature-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(140px, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(8, 12, 16, 0.35);
}

.signature-card.is-active {
  border-color: rgba(62, 189, 74, 0.45);
  box-shadow: 0 0 0 1px rgba(62, 189, 74, 0.18);
}

.signature-card-preview {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.signature-card-preview canvas {
  display: block;
  width: 100%;
  height: 72px;
}

.signature-card-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.signature-card-meta strong {
  color: var(--ink);
  font-family: var(--display);
}

.signature-card-meta span {
  color: var(--ink-mute);
  font-size: 0.78rem;
}

.signature-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  justify-content: stretch;
  min-width: 220px;
}

.signature-card-actions .btn {
  width: 100%;
  justify-content: center;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 0.78rem;
}

.signature-limit-note {
  color: var(--warn);
  margin-bottom: 12px;
}

html[data-theme="light"] .signature-card {
  background: rgba(247, 244, 232, 0.78);
}

@media (max-width: 720px) {
  .stats-six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signature-card {
    grid-template-columns: 1fr;
  }

  /* The column count is set in the later 720px block, which wins on source
     order; only the width reset belongs here. */
  .signature-card-actions {
    min-width: 0;
  }
}

.day-card {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--panel);
  min-width: 0;
  overflow: hidden;
}

.day-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--brand-bright);
  font-family: var(--display);
}

.day-card-outside-month {
  opacity: 0.72;
  background: rgba(8, 12, 16, 0.22);
}

.day-card-outside-month strong {
  color: var(--ink-soft);
}

.day-card-note {
  display: block;
  margin: -6px 0 10px;
  color: var(--ink-mute);
  font-size: 0.74rem;
}

.day-card .field {
  margin-bottom: 0;
  min-width: 0;
}

.day-card .field label {
  font-size: 0.7rem;
}

.wfh-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 10px;
  min-width: 0;
  font-size: 0.74rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.wfh-toggle span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.wfh-check {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand-bright);
  cursor: pointer;
}

.wfh-check:disabled,
.wfh-check:disabled + span {
  cursor: not-allowed;
  opacity: 0.6;
}

.day-card-wfh .wfh-toggle {
  color: var(--brand-bright);
  font-weight: 600;
}

.day-card-wfh .time-pair {
  opacity: 0.45;
}

.day-time-wfh {
  color: var(--brand-bright);
  font-weight: 600;
}

/* Public holidays use the amber accent so they read apart from work-from-home. */
.day-card-holiday {
  border-color: rgba(240, 180, 41, 0.45);
  background: var(--accent-soft);
}

.day-card-note-holiday {
  color: var(--accent);
  font-weight: 600;
  margin: -2px 0 8px;
}

.day-card-holiday .time-pair,
.day-card-holiday .wfh-toggle {
  opacity: 0.4;
}

.day-time-holiday {
  color: var(--accent);
  font-weight: 600;
}

/* Approved leave uses the blue accent — apart from both work-from-home
   (green) and public holidays (amber). */
.day-card-leave {
  border-color: rgba(88, 150, 235, 0.45);
  background: rgba(88, 150, 235, 0.12);
}

.day-card-note-leave {
  color: #5896eb;
  font-weight: 600;
  margin: -2px 0 8px;
}

.day-card-leave .time-pair,
.day-card-leave .wfh-toggle {
  opacity: 0.4;
}

.day-time-leave {
  color: #5896eb;
  font-weight: 600;
}

html[data-theme="light"] .day-card-note-leave,
html[data-theme="light"] .day-time-leave {
  color: #2c62b4;
}

.holiday-card {
  max-width: 860px;
  margin-top: 18px;
}

.holiday-card h3 {
  margin: 0 0 6px;
  color: var(--brand-bright);
}

.holiday-card > .muted {
  margin: 0 0 16px;
  line-height: 1.5;
}

.holiday-form {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.holiday-form .field {
  margin-bottom: 0;
  min-width: 0;
}

.holiday-form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.holiday-list {
  margin-top: 18px;
}

.holiday-table td,
.holiday-table th {
  vertical-align: middle;
}

.holiday-row-locked {
  opacity: 0.6;
}

.holiday-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.holiday-badge-upcoming {
  background: rgba(90, 212, 102, 0.16);
  color: var(--brand-bright);
}

.holiday-badge-running {
  background: var(--accent-soft);
  color: var(--accent);
}

.holiday-badge-past {
  background: rgba(148, 163, 178, 0.16);
  color: var(--ink-mute);
}

.holiday-upcoming-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.holiday-upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(240, 180, 41, 0.28);
  border-radius: 10px;
  background: var(--accent-soft);
}

.holiday-upcoming-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.holiday-upcoming-body strong {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.holiday-upcoming-body span {
  font-size: 0.8rem;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.notif-item.notif-holiday .notif-dot,
.viewer-timeline-item.viewer-timeline-holiday .viewer-timeline-dot {
  background: var(--accent);
}

#timesheetModal .modal {
  width: min(1040px, 96vw);
}

#evaluationModal .modal {
  width: min(920px, 96vw);
}

.eval-intern-readonly {
  background: var(--desk-lift);
  box-shadow: none;
  color: var(--ink);
}

.eval-intern-readonly h3 {
  color: var(--ink);
  margin-top: 0;
}

.eval-intern-readonly p {
  color: var(--ink);
  margin: 0 0 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

html[data-theme="light"] .eval-intern-readonly {
  background: var(--panel-soft);
  border-color: var(--line-soft);
}

#timesheetModal .day-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

#timesheetModal .week-block {
  overflow-x: auto;
}

#timesheetModal .day-card {
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  min-width: 0;
}

#timesheetModal .day-card strong {
  margin-bottom: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}

#timesheetModal .day-card .day-time {
  font-size: 0.95rem;
  color: var(--ink);
}

#timesheetModal .day-card .wfh-toggle {
  margin: 0;
  font-size: 0.72rem;
}

.mentor-feedback-card {
  margin-top: 14px;
  border: 1px solid rgba(62, 189, 74, 0.25);
  background: rgba(62, 189, 74, 0.06);
}

.mentor-feedback-card.has-feedback {
  border-color: rgba(62, 189, 74, 0.4);
}

.mentor-feedback-banner {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(62, 189, 74, 0.12);
  color: var(--brand-bright);
  font-weight: 600;
}

.mentor-feedback-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.mentor-feedback-item {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(8, 12, 16, 0.45);
}

.mentor-feedback-item h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--brand-bright);
}

.mentor-feedback-item p {
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
  line-height: 1.5;
}

.mentor-feedback-meta {
  margin: 0 0 12px;
  color: var(--ink-soft);
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(380px, calc(100vw - 40px));
  padding: 15px 14px 17px;
  overflow: hidden;
  background: rgba(14, 22, 29, 0.96);
  border: 1px solid rgba(232, 238, 244, 0.12);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  opacity: 0;
  filter: blur(4px);
  transform: translate3d(24px, -8px, 0) scale(0.96);
  pointer-events: none;
  transition:
    opacity 0.24s ease,
    filter 0.32s var(--ease-stamp),
    transform 0.42s var(--ease-stamp);
}

.toast::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--toast-accent);
  box-shadow: 0 0 14px var(--toast-accent);
}

.toast--success {
  --toast-accent: var(--brand-bright);
  --toast-icon-surface: rgba(62, 189, 74, 0.16);
}

.toast--error {
  --toast-accent: var(--danger);
  --toast-icon-surface: rgba(232, 106, 98, 0.16);
}

.toast--warning {
  --toast-accent: var(--accent);
  --toast-icon-surface: var(--accent-soft);
}

.toast--info {
  --toast-accent: var(--brand-bright);
  --toast-icon-surface: rgba(90, 212, 102, 0.12);
}

.toast.show {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

.toast-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--toast-accent);
  background: var(--toast-icon-surface);
  border: 1px solid color-mix(in srgb, var(--toast-accent) 35%, transparent);
  border-radius: 11px;
}

.toast-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.toast-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.toast-title {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.toast-message {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.toast-close {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  color: var(--ink-mute);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.toast-close:hover {
  color: var(--ink);
  background: rgba(232, 238, 244, 0.08);
  border-color: var(--line-soft);
}

.toast-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.toast-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--toast-accent);
  transform-origin: left center;
}

.toast.show .toast-progress {
  animation: toastTimer var(--toast-duration) linear forwards;
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 7, 10, 0.76);
  backdrop-filter: blur(9px);
}

.confirm-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease both;
}

.confirm-dialog {
  --confirm-accent: var(--danger);
  width: min(430px, 100%);
  padding: 26px;
  color: var(--ink);
  background: rgba(20, 29, 37, 0.98);
  border: 1px solid rgba(232, 238, 244, 0.14);
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(232, 238, 244, 0.03);
  animation: confirmDialogIn 0.34s var(--ease-stamp) both;
}

.confirm-dialog--warning {
  --confirm-accent: var(--accent);
}

.confirm-dialog--neutral {
  --confirm-accent: var(--brand-bright);
}

.confirm-dialog__icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  place-items: center;
  color: var(--confirm-accent);
  background: color-mix(in srgb, var(--confirm-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--confirm-accent) 38%, transparent);
  border-radius: 13px;
  box-shadow: 0 0 24px color-mix(in srgb, var(--confirm-accent) 20%, transparent);
}

.confirm-dialog__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.confirm-dialog__copy h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1.35rem;
}

.confirm-dialog__copy p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
  white-space: pre-line;
}

.confirm-dialog__fields {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.confirm-dialog__fields[hidden] {
  display: none;
}

.confirm-dialog__fields label span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-mute);
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.confirm-dialog__fields input {
  width: 100%;
  min-height: var(--control-h);
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--desk);
  color: var(--ink);
}

.confirm-dialog__fields input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(62, 189, 74, 0.18);
  outline: none;
}

.confirm-dialog__copy p.confirm-dialog__field-error {
  margin: 10px 0 0;
  color: #ffb4b0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
}

.confirm-dialog__field-error[hidden] {
  display: none;
}

.confirm-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}

.confirm-dialog__actions .btn {
  min-height: 44px;
}

.confirm-dialog--neutral .confirm-dialog__actions .btn-danger {
  background: linear-gradient(135deg, var(--brand-bright), var(--brand));
  border-color: transparent;
  color: #061008;
  box-shadow: 0 8px 22px rgba(62, 189, 74, 0.22);
}

body.confirm-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 14, 0.75);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease both;
}

.modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: stampIn 0.3s var(--ease-stamp) both;
  color: var(--ink);
}

.doc-preview-backdrop {
  z-index: 55;
}

.doc-preview-modal {
  width: min(980px, 100%);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.doc-preview-frame-wrap {
  flex: 1;
  min-height: min(70vh, 720px);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.doc-preview-frame {
  display: block;
  width: 100%;
  height: min(70vh, 720px);
  border: 0;
  background: #fff;
}

body.doc-preview-open {
  overflow: hidden;
}

html[data-theme="light"] .doc-preview-frame-wrap,
html[data-theme="light"] .doc-preview-frame {
  background: #f7f4e8;
}

.signature-preview-modal {
  max-width: min(560px, 94vw);
}

.signature-preview-canvas-wrap {
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
}

.signature-preview-canvas-wrap canvas {
  display: block;
  width: 100%;
  min-height: 200px;
}

body.signature-preview-open {
  overflow: hidden;
}

html[data-theme="light"] .signature-preview-canvas-wrap {
  background: #fff;
}

.section-note {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: 0 0 14px;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--ink-soft);
  border: 1px dashed var(--line-soft);
  border-radius: 10px;
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.notif-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(8, 12, 16, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.notif-item:hover {
  transform: translateY(-2px);
  border-color: rgba(62, 189, 74, 0.35);
}

.notif-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.notif-title {
  font-size: 0.95rem;
  line-height: 1.35;
  color: #fff;
}

.notif-meta {
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin-top: 2px;
}

.notif-tag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(62, 189, 74, 0.14);
  color: var(--brand-bright);
  font-family: var(--display);
}

.notif-evaluation .notif-tag {
  background: var(--accent-soft);
  color: #ffd978;
}

.notif-leave .notif-tag {
  background: rgba(45, 127, 249, 0.16);
  color: #8cbcff;
}

.notif-cancelled .notif-tag {
  background: rgba(232, 106, 98, 0.16);
  color: #ffb4b0;
}

.field-optional {
  font-weight: 500;
  color: var(--ink-mute);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85em;
}

.leave-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  transition: grid-template-columns 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.leave-layout.has-focus {
  grid-template-columns: minmax(0, 1fr);
}

.leave-view-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 620px);
  margin: 0 0 16px;
  padding: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(8, 12, 16, 0.56);
}

.leave-view-tab {
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-mute);
  cursor: pointer;
  text-align: left;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease,
    transform 0.25s ease;
}

.leave-view-tab:hover,
.leave-view-tab:focus-visible {
  color: var(--ink);
  outline: none;
  transform: translateY(-1px);
}

.leave-view-tab.active {
  border-color: rgba(102, 255, 51, 0.42);
  background: rgba(102, 255, 51, 0.11);
  color: var(--brand-bright);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.leave-view-tab strong {
  color: inherit;
  font-family: var(--display);
  font-size: 0.92rem;
}

.leave-view-tab-kicker {
  color: var(--ink-mute);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leave-view-tab.active .leave-view-tab-kicker {
  color: var(--brand);
}

.leave-pane {
  min-width: 0;
  max-height: 2400px;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
}

.leave-pane.is-focused {
  position: relative;
  z-index: 1;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(102, 255, 51, 0.12);
  animation: leavePaneFocus 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.leave-pane.is-minimized {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
}

.leave-pane.is-minimized:hover {
  opacity: 0;
}

.leave-pane.is-minimized > :not(.card-header) {
  max-height: 0;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.leave-pane.is-minimized .card-header {
  margin-bottom: 0;
  border-bottom-color: transparent;
}

.leave-pane-caption {
  display: block;
  margin-top: 4px;
  color: var(--ink-mute);
  font-size: 0.76rem;
  line-height: 1.35;
}

.leave-pane-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.leave-pane-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.leave-pane-toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}

.leave-pane-toggle:hover,
.leave-pane-toggle:focus-visible,
.leave-pane-toggle.active {
  border-color: rgba(102, 255, 51, 0.5);
  background: rgba(102, 255, 51, 0.1);
  color: var(--brand-bright);
  outline: none;
}

.leave-pane-toggle.active::after {
  transform: rotate(135deg);
}

@keyframes leavePaneFocus {
  from {
    transform: translateY(8px) scale(0.99);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
  to {
    transform: translateY(0) scale(1);
  }
}

.leave-request-card .card-header {
  align-items: center;
}

.leave-day-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--display);
  background: rgba(102, 255, 51, 0.12);
  color: var(--brand-bright);
  border: 1px solid rgba(102, 255, 51, 0.22);
}

#leaveNewRequestFields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.leave-request-lock {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 217, 120, 0.28);
  border-radius: 12px;
  background: rgba(255, 217, 120, 0.08);
  color: #ffe6a1;
  font-size: 0.84rem;
  line-height: 1.45;
}

.leave-request-lock[hidden] {
  display: none;
}

.leave-request-lock span {
  color: var(--ink-soft);
}

.leave-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
}

.leave-type-option {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.leave-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.leave-type-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(8, 12, 16, 0.45);
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.leave-type-option input:checked + span {
  border-color: rgba(102, 255, 51, 0.55);
  background: rgba(102, 255, 51, 0.12);
  color: #fff;
}

.leave-type-option:hover span {
  border-color: rgba(102, 255, 51, 0.35);
  color: #fff;
}

.leave-filter {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(8, 12, 16, 0.55);
  border: 1px solid var(--line-soft);
}

.leave-filter-btn {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
}

.leave-filter-btn.active {
  background: rgba(102, 255, 51, 0.16);
  color: var(--brand-bright);
}

.leave-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leave-list-hint {
  color: var(--ink-mute);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.leave-card > summary {
  list-style: none;
}

.leave-card > summary::-webkit-details-marker {
  display: none;
}

.leave-card-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  outline: none;
}

.leave-card-summary:focus-visible {
  border-radius: 8px;
  box-shadow: 0 0 0 3px rgba(102, 255, 51, 0.2);
}

.leave-card-copy {
  min-width: 0;
}

.leave-card-summary .leave-card-top,
.leave-card-summary .leave-card-copy {
  margin-bottom: 0;
}

.leave-card-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.leave-card-summary-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-mute);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
}

.leave-card-summary-hint::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--brand-bright);
  border-bottom: 2px solid var(--brand-bright);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.leave-card[open] .leave-card-summary-hint::after {
  transform: translateY(2px) rotate(225deg);
}

.leave-card-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  animation: fadeRise 0.22s ease both;
}

.leave-card-muted {
  color: var(--ink-mute);
  font-style: italic;
}

.leave-change-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(45, 127, 249, 0.3);
  border-radius: 12px;
  background: rgba(45, 127, 249, 0.08);
}

.leave-change-panel strong {
  color: #dce9ff;
  font-size: 0.88rem;
}

.leave-change-panel p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.leave-change-fields {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1.2fr);
  gap: 10px;
}

.leave-change-fields label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.leave-change-fields input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(8, 12, 16, 0.55);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  text-transform: none;
  letter-spacing: normal;
}

.leave-change-fields input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(62, 189, 74, 0.18);
}

.leave-change-direction {
  min-height: 1.2em;
}

.leave-change-status {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(8, 12, 16, 0.35);
  font-size: 0.82rem;
}

.leave-change-status strong {
  color: #ffe09a;
}

.leave-change-status span {
  color: var(--ink-soft);
}

.leave-change-status.declined strong {
  color: #ffb4b0;
}

.leave-change-status.approved strong {
  color: var(--brand-bright);
}

.leave-change-status.cancelled strong {
  color: var(--ink-soft);
}

.leave-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.leave-page-btn {
  min-width: 82px;
  padding: 8px 12px;
  font-size: 0.78rem;
}

.leave-page-status {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.pagination-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px;
  min-height: 38px;
}

.pagination-toolbar + .table-wrap {
  margin-top: 0;
}

.pagination-toolbar .pagination-summary {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.pagination-summary:focus-visible {
  border-radius: 6px;
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn {
  min-width: 84px;
  padding: 8px 12px;
  font-size: 0.78rem;
}

.pagination-page {
  min-width: 72px;
  color: var(--ink-mute);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

[id$="PaginationBottom"] .pagination-toolbar {
  margin: 12px 0 0;
}

.leave-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(8, 12, 16, 0.45);
  animation: fadeRise 0.35s ease both;
}

.leave-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.leave-card-title {
  margin: 0;
  font-size: 1rem;
  color: #fff;
  font-family: var(--display);
}

.leave-card-meta {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.leave-card-reason,
.leave-card-note {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

.leave-card-note {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(45, 127, 249, 0.1);
  border: 1px solid rgba(45, 127, 249, 0.2);
  color: #cfe0ff;
}

.leave-card-actions {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.leave-card-actions .btn {
  min-height: 34px;
}

.leave-docs-preview,
.leave-docs {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leave-docs-preview[hidden] {
  display: none !important;
}

.leave-doc-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(8, 12, 16, 0.5);
}

.leave-doc-name,
.leave-doc-link {
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  word-break: break-word;
}

.leave-doc-link:hover {
  color: var(--brand-bright);
}

.leave-doc-size {
  color: var(--ink-mute);
  font-size: 0.8rem;
  white-space: nowrap;
}

.leave-doc-remove {
  border: 0;
  background: transparent;
  color: #ffb4b0;
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.leave-doc-remove:hover {
  text-decoration: underline;
}

.leave-docs-label {
  margin: 12px 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-family: var(--display);
}

#leaveDocs {
  padding: 10px;
  background: rgba(8, 12, 16, 0.45);
}

.leave-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.leave-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-family: var(--display);
}

.leave-step::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(147, 164, 181, 0.45);
}

.leave-step.done {
  color: var(--brand-bright);
}

.leave-step.done::before {
  background: var(--brand);
}

.leave-step.current {
  color: #ffd978;
}

.leave-step.current::before {
  background: #ffd978;
  box-shadow: 0 0 0 3px rgba(255, 217, 120, 0.2);
}

.leave-step.failed {
  color: #ffb4b0;
}

.leave-step.failed::before {
  background: #e86a62;
}

.leave-review-summary {
  margin-bottom: 14px;
}

.viewer-topbar {
  position: relative;
}

/* —— Viewer command center dashboard —— */
.viewer-dash-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line-soft);
  border-radius: calc(var(--radius) + 4px);
  background: var(--panel-soft);
  box-shadow: var(--shadow-lg);
}

.viewer-dash-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(62, 189, 74, 0.22), transparent 42%),
    radial-gradient(circle at 88% 10%, rgba(93, 156, 255, 0.18), transparent 38%),
    radial-gradient(circle at 70% 90%, rgba(240, 180, 41, 0.12), transparent 40%);
  animation: viewerHeroGlow 8s ease-in-out infinite alternate;
}

.viewer-dash-hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(140px, 220px);
  gap: 20px;
  align-items: center;
  padding: 24px 26px;
}

.viewer-dash-hero-copy h1 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
}

.viewer-dash-hero-copy p {
  margin: 0;
  max-width: 52ch;
  color: var(--ink-soft);
  line-height: 1.5;
}

.viewer-dash-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.viewer-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(62, 189, 74, 0.35);
  background: rgba(62, 189, 74, 0.12);
  color: var(--brand-bright);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.viewer-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-bright);
  box-shadow: 0 0 0 0 rgba(62, 189, 74, 0.55);
  animation: viewerLivePulse 2s ease-out infinite;
}

.viewer-dash-hero-visual {
  display: flex;
  justify-content: center;
}

.viewer-score-ring-wrap {
  position: relative;
  width: 148px;
  height: 148px;
}

.viewer-score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.viewer-score-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 8;
}

.viewer-score-progress {
  fill: none;
  stroke: var(--brand-bright);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 8px rgba(62, 189, 74, 0.45));
}

.viewer-score-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.viewer-score-center strong {
  font-family: var(--display);
  font-size: 1.85rem;
  line-height: 1;
  color: var(--ink);
}

.viewer-score-center span {
  color: var(--ink-mute);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.viewer-dash-stats {
  margin-bottom: 14px;
}

.viewer-stat-card {
  position: relative;
  overflow: hidden;
  animation: viewerStatIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--viewer-stagger, 0) * 70ms);
}

.viewer-stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand);
  opacity: 0.85;
}

.viewer-stat-green::before { background: var(--brand); }
.viewer-stat-blue::before { background: #5d9cff; }
.viewer-stat-yellow::before { background: #ffd978; }
.viewer-stat-purple::before { background: #b48cff; }
.viewer-stat-warn::before { background: var(--warn); }
.viewer-stat-muted::before { background: var(--ink-mute); }

.viewer-stat-icon {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  opacity: 0.7;
}

.viewer-dash-quick {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.viewer-quick-btn {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.2s ease, box-shadow 0.22s ease;
  animation: viewerQuickIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--viewer-stagger, 0) * 60ms + 120ms);
}

.viewer-quick-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(62, 189, 74, 0.35);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.viewer-quick-label {
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
}

.viewer-quick-meta {
  color: var(--ink-mute);
  font-size: 0.72rem;
}

.viewer-quick-green { border-left: 3px solid var(--brand); }
.viewer-quick-blue { border-left: 3px solid #5d9cff; }
.viewer-quick-yellow { border-left: 3px solid #ffd978; }
.viewer-quick-purple { border-left: 3px solid #b48cff; }
.viewer-quick-brand { border-left: 3px solid var(--brand-bright); }

.viewer-dash-reveal {
  animation: viewerSectionIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.viewer-dash-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.viewer-timeline,
.viewer-attention-list-wrap,
#viewerTimeline,
#viewerAttentionList {
  max-height: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.viewer-timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.viewer-timeline-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  animation: viewerTimelineIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--viewer-stagger, 0) * 55ms);
  transition: background 0.2s ease, transform 0.2s ease;
}

.viewer-timeline-item:last-child {
  border-bottom: 0;
}

.viewer-timeline-item:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateX(4px);
}

.viewer-timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 12px rgba(62, 189, 74, 0.45);
}

.viewer-timeline-evaluation .viewer-timeline-dot { background: #5d9cff; box-shadow: 0 0 12px rgba(93, 156, 255, 0.4); }
.viewer-timeline-leave .viewer-timeline-dot { background: #ffd978; box-shadow: 0 0 12px rgba(255, 217, 120, 0.35); }

.viewer-timeline-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.viewer-timeline-body strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.viewer-timeline-body span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.4;
}

.viewer-timeline-tag {
  align-self: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-mute);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.viewer-attention-note {
  margin: 0;
  white-space: nowrap;
}

.viewer-attention-list .viewer-attention-item {
  animation: viewerAttentionIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--viewer-stagger, 0) * 65ms);
  padding-top: 10px;
  padding-bottom: 10px;
}

.viewer-attention-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 4px 4px;
  border-top: 1px solid var(--line-soft);
  list-style: none;
}

.viewer-attention-more .btn {
  padding-inline: 10px;
}

.viewer-attention-empty {
  animation: viewerSectionIn 0.5s ease both;
}

.viewer-bar-chart .bar-fill {
  animation-delay: calc(var(--bar-delay, 0s) + 0.15s);
}

.viewer-health-row {
  animation: viewerHealthIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--health-delay, 0s);
}

.viewer-health-percent {
  margin-top: 4px;
  color: var(--ink-mute);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: right;
}

.viewer-health-row .health-fill {
  transform-origin: left center;
  animation: viewerHealthGrow 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--health-delay, 0s) + 0.1s);
}

@keyframes viewerHealthGrow {
  from {
    opacity: 0.35;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.viewer-chart-card-activity,
.viewer-chart-card-health {
  animation: viewerCardFloat 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.viewer-chart-card-health {
  animation-delay: 0.08s;
}

@keyframes viewerHeroGlow {
  from { opacity: 0.75; transform: scale(1); }
  to { opacity: 1; transform: scale(1.03); }
}

@keyframes viewerLivePulse {
  0% { box-shadow: 0 0 0 0 rgba(62, 189, 74, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(62, 189, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 189, 74, 0); }
}

@keyframes viewerStatIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

@keyframes viewerTimelineIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes viewerAttentionIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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

@media (prefers-reduced-motion: reduce) {
  .viewer-dash-hero-bg,
  .viewer-live-dot,
  .viewer-stat-card,
  .viewer-quick-btn,
  .viewer-dash-reveal,
  .viewer-timeline-item,
  .viewer-attention-item,
  .viewer-health-row,
  .viewer-chart-card-activity,
  .viewer-chart-card-health {
    animation: none !important;
  }

  .viewer-score-progress {
    transition: none !important;
  }

  .viewer-quick-btn:hover,
  .viewer-timeline-item:hover {
    transform: none;
  }
}

html[data-theme="light"] .viewer-score-track {
  stroke: rgba(24, 36, 45, 0.1);
}

html[data-theme="light"] .viewer-score-progress {
  stroke: var(--brand-deep);
  filter: drop-shadow(0 0 6px rgba(35, 141, 47, 0.25));
}

html[data-theme="light"] .viewer-live-badge {
  background: rgba(35, 141, 47, 0.1);
  border-color: rgba(35, 141, 47, 0.25);
  color: var(--brand-deep);
}

html[data-theme="light"] .viewer-quick-btn:hover {
  box-shadow: 0 10px 24px rgba(23, 42, 52, 0.1);
}

html[data-theme="light"] .viewer-timeline-item:hover {
  background: rgba(24, 36, 45, 0.04);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--brand-bright);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-family: var(--display);
}

.viewer-refresh-note {
  align-self: flex-start;
  color: var(--ink-mute);
  font-size: 0.78rem;
  white-space: nowrap;
}

.viewer-dashboard-grid,
.viewer-comments-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 16px;
}

.viewer-comments-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item-outgoing {
  border-color: rgba(56, 189, 248, .28);
  background: rgba(14, 116, 144, .14);
}

.comment-item-unread {
  border-color: rgba(250, 204, 21, .35);
  box-shadow: inset 3px 0 0 var(--brand-bright);
}

.card-lead {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: .84rem;
}

.viewer-chart-card {
  min-height: 255px;
}

.chart-legend {
  color: var(--ink-mute);
  font-size: 0.72rem;
  white-space: nowrap;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 4px 1px 8px;
  border-radius: 50%;
}

.legend-green {
  background: var(--brand);
}

.legend-yellow {
  background: #ffd978;
}

.bar-chart {
  display: flex;
  align-items: end;
  justify-content: space-around;
  gap: 16px;
  height: 175px;
  padding: 16px 8px 0;
  border-bottom: 1px solid var(--line-soft);
}

.bar-column {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 48px;
}

.bar-value {
  height: 20px;
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
}

.bar-track {
  display: flex;
  align-items: end;
  flex: 1;
  width: 100%;
  max-width: 48px;
  border-radius: 8px 8px 2px 2px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.bar-fill {
  position: relative;
  width: 100%;
  min-height: 8px;
  border-radius: 8px 8px 2px 2px;
  animation: chartGrow 0.8s cubic-bezier(.2,.8,.2,1) both;
}

.bar-fill span {
  position: absolute;
  top: 5px;
  left: 50%;
  color: rgba(0, 0, 0, 0.7);
  font-size: 0.6rem;
  font-weight: 800;
  transform: translateX(-50%) rotate(-90deg);
  white-space: nowrap;
}

.bar-green {
  background: linear-gradient(180deg, #8aff68, #39be30);
}

.bar-blue {
  background: linear-gradient(180deg, #80b5ff, #3478e5);
}

.bar-yellow {
  background: linear-gradient(180deg, #ffe39b, #d6a93c);
}

.bar-purple {
  background: linear-gradient(180deg, #d1a7ff, #8750ca);
}

.bar-label {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.viewer-health-chart {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 4px 10px;
}

.health-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.health-heading strong {
  color: #fff;
  font-family: var(--display);
}

.health-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.health-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  animation: chartGrow 0.9s cubic-bezier(.2,.8,.2,1) both;
}

.health-green {
  background: var(--brand);
}

.health-blue {
  background: #5d9cff;
}

.health-yellow {
  background: #ffd978;
}

.stat-spark {
  margin-top: 6px;
  color: var(--ink-mute);
  font-size: 0.7rem;
}

.viewer-intern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-4);
}

.viewer-person-card {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(19, 28, 36, .88), rgba(8, 12, 16, .72));
  box-shadow: 0 16px 30px rgba(0, 0, 0, .12);
  animation: fadeRise .45s ease both;
  min-width: 0;
}

.viewer-avatar {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(102, 255, 51, .35);
  border-radius: 14px;
  background: rgba(102, 255, 51, .12);
  color: var(--brand-bright);
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
}

.viewer-person-main {
  min-width: 0;
  flex: 1;
}

.viewer-person-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.viewer-company-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 3px 9px;
  border: 1px solid rgba(90, 212, 102, 0.45);
  border-radius: 999px;
  background: rgba(90, 212, 102, 0.16);
  color: #d8ffd4;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  white-space: nowrap;
}

html[data-theme="light"] .viewer-company-chip {
  border-color: rgba(22, 107, 34, 0.35);
  background: rgba(35, 141, 47, 0.14);
  color: #14561f;
}

.viewer-company-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.viewer-company-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.viewer-company-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--desk-lift);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.viewer-company-btn strong {
  font-size: 1rem;
}

.viewer-company-btn span {
  color: var(--ink-mute);
  font-size: 0.82rem;
}

.viewer-company-btn.active {
  border-color: var(--brand);
  background: rgba(62, 189, 74, 0.14);
}

.viewer-company-detail {
  min-height: 240px;
  padding: var(--space-5);
}

.viewer-company-detail h2 {
  margin: 0 0 6px;
}

.viewer-company-detail-meta {
  margin: 0 0 var(--space-4);
  color: var(--ink-soft);
}

.viewer-admin-card {
  margin-top: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.viewer-admin-card h3 {
  margin: 0;
}

.viewer-admin-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.viewer-admin-fields span {
  display: block;
  color: var(--ink-mute);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.viewer-admin-fields strong {
  display: block;
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 650;
}

html[data-theme="light"] .viewer-admin-card {
  background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 800px) {
  .viewer-company-layout {
    grid-template-columns: 1fr;
  }
}

.viewer-person-head h2 {
  margin: 0;
  color: #fff;
  font-size: 1.05rem;
}

.viewer-readonly-chip {
  padding: 4px 8px;
  border: 1px solid rgba(93, 156, 255, .25);
  border-radius: 999px;
  color: #9fc4ff;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.viewer-person-meta {
  margin: 7px 0 12px;
  color: var(--ink-soft);
  font-size: .86rem;
}

.viewer-person-extra {
  margin-top: -7px;
  color: var(--ink-mute);
  font-size: .75rem;
}

.viewer-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.viewer-mini-stats span {
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255,255,255,.05);
  color: var(--ink-mute);
  font-size: .72rem;
}

.viewer-person-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-1);
  width: 100%;
}

.viewer-person-actions .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.78rem;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-item {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(8, 12, 16, .42);
}

.comment-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: .78rem;
}

.comment-item-head strong {
  color: var(--brand-bright);
}

.comment-item p {
  margin: 8px 0 0;
  color: #fff;
  font-size: .9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.viewer-detail-modal {
  width: min(1040px, 94vw);
}

.viewer-detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: .82rem;
}

.viewer-detail-table {
  min-width: 760px;
}

.viewer-evaluation-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.viewer-evaluation-field {
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(8, 12, 16, .42);
}

.viewer-evaluation-field h3 {
  margin: 0 0 6px;
  color: var(--brand-bright);
  font-size: .82rem;
  font-family: var(--display);
}

.viewer-evaluation-field p {
  margin: 0;
  color: var(--ink);
  font-size: .9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

@keyframes chartGrow {
  from {
    opacity: .2;
    transform: scaleY(0);
    transform-origin: bottom;
  }
  to {
    opacity: 1;
    transform: scaleY(1);
    transform-origin: bottom;
  }
}

ul:not(.notif-list) {
  color: var(--ink-soft);
}

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

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

@keyframes stampIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes toastTimer {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@keyframes confirmDialogIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes welcomeWordLaunch {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(14px) rotate(8deg) scale(0.7);
  }
  55% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-4px) rotate(-2deg) scale(1.08);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) rotate(0) scale(1);
  }
}

@keyframes welcomeWordSurge {
  0%,
  100% {
    text-shadow: 0 0 0 rgba(90, 212, 102, 0);
  }
  12% {
    text-shadow: 0 0 5px var(--brand-bright), 0 0 16px rgba(90, 212, 102, 0.75);
  }
  22% {
    text-shadow: 0 0 1px var(--brand-bright);
  }
  30% {
    text-shadow: 0 0 8px var(--brand-bright), 0 0 24px rgba(90, 212, 102, 0.9);
  }
  42% {
    text-shadow: 0 0 0 rgba(90, 212, 102, 0);
  }
}

@keyframes welcomeBeacon {
  0%,
  100% {
    opacity: 0.55;
    transform: scaleY(0.55);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

html[data-theme="light"] .auth-brand {
  background:
    linear-gradient(155deg, rgba(62, 189, 74, 0.12), transparent 60%),
    #e6f1e6;
}

html[data-theme="light"] .auth-brand h1,
html[data-theme="light"] .auth-form h2,
html[data-theme="light"] .topbar h1,
html[data-theme="light"] .stat-card .value,
html[data-theme="light"] .card-header h2,
html[data-theme="light"] .card-header h3,
html[data-theme="light"] .week-block h4,
html[data-theme="light"] .notif-title,
html[data-theme="light"] .leave-card-title,
html[data-theme="light"] .leave-doc-name,
html[data-theme="light"] .leave-doc-link,
html[data-theme="light"] .bar-value,
html[data-theme="light"] .health-heading strong,
html[data-theme="light"] .viewer-person-head h2,
html[data-theme="light"] .comment-item p {
  color: var(--ink);
}

html[data-theme="light"] .welcome-message__line--primary {
  color: var(--ink);
}

html[data-theme="light"] .welcome-message__line--primary .welcome-message__word--brand,
html[data-theme="light"] .welcome-message__line--secondary {
  color: var(--brand-deep);
}

html[data-theme="light"] .sidebar {
  background:
    linear-gradient(180deg, rgba(62, 189, 74, 0.1), transparent 28%),
    #f2f7f8;
}

html[data-theme="light"] .sidebar .brand,
html[data-theme="light"] .user-chip,
html[data-theme="light"] .live-clock,
html[data-theme="light"] .hint,
html[data-theme="light"] .card-inset,
html[data-theme="light"] .leave-card,
html[data-theme="light"] .leave-type-option span,
html[data-theme="light"] .leave-filter,
html[data-theme="light"] .notif-item,
html[data-theme="light"] .comment-item,
html[data-theme="light"] .viewer-mini-stats span {
  background: rgba(247, 244, 232, 0.82);
}

html[data-theme="light"] .sidebar .brand strong,
html[data-theme="light"] .nav-btn:hover {
  color: var(--ink);
}

html[data-theme="light"] .sidebar-footer #logoutBtn {
  color: var(--ink) !important;
  border-color: var(--line) !important;
}

html[data-theme="light"] .viewer-person-card {
  background: linear-gradient(145deg, #f7f4e8, #e4efe3);
}

html[data-theme="light"] .health-track {
  background: rgba(24, 36, 45, 0.1);
}

html[data-theme="light"] .field-error-msg {
  color: var(--danger);
}

html[data-theme="light"] .site-footer a:hover,
html[data-theme="light"] .site-footer a:focus-visible {
  color: var(--brand-deep);
}

html[data-theme="light"] .btn-danger {
  background: rgba(180, 35, 24, 0.14);
  border-color: rgba(180, 35, 24, 0.5);
  color: var(--danger);
}

html[data-theme="light"] .btn-ok {
  background: rgba(35, 141, 47, 0.16);
  border-color: rgba(35, 141, 47, 0.48);
  color: var(--brand-deep);
}

html[data-theme="light"] .badge-draft {
  background: rgba(83, 97, 109, 0.16);
  color: #3d4b57;
}

html[data-theme="light"] .badge-submitted {
  background: rgba(176, 120, 8, 0.16);
  color: #8a5a00;
}

html[data-theme="light"] .badge-approved {
  background: rgba(35, 141, 47, 0.18);
  color: var(--brand-deep);
}

html[data-theme="light"] .badge-rejected,
html[data-theme="light"] .notif-cancelled .notif-tag {
  background: rgba(180, 35, 24, 0.15);
  color: var(--danger);
}

html[data-theme="light"] .leave-change-status.declined strong,
html[data-theme="light"] .leave-step.failed,
html[data-theme="light"] .leave-cancel-btn {
  color: var(--danger);
}

html[data-theme="light"] .toast {
  background: rgba(247, 244, 232, 0.99);
  border-color: rgba(24, 36, 45, 0.14);
}

html[data-theme="light"] .confirm-dialog {
  background: rgba(247, 244, 232, 0.99);
  border-color: rgba(24, 36, 45, 0.14);
}

html[data-theme="light"] .confirm-dialog__copy h2 {
  color: var(--ink);
}

@media (max-width: 980px) {
  .auth-card,
  .app-shell,
  .stats,
  .grid-2,
  .grid-3,
  .day-grid,
  .mentor-feedback-grid {
    grid-template-columns: 1fr;
  }

  .stats-six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #timesheetModal .day-grid {
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    min-width: 620px;
  }

  #timesheetModal .week-block,
  .week-block {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-shell {
    display: block;
    max-width: 100%;
    overflow-x: clip;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .main,
  .panel {
    max-width: 100%;
    min-width: 0;
  }

  .main {
    padding: var(--space-4);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar .actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar .actions .btn {
    flex: 1 1 auto;
  }

  .card-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .card-header .actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .actions {
    flex-wrap: wrap;
  }

  .actions .btn {
    flex: 1 1 auto;
  }

  table.data td.actions .actions,
  table.data td .actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  /* The intern documents table puts the buttons straight into the cell, so the
     nested selectors above never match it and its nowrap forced a wide scroll. */
  table.data td.actions,
  table.data .actions {
    white-space: normal;
  }

  .leave-layout {
    grid-template-columns: 1fr;
  }

  .viewer-dashboard-grid,
  .viewer-comments-layout,
  .viewer-dash-bottom {
    grid-template-columns: 1fr;
  }

  .viewer-dash-hero-inner {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .viewer-dash-hero-visual {
    justify-content: flex-start;
  }

  .viewer-dash-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .viewer-refresh-note {
    display: none;
  }

  .viewer-person-card {
    padding: 14px;
  }

  .viewer-person-actions {
    grid-template-columns: 1fr;
  }

  .viewer-evaluation-fields {
    grid-template-columns: 1fr;
  }

  .auth-brand,
  .auth-form {
    padding: 28px 20px;
  }

  .auth-card > .theme-toggle {
    top: 12px;
    left: 12px;
  }

  .welcome-message__line {
    white-space: normal;
  }

  .signature-actions,
  .signature-buttons {
    width: 100%;
  }

  .signature-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .signature-buttons .btn {
    width: 100%;
  }

  .leave-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .leave-card-actions {
    flex-wrap: wrap;
  }

  .leave-card-actions .btn {
    flex: 1 1 calc(50% - 6px);
  }

  .modal-backdrop {
    padding: 12px;
    align-items: flex-start;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 16px;
    border-radius: 14px;
  }

  #timesheetModal .modal,
  #evaluationModal .modal,
  .viewer-detail-modal,
  .doc-preview-modal {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 560px) {
  .confirm-dialog {
    padding: 22px;
    border-radius: 17px;
  }

  .confirm-dialog__actions {
    grid-template-columns: 1fr;
  }

  .welcome-message__line {
    white-space: normal;
  }

  .leave-list-hint {
    white-space: normal;
  }

  .pagination-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .pagination-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .pagination-btn {
    width: 100%;
  }

  .leave-change-fields {
    grid-template-columns: 1fr;
  }

  .leave-card-summary {
    grid-template-columns: 1fr;
  }

  .leave-card-summary-meta {
    width: 100%;
    justify-content: space-between;
  }

  .leave-card-summary-hint {
    justify-self: start;
  }

  .leave-pagination {
    flex-wrap: wrap;
  }

  .leave-page-status {
    order: -1;
    width: 100%;
    text-align: center;
  }
}

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: color-mix(in srgb, var(--desk) 88%, var(--brand) 12%);
}

.filter-field {
  flex: 1 1 145px;
  min-width: 130px;
}

.filter-field label {
  display: block;
  margin: 0 0 5px;
  color: var(--ink-mute);
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.filter-field input,
.filter-field select {
  width: 100%;
  min-height: var(--control-h);
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--desk);
  color: var(--ink);
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(62, 189, 74, 0.18);
  outline: none;
}

.filter-results {
  flex: 0 0 auto;
  align-self: center;
  min-width: 78px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.filter-clear {
  white-space: nowrap;
  min-height: var(--control-h);
}

@media (max-width: 720px) {
  .filter-toolbar {
    align-items: stretch;
  }

  .filter-field {
    flex-basis: calc(50% - 10px);
  }

  .filter-results {
    flex: 1 1 100%;
    text-align: left;
  }
}

@media (max-width: 420px) {
  .filter-field {
    flex-basis: 100%;
  }

  .filter-clear {
    width: 100%;
  }
}

.timesheet-week-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(8, 12, 16, 0.38);
}

.timesheet-week-pagination-bottom {
  margin: 12px 0 0;
}

.timesheet-week-pagination-summary {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.timesheet-week-pagination-controls {
  display: flex;
  gap: 8px;
}

.timesheet-week-pagination .btn {
  min-width: 84px;
}

@media (max-width: 560px) {
  .timesheet-week-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .timesheet-week-pagination-summary {
    text-align: center;
  }

  .timesheet-week-pagination-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .timesheet-week-pagination .btn {
    width: 100%;
  }
}

/* Phone: keep controls readable, stop native overlays, contain cards */
@media (max-width: 720px) {
  html,
  body {
    overflow-x: clip;
  }

  .auth-shell {
    padding: 12px;
    align-items: stretch;
  }

  .auth-card {
    width: 100%;
    overflow: hidden;
  }

  .field input,
  .field select,
  .field textarea,
  .inline-input,
  .filter-field input,
  .filter-field select,
  .leave-change-fields input,
  .day-card input,
  .time-pair input,
  /* Must out-specify .day-card input[type="time"] (0,2,1) from the base
     stylesheet, or iOS keeps zooming on the timesheet's Time In/Out fields. */
  .day-card input[type="time"],
  .day-card input[type="text"],
  .time-pair input[type="time"] {
    font-size: 16px; /* prevents iOS zoom + overlayed keyboard jump */
  }

  .field label,
  .filter-field label {
    line-height: 1.35;
  }

  .card {
    padding: 14px;
  }

  .sidebar .brand img {
    width: min(146px, 42vw);
  }

  .live-clock {
    max-width: 100%;
    white-space: normal;
  }

  .live-clock time {
    white-space: normal;
  }

  .page-live-bar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  #timesheetModal .day-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .day-grid {
    grid-template-columns: 1fr;
  }

  .wfh-toggle,
  #timesheetModal .day-card .wfh-toggle {
    font-size: 0.82rem;
    margin: 0 0 8px;
  }

  .holiday-form {
    grid-template-columns: 1fr;
  }

  .holiday-form-actions .btn {
    flex: 1 1 auto;
  }

  .holiday-list {
    overflow-x: auto;
  }

  .holiday-badge {
    margin: 4px 0 0 0;
  }

  .holiday-table td.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .holiday-upcoming-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .day-card input.wfh-check {
    font-size: inherit;
    width: 18px;
    height: 18px;
  }

  .leave-filter {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  .leave-filter-btn {
    flex: 1 1 auto;
    min-height: 40px;
  }

  .leave-card-actions .btn,
  .viewer-person-actions .btn,
  .signature-card-actions .btn {
    flex: 1 1 100%;
  }

  .signature-card-actions {
    grid-template-columns: 1fr;
  }

  .notif-list .notif-item,
  .viewer-attention-item,
  .viewer-timeline-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
  }

  .notif-body,
  .viewer-timeline-body {
    min-width: 0;
  }

  .notif-tag,
  .viewer-timeline-tag {
    max-width: 4.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stats .stat-card .value {
    font-size: clamp(1.25rem, 7vw, 1.8rem);
  }

  .table-wrap,
  .viewer-detail-table {
    max-width: 100%;
  }

  .doc-preview-frame-wrap,
  .doc-preview-frame {
    min-height: 50vh;
    height: min(60vh, 520px);
  }
}
