:root {
  /* Bridge-era variable names, remapped onto the eval app's blue theme
     (see assets/theme.css for the full token set + dark mode). */
  --bg: oklch(0.9846 0.0017 247.8389);
  --surface: oklch(1.0000 0 0);
  --surface-2: oklch(0.9670 0.0029 264.5419);
  --text: oklch(0.3211 0 0);
  --muted: oklch(0.5510 0.0234 264.3637);
  --border: oklch(0.9276 0.0058 264.5313);
  --accent-1: oklch(0.6231 0.1880 259.8145);
  --accent-2: oklch(0.5461 0.2152 262.8809);
  --success: #0b6b52;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  /* Niramit first so Thai glyphs never fall through to system UI fonts if Latin wins matching */
  font-family: "Niramit", "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

html[lang="en"] body {
  font-family: "Inter", "Niramit", "Segoe UI", system-ui, sans-serif;
}

html[lang="th"] body {
  font-family: "Niramit", "Inter", "Segoe UI", system-ui, sans-serif;
}

html[lang="th"] body.login-body {
  font-family: "Niramit", "Inter", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html[lang="en"] body.login-body {
  font-family: "Inter", "Niramit", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

.dash-sidebar {
  background: linear-gradient(180deg, #6f46ff 0%, #5f39e8 55%, #5734dd 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.2s ease;
}

.dash-logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  color: #ffffff;
}

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

.dash-nav a {
  display: block;
  color: rgba(245, 248, 255, 0.84);
  text-decoration: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
}

.dash-nav a.active,
.dash-nav a:hover {
  color: #fff;
  background: #2b3150;
}

.dash-sidebar a {
  text-decoration: none;
}

.dash-user {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.dash-user-name {
  font-weight: 700;
}

.dash-user-email {
  margin-top: 4px;
  color: rgba(245, 248, 255, 0.78);
  font-size: 13px;
}

.dash-main {
  padding: 24px;
}

.dash-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dash-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dash-topbar h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.mobile-menu-btn {
  display: none;
  min-height: 44px;
  min-width: 72px;
}

.sidebar-backdrop {
  display: none;
}

.sidebar-backdrop[hidden] {
  display: none !important;
  pointer-events: none;
}

.subtext { color: var(--muted); margin: 8px 0 18px; }
.badge {
  display: inline-block;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid #d6dcf0;
  background: #f3f6ff;
  color: #59639a;
}

ul { padding-left: 18px; color: var(--muted); }
li { margin-bottom: 8px; }

/* --- Login (index.php) — neumorphic soft UI --- */
body.login-body {
  --iqra-blue: #1d2c80;
  --iqra-blue-mid: #243691;
  --iqra-blue-bright: #3a54c9;
  --iqra-gold: #e8cf2e;
  --iqra-line: #a8b8e8;
  --iqra-line-focus: #1d2c80;
  --neo-bg: #dde2e8;
  --neo-shadow-dark: #a4afc2;
  --neo-shadow-light: #ffffff;
  --neo-text: #4c5563;
  --neo-text-muted: #6b7280;
  --neo-raised: 12px 12px 24px var(--neo-shadow-dark), -12px -12px 24px var(--neo-shadow-light);
  --neo-raised-sm: 9px 9px 18px var(--neo-shadow-dark), -9px -9px 18px var(--neo-shadow-light);
  --neo-inset: inset 9px 9px 18px var(--neo-shadow-dark), inset -9px -9px 18px var(--neo-shadow-light);
  --neo-pressed: inset 7px 7px 14px var(--neo-shadow-dark), inset -7px -7px 14px var(--neo-shadow-light);
  font-family: "Inter", Niramit, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: rgba(76, 85, 99, 0.12);
  background: var(--neo-bg);
  color: var(--neo-text);
}

body[data-theme="dark"].login-body {
  --neo-bg: #252830;
  --neo-shadow-dark: #14161c;
  --neo-shadow-light: #343a4a;
  --neo-text: #d1d5de;
  --neo-text-muted: #9ca3b8;
  background: var(--neo-bg);
  color: var(--neo-text);
}

.login-body .page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px))
    calc(100px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
}

.login-shell {
  width: 100%;
  max-width: min(960px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--neo-raised);
  background: var(--neo-bg);
}

body[data-theme="dark"].login-body .login-shell {
  box-shadow: var(--neo-raised);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 44px) clamp(20px, 4vw, 32px);
  background: var(--neo-bg);
  color: var(--neo-text);
  text-align: center;
}

.login-brand-inner {
  max-width: 22rem;
  margin-inline: auto;
}

.login-welcome {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--neo-text-muted);
}

.login-logo-wrap {
  margin: 0 auto 14px;
  width: min(140px, 38vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--neo-bg);
  box-shadow: var(--neo-raised-sm);
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
}

.login-logo-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
}

.login-brand-title {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--neo-text);
}

.login-brand-copy {
  margin: 0 0 20px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--neo-text-muted);
}

.login-brand-footer {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neo-text-muted);
}

.login-form-panel {
  position: relative;
  padding: clamp(28px, 5vw, 44px) clamp(22px, 4vw, 40px);
  background: var(--neo-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-panel-header {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.login-panel-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--neo-accent, var(--iqra-blue)) 10%, transparent);
  color: var(--neo-text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-form-intro {
  margin: 0;
  max-width: 34rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--neo-text-muted);
}

.login-qr-pc {
  position: static;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.login-qr-pc:hover {
  opacity: 0.95;
}

.login-qr-pc__host {
  width: 104px;
  height: 104px;
}

.login-qr-pc__host canvas,
.login-qr-pc canvas {
  display: block;
  border-radius: 10px;
  box-shadow: var(--neo-raised-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
}

.login-qr-pc__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--neo-text-muted);
  text-align: left;
}

.login-qr-pc__hint {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--neo-text-muted);
  text-align: left;
  max-width: 20rem;
}

@media (max-width: 640px) {
  .login-qr-pc {
    margin-top: 1.25rem;
    align-items: center;
    max-width: none;
  }

  .login-qr-pc__label,
  .login-qr-pc__hint {
    text-align: center;
  }
}

.nfc-pin-submit--hidden {
  display: none !important;
}

body[data-theme="dark"].login-body .login-form-panel {
  background: var(--neo-bg);
}

.login-form-title {
  margin: 0 0 20px;
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 700;
  color: var(--neo-text);
  letter-spacing: -0.02em;
}

body[data-theme="dark"].login-body .login-form-title {
  color: var(--neo-text);
}

body[data-theme="dark"].login-body .error {
  color: #fecaca;
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(251, 113, 133, 0.42);
}

.login-error {
  margin-bottom: 4px;
}

.login-support-stack {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

.login-support-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.login-support-card {
  padding: 1rem 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(76, 85, 99, 0.14);
  background: color-mix(in srgb, var(--neo-bg) 86%, var(--iqra-blue) 14%);
  box-shadow: var(--neo-raised-sm);
}

.login-support-card--nfc {
  background: color-mix(in srgb, var(--neo-bg) 78%, var(--iqra-blue) 22%);
}

body[data-theme="dark"].login-body .login-support-card {
  border-color: rgba(209, 213, 222, 0.12);
  background: color-mix(in srgb, var(--neo-bg) 84%, var(--iqra-blue) 16%);
}

body[data-theme="dark"].login-body .login-support-card--nfc {
  background: color-mix(in srgb, var(--neo-bg) 76%, var(--iqra-blue) 24%);
}

.login-support-head {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.login-support-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--neo-text);
}

.login-support-copy {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--neo-text-muted);
}

.login-step-list {
  margin: 0.9rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.45rem;
  color: var(--neo-text);
}

.login-step-list li {
  padding-left: 0.1rem;
  line-height: 1.45;
}

.login-secondary-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  font-weight: 700;
  color: var(--iqra-blue);
  text-decoration: none;
}

.login-secondary-link:hover,
.login-secondary-link:focus-visible {
  text-decoration: underline;
}

.login-body .success {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(11, 107, 82, 0.35);
  background: rgba(11, 107, 82, 0.08);
  color: var(--success);
  font-size: 0.9375rem;
}

body[data-theme="dark"].login-body .success {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(74, 222, 128, 0.35);
}

@media (max-width: 879px) {
  .login-shell {
    grid-template-columns: 1fr;
    max-width: min(440px, 100%);
  }

  .login-brand {
    padding-bottom: clamp(28px, 8vw, 40px);
  }

  .login-support-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 880px) {
  .login-page .login-shell {
    min-height: min(520px, calc(100dvh - 140px));
  }
}

#login-form {
  display: grid;
  gap: 22px;
  margin-top: 0;
}

.login-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--neo-text);
  margin-bottom: 6px;
}

body[data-theme="dark"].login-body .login-field label {
  color: var(--neo-text);
}

.login-field-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 22px;
  background: var(--neo-bg);
  box-shadow: var(--neo-inset);
  padding: 4px 14px 4px 18px;
  min-height: 48px;
  box-sizing: border-box;
  transition: box-shadow 0.2s ease;
}

.login-field:focus-within .login-field-row {
  box-shadow: var(--neo-inset), 0 0 0 2px rgba(76, 85, 99, 0.22);
}

body[data-theme="dark"].login-body .login-field:focus-within .login-field-row {
  box-shadow: var(--neo-inset), 0 0 0 2px rgba(180, 190, 255, 0.25);
}

.login-field-check {
  flex-shrink: 0;
  color: var(--neo-text);
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

/* Show only while field is focused — not a server “verified” state */
.login-field:focus-within .login-field-check {
  opacity: 1;
  transform: scale(1);
}

#login-form input {
  flex: 1;
  min-width: 0;
  padding: 8px 4px 8px 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--neo-text);
  outline: none;
  font: inherit;
  font-size: 1rem;
}

#login-form input:focus-visible {
  outline: none;
}

body[data-theme="dark"].login-body #login-form input {
  color: var(--neo-text);
}

#login-form input::placeholder {
  color: var(--neo-text-muted);
  opacity: 1;
}

body[data-theme="dark"].login-body #login-form input::placeholder {
  color: var(--neo-text-muted);
}

.login-credential-hint {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--neo-text-muted);
}

body[data-theme="dark"].login-body .login-credential-hint {
  color: var(--neo-text-muted);
}

.login-forgot {
  margin: -6px 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--neo-text-muted);
}

body[data-theme="dark"].login-body .login-forgot {
  color: var(--neo-text-muted);
}

#login-form button[type="submit"] {
  margin-top: 6px;
  min-height: 48px;
  width: 100%;
  border: 0;
  border-radius: 22px;
  padding: 14px 24px;
  font-weight: 600;
  font-size: 1rem;
  font-family: inherit;
  color: var(--neo-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--neo-bg);
  box-shadow: var(--neo-raised-sm);
  transition:
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

#login-form button[type="submit"]:hover {
  filter: brightness(1.02);
}

#login-form button[type="submit"]:focus-visible {
  outline: 2px solid rgba(76, 85, 99, 0.45);
  outline-offset: 3px;
}

body[data-theme="dark"].login-body #login-form button[type="submit"]:focus-visible {
  outline-color: rgba(180, 190, 255, 0.55);
}

#login-form button[type="submit"]:active {
  box-shadow: var(--neo-pressed);
}

#login-form button[type="submit"][disabled] {
  opacity: 0.72;
  cursor: not-allowed;
  filter: none;
}

#login-form .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(76, 85, 99, 0.25);
  border-top-color: var(--neo-text);
  border-radius: 50%;
  display: none;
  animation: spin 0.8s linear infinite;
}

body[data-theme="dark"].login-body #login-form .spinner {
  border-color: rgba(209, 213, 222, 0.22);
  border-top-color: var(--neo-text);
}

#login-form button.loading .spinner {
  display: inline-block;
}

#login-form button.loading .btn-text {
  opacity: 0.88;
}

/* NFC sign-in (index.php — Chrome Android Web NFC) */
.nfc-login-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(76, 85, 99, 0.2);
}

body[data-theme="dark"].login-body .nfc-login-block {
  border-top-color: rgba(209, 213, 222, 0.12);
}

.nfc-login-heading {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--neo-text);
}

body[data-theme="dark"].login-body .nfc-login-heading {
  color: var(--neo-text);
}

.nfc-login-hint {
  margin: 0 0 12px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--neo-text-muted);
}

.nfc-login-pin-ref {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--neo-text-muted);
}

body[data-theme="dark"].login-body .nfc-login-hint {
  color: var(--neo-text-muted);
}

.nfc-listening-line {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--iqra-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nfc-listening-line::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--iqra-blue);
  animation: nfc-pulse 1.2s ease-in-out infinite;
}

@keyframes nfc-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.nfc-login-block--listening {
  border-radius: 12px;
  padding: 10px 12px;
  margin-left: -4px;
  margin-right: -4px;
  background: rgba(29, 44, 128, 0.06);
  border: 1px solid rgba(29, 44, 128, 0.18);
}

.nfc-login-block--needs-tap {
  outline: 2px dashed var(--iqra-blue);
  outline-offset: 4px;
  border-radius: 12px;
  cursor: pointer;
}

.nfc-login-block--needs-tap:focus-visible {
  outline: 2px solid var(--iqra-blue-bright);
}

body[data-theme="dark"] .nfc-login-block--listening {
  background: rgba(124, 131, 255, 0.1);
  border-color: rgba(124, 131, 255, 0.28);
}

.nfc-signin-status {
  margin: 10px 0 0;
  font-size: 0.875rem;
  color: var(--neo-text-muted);
  min-height: 1.25em;
}

body[data-theme="dark"].login-body .nfc-signin-status {
  color: var(--neo-text-muted);
}

.nfc-signin-status--err {
  color: #b91c1c;
}

body[data-theme="dark"] .nfc-signin-status--err {
  color: #fecaca;
}

.login-body .nfc-login-hint,
.login-body .nfc-signin-status {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.login-body .nfc-login-block--needs-tap {
  min-height: 48px;
  padding: 12px 14px;
  box-sizing: border-box;
}

.skip-link--login-nfc:focus {
  top: max(56px, calc(12px + env(safe-area-inset-top, 0px) + 44px));
  left: max(12px, env(safe-area-inset-left, 0px));
}

/* Login-body pages that still use .card (e.g. nfc_admin.php) — not index login shell */
.login-body .page:not(.login-page) .card {
  width: 100%;
  max-width: min(720px, 100%);
  border-radius: 16px;
  border: 1px solid #e1e6f0;
  background: #fff;
  padding: clamp(20px, 4vw, 28px);
  box-shadow: 0 12px 40px rgba(46, 51, 80, 0.08);
}

body[data-theme="dark"].login-body .page:not(.login-page) .card {
  background: #1c2130;
  border-color: #343a50;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

/* NFC admin (nfc_admin.php) */
.nfc-admin-page .nfc-admin-card {
  max-width: min(720px, 100%);
}

.nfc-admin-back {
  margin: 0 0 12px;
}

.nfc-admin-back a {
  color: var(--accent-1);
  font-weight: 600;
  text-decoration: none;
}

.nfc-admin-back a:hover {
  text-decoration: underline;
}

.nfc-admin-card h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.nfc-admin-card h2 {
  margin: 24px 0 10px;
  font-size: 1.05rem;
}

.nfc-new-token {
  margin: 14px 0 18px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(122, 92, 255, 0.35);
  background: rgba(122, 92, 255, 0.06);
}

.nfc-new-token-label {
  margin: 0 0 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.nfc-token-field {
  margin-top: 12px;
}

.nfc-token-field:first-of-type {
  margin-top: 4px;
}

.nfc-token-field-label {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.nfc-token-code {
  display: block;
  word-break: break-all;
  font-size: 0.8125rem;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.nfc-token-code--url {
  font-size: 0.75rem;
}

.nfc-copy-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 0;
  font-weight: 600;
  font-family: inherit;
  background: var(--accent-1);
  color: #fff;
  cursor: pointer;
}

.nfc-admin-form {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
}

.nfc-admin-form label {
  font-size: 0.9375rem;
  font-weight: 600;
}

.nfc-admin-form input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: max(16px, 1rem);
}

.nfc-admin-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: max(16px, 1rem);
}

.nfc-subject-fields {
  display: grid;
  gap: 6px;
}

.nfc-admin-form button[type="submit"] {
  margin-top: 6px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--accent-1);
  cursor: pointer;
}

.nfc-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

.nfc-table-caption {
  caption-side: top;
  padding: 10px 12px 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
}

.nfc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.nfc-table th,
.nfc-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.nfc-table th {
  font-weight: 600;
  background: var(--surface-2);
}

.nfc-table tr:last-child td {
  border-bottom: 0;
}

.nfc-ua-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-revoked {
  opacity: 0.85;
  border-style: dashed;
}

.nfc-inline-form {
  display: inline;
  margin: 0;
}

button.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-1);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.nfc-revoke-open {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--accent-1);
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
}

.nfc-revoke-open:hover {
  border-color: var(--accent-1);
  background: var(--surface);
}

.nfc-revoke-open:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.nfc-copy-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

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

.nfc-revoke-dialog {
  max-width: min(400px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(46, 51, 80, 0.2);
}

.nfc-revoke-dialog::backdrop {
  background: rgba(15, 18, 30, 0.45);
}

body[data-theme="dark"] .nfc-revoke-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.nfc-revoke-dialog-form {
  padding: 20px 22px;
  display: grid;
  gap: 14px;
}

.nfc-revoke-dialog-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.nfc-revoke-dialog-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
}

.nfc-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.nfc-dialog-btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
}

.nfc-dialog-btn--secondary {
  background: var(--surface-2);
  color: var(--text);
}

.nfc-dialog-btn--danger {
  background: #b91c1c;
  border-color: #991b1b;
  color: #fff;
}

.nfc-dialog-btn--danger:hover {
  filter: brightness(1.05);
}

.nfc-dialog-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

body[data-theme="dark"] .nfc-dialog-btn--danger {
  background: #dc2626;
  border-color: #b91c1c;
}

/* Dashboard: NFC success banner */
.soft-nfc-success-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(11, 107, 82, 0.35);
  background: rgba(11, 107, 82, 0.08);
  color: var(--success);
  font-weight: 600;
  font-size: 0.9375rem;
}

.soft-nfc-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(11, 107, 82, 0.15);
  font-size: 0.85rem;
}

body[data-theme="dark"] .soft-nfc-success-banner {
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

@media (max-width: 480px) {
  #login-form input {
    font-size: max(16px, 1rem);
  }
}

/* Touch devices: 44–48px targets, no hover-only affordances */
@media (hover: none) and (pointer: coarse) {
  .login-body #login-form input {
    min-height: 44px;
    padding: 10px 6px 10px 0;
  }

  .login-body .login-field-row {
    min-height: 52px;
  }

  .login-body #login-form button[type="submit"] {
    min-height: 48px;
    padding: 14px 22px;
  }

  .login-body .login-theme-bar .soft-theme-btn {
    min-height: 48px;
    padding: 0.85rem 1.5rem;
  }

  .login-body #login-form button[type="submit"]:active {
    box-shadow: var(--neo-pressed);
    filter: none;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .login-body .page {
    align-content: start;
    padding-top: max(16px, env(safe-area-inset-top, 0px));
    min-height: min(100vh, 100dvh);
  }

  .login-form-panel {
    padding: clamp(16px, 3vw, 22px) clamp(18px, 3vw, 28px);
  }

  .login-brand-title {
    margin-top: 4px;
    font-size: clamp(1.1rem, 4vw, 1.35rem);
  }

  .login-body .nfc-login-block {
    margin-top: 16px;
    padding-top: 14px;
  }

  .login-body .login-theme-bar {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  #login-form button[type="submit"] {
    transition: none;
  }

  .login-body #login-form .spinner {
    animation: none;
    border-color: rgba(76, 85, 99, 0.28);
    border-top-color: rgba(76, 85, 99, 0.55);
    opacity: 0.85;
  }

  body[data-theme="dark"].login-body #login-form .spinner {
    border-color: rgba(209, 213, 222, 0.22);
    border-top-color: rgba(209, 213, 222, 0.55);
  }

  .nfc-listening-line::before {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.login-body .error {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(190, 24, 93, 0.45);
  color: #881337;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  line-height: 1.45;
}

.dash-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.dash-card {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 14px;
  box-shadow: 0 10px 24px rgba(88, 104, 161, 0.08);
}

.dash-card-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.dash-card-value {
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
}

.logout-btn {
  display: inline-block;
  text-decoration: none;
  color: #4a5281;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
  background: #f4f6fd;
}

.theme-toggle-btn {
  margin-top: 0;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.dash-table-card {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 14px 28px rgba(88, 104, 161, 0.08);
}

.dash-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.repair-table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.repair-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.repair-table th,
.repair-table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.35;
  vertical-align: middle;
  color: var(--text);
}

.repair-row {
  cursor: pointer;
}

.repair-row:hover {
  background: rgba(122, 92, 255, 0.08);
}

.repair-table th {
  color: var(--text);
}

.sort-btn {
  border: 0;
  background: transparent;
  color: #58619b;
  cursor: pointer;
  user-select: none;
  width: 100%;
  text-align: left;
  padding: 0;
  margin: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.sort-indicator {
  font-size: 12px;
  color: var(--muted);
  margin-left: 6px;
}

.status-done {
  color: #166534;
  font-weight: 600;
}

.status-progress {
  color: #854d0e;
  font-weight: 600;
  animation: status-progress-blink 1.1s ease-in-out infinite;
}

.repair-detail-panel {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-2);
}

.repair-detail-frame {
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.mobile-bottom-nav {
  display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes status-progress-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-progress,
  body[data-theme="dark"] .status-progress {
    animation: none;
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .dashboard-shell { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
  .sidebar-backdrop { display: none !important; }
  .mobile-menu-btn {
    display: none;
  }
  .dash-main { padding: 14px 14px 82px; }
  .dash-topbar { flex-direction: column; align-items: flex-start; position: sticky; top: 0; background: var(--bg); z-index: 5; padding-bottom: 8px; }
  .dash-topbar-actions { width: 100%; }
  .theme-toggle-btn,
  .logout-btn { min-height: 44px; }
  .dash-cards { grid-template-columns: 1fr; }
  .repair-table {
    min-width: 100%;
  }
  .repair-table th,
  .repair-table td {
    padding: 8px;
    font-size: 14px;
  }
  .logout-btn {
    min-height: 44px;
  }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 10px;
    background: var(--surface);
    border-top: 1px solid var(--border);
  }

  .mobile-bottom-nav button,
  .mobile-bottom-nav a {
    min-height: 44px;
    margin: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    padding: 8px 10px;
  }
}

@media (max-width: 700px) {
  .repair-table thead {
    display: none;
  }

  .repair-table,
  .repair-table tbody,
  .repair-table tr,
  .repair-table td {
    display: block;
    width: 100%;
  }

  .repair-table tr {
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }

  .repair-table td {
    white-space: normal;
    border-bottom: 0;
    padding: 6px 10px;
  }

  .repair-table td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: var(--muted);
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .dashboard-shell {
    grid-template-columns: 200px 1fr;
  }
  .dash-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body[data-theme="dark"] {
  --bg: #181b2e;
  --surface: #22263a;
  --surface-2: #292f45;
  --text: #e8ecf8;
  --muted: #9aa3c0;
  --border: #343c58;
  --accent-1: #7c83ff;
  --accent-2: #6f5bf0;
}

body[data-theme="dark"] .dash-sidebar {
  background: #1f2235;
  border-right: 1px solid var(--border);
}

body[data-theme="dark"] .dash-nav a {
  color: var(--muted);
}

body[data-theme="dark"] .dash-nav a.active,
body[data-theme="dark"] .dash-nav a:hover {
  color: #fff;
  background: #2b3150;
}

body[data-theme="dark"] .dash-user {
  border: 1px solid var(--border);
  background: #252a42;
}

body[data-theme="dark"] .dash-user-email {
  color: var(--muted);
}

body[data-theme="dark"] .badge {
  border: 1px solid #3d4364;
  background: #2b3150;
  color: #d4dbf8;
}

body[data-theme="dark"] .logout-btn {
  color: #fff;
  background: #2b3150;
}

body[data-theme="dark"] .sort-btn {
  color: #cfd6f6;
}

body[data-theme="dark"] .status-done {
  color: #4ade80;
}

body[data-theme="dark"] .status-progress {
  color: #ca8a04;
}

body[data-theme="dark"] .theme-toggle-btn {
  background: #2b3150;
  color: #e8ecf8;
  border-color: #3d4364;
}

/* --- Soft staff dashboard (dashboard.php) — modular rem scale + Plus Jakarta Sans / Niramit --- */
body.soft-dash-body {
  --soft-font: "Niramit", "Inter", "Segoe UI", system-ui, sans-serif;
  /* Clear steps: caption (0.875) → secondary (0.9375) → body (1) → title → display */
  --soft-text-display: 1.5rem;
  --soft-text-title: 1.1875rem;
  --soft-text-body: 1rem;
  --soft-text-lead: 1.0625rem;
  --soft-text-secondary: 0.9375rem;
  --soft-text-caption: 0.875rem;
  --soft-text-overline: 0.8125rem;
  --soft-text-stat: 1.875rem;
  --soft-line-display: 1.22;
  --soft-line-title: 1.28;
  --soft-line-body: 1.55;
  --soft-line-snug: 1.4;
  --soft-line-caption: 1.5;
  --soft-color-text: #1a1a1a;
  --soft-color-text-muted: #7d7d7d;
  --soft-color-text-soft: #5c5c5c;
  --soft-color-accent: #5e5ce6;

  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--soft-font);
  font-size: var(--soft-text-body);
  line-height: var(--soft-line-body);
  font-synthesis: none;
  font-kerning: normal;
  font-feature-settings: "kern" 1;
  color: var(--soft-color-text);
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  -webkit-tap-highlight-color: rgba(94, 92, 230, 0.12);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html[lang="en"] body.soft-dash-body {
  --soft-font: "Inter", "Niramit", "Segoe UI", system-ui, sans-serif;
}

html[lang="th"] body.soft-dash-body {
  --soft-font: "Niramit", "Inter", "Segoe UI", system-ui, sans-serif;
  --soft-line-body: 1.65;
  --soft-line-caption: 1.58;
  --soft-line-snug: 1.45;
}

.soft-dash-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    145deg,
    #d4e8ff 0%,
    #e8e0ff 42%,
    #dff5ea 78%,
    #eef8f3 100%
  );
}

.soft-dash {
  width: 100%;
  max-width: min(440px, 100%);
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top, 0px) * 0.35) max(18px, env(safe-area-inset-right, 0px)) 28px
    max(18px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 22px);
  box-sizing: border-box;
  touch-action: manipulation;
}

@media (min-width: 1024px) {
  .soft-dash {
    max-width: min(1120px, 100%);
    padding-left: max(24px, env(safe-area-inset-left, 0px));
    padding-right: max(24px, env(safe-area-inset-right, 0px));
  }

  .soft-dash-columns:not(.soft-dash-columns--single) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(16px, 2vw, 24px);
    align-items: start;
  }
}

.soft-dash-flash {
  margin-bottom: 1rem;
}

.soft-dash-flash--success {
  border-color: var(--dash-flash-success-bd, rgba(22, 163, 74, 0.45));
  background: var(--dash-flash-success-bg, rgba(22, 163, 74, 0.08));
}

.soft-dash-flash__p {
  margin: 0;
}

.soft-dash-parent-banner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0;
  margin-bottom: 0.75rem;
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}

.soft-dash-parent-banner__back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  background: transparent;
  color: var(--soft-accent, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.28);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 0;
  transition: background 0.15s, border-color 0.15s;
}

.soft-dash-parent-banner__back-btn:hover {
  background: rgba(37, 99, 235, 0.07);
  border-color: rgba(37, 99, 235, 0.45);
  opacity: 1;
}

.soft-dash-parent-banner__name {
  font-weight: 600;
  font-size: 0.9375rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.soft-dash-parent-banner__badge {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(0,0,0,.07);
  color: var(--text-muted, #666);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .soft-dash-parent-banner {
    padding: 0.35rem 0;
    padding-left: max(0, env(safe-area-inset-left, 0px));
    gap: 0.5rem;
  }

  .soft-dash-parent-banner__back-btn {
    padding: 0.28rem 0.5rem;
    font-size: 0.8125rem;
  }

  .soft-dash-parent-banner__badge {
    display: none;
  }
}

body[data-theme='dark'] .soft-dash-parent-banner__back-btn {
  border-color: rgba(96, 165, 250, 0.45);
  color: var(--soft-accent, #93c5fd);
}

body[data-theme='dark'] .soft-dash-parent-banner__back-btn:hover {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.55);
}

body[data-theme='dark'] .soft-dash-parent-banner__badge {
  background: rgba(255,255,255,.1);
  color: var(--text-muted, #aaa);
}

body[data-theme='dark'].soft-dash-body .soft-dash-flash--success {
  --dash-flash-success-bg: rgba(34, 197, 94, 0.12);
  --dash-flash-success-bd: rgba(74, 222, 128, 0.35);
}

.soft-dash-columns {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 22px);
  min-width: 0;
}

.soft-dash-col {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 22px);
  min-width: 0;
}

.soft-card {
  background: #fff;
  border-radius: 28px;
  box-shadow:
    0 4px 24px rgba(80, 100, 140, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  position: relative;
}

/* Dashboard neumorphic (dashboard.php — same tone as login index.php) */
body.soft-dash-neo {
  --neo-bg: #dde2e8;
  --neo-shadow-dark: #a4afc2;
  --neo-shadow-light: #ffffff;
  --neo-raised: 12px 12px 24px var(--neo-shadow-dark), -12px -12px 24px var(--neo-shadow-light);
  --neo-raised-sm: 9px 9px 18px var(--neo-shadow-dark), -9px -9px 18px var(--neo-shadow-light);
  --neo-inset: inset 9px 9px 18px var(--neo-shadow-dark), inset -9px -9px 18px var(--neo-shadow-light);
  --neo-pressed: inset 7px 7px 14px var(--neo-shadow-dark), inset -7px -7px 14px var(--neo-shadow-light);
  --soft-color-text: #4c5563;
  --soft-color-text-muted: #6b7280;
  --soft-color-text-soft: #5c5c5c;
  --soft-color-accent: #5e5ce6;
  background: var(--neo-bg);
  color: var(--soft-color-text);
}

body.soft-dash-neo .soft-dash-bg {
  background: var(--neo-bg);
}

body.soft-dash-neo .soft-card {
  background: var(--neo-bg);
  border-radius: 22px;
  border: none;
  box-shadow: var(--neo-raised);
}

body.soft-dash-neo .soft-nfc-success-banner {
  background: rgba(11, 107, 82, 0.12);
  border: 1px solid rgba(11, 107, 82, 0.35);
  box-shadow: var(--neo-raised-sm);
}

body.soft-dash-neo .soft-panel--actions,
body.soft-dash-neo .soft-panel--tasks {
  background: var(--neo-bg);
  border: none;
  box-shadow: none;
}

body.soft-dash-neo .soft-action-row {
  background: var(--neo-bg);
  border: none;
  box-shadow: var(--neo-raised-sm);
}

body.soft-dash-neo .soft-action-row:hover {
  box-shadow: var(--neo-raised);
  transform: translateY(-1px);
}

body.soft-dash-neo .soft-task {
  background: var(--neo-bg);
  border: none;
  box-shadow: var(--neo-inset);
}

body.soft-dash-neo .soft-menu-trigger {
  background: var(--neo-bg);
  border: none;
  color: var(--soft-color-text);
  box-shadow: var(--neo-raised-sm);
}

body.soft-dash-neo .soft-menu-trigger:hover {
  background: var(--neo-bg);
  filter: brightness(1.02);
  transform: translateY(-1px);
}

body.soft-dash-neo .soft-menu-trigger[aria-expanded='true'],
body.soft-dash-neo .soft-menu-trigger.is-open {
  box-shadow: var(--neo-pressed);
  filter: none;
}

/* Floating menu: bright surface + strong shadow so controls stay readable */
body.soft-dash-neo .soft-welcome-menu {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.08),
    0 22px 44px -8px rgba(15, 23, 42, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

body.soft-dash-neo .soft-welcome-menu__section {
  border-top-color: rgba(15, 23, 42, 0.1);
}

body.soft-dash-neo .soft-welcome-menu .soft-lang-toggle--menu {
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

body.soft-dash-neo .soft-welcome-menu .soft-lang-opt {
  color: #475569;
}

body.soft-dash-neo .soft-welcome-menu .soft-lang-opt.is-active {
  color: #fff;
}

body.soft-dash-neo .soft-welcome-menu .soft-theme-btn--menu {
  background: #f8fafc;
  color: #111827;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  opacity: 1;
}

body.soft-dash-neo .soft-welcome-menu .soft-theme-btn--menu:hover,
body.soft-dash-neo .soft-welcome-menu .soft-theme-btn--menu:focus-visible {
  background: #f1f5f9;
}

body.soft-dash-neo .soft-welcome-menu .soft-logout--menu {
  background: #f8fafc;
  color: #111827;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

body.soft-dash-neo .soft-welcome-menu .soft-logout--menu:hover {
  background: #f1f5f9;
}

body.soft-dash-neo .soft-role-pill {
  background: rgba(255, 255, 255, 0.55);
  color: var(--soft-color-text-soft);
  box-shadow: 0 1px 2px rgba(76, 85, 99, 0.12);
}

/* Calendar strip on dashboard: match neo cards */
body.soft-dash-neo.tc-page .tc-toolbar {
  background: var(--neo-bg);
  border-radius: 22px;
  box-shadow: var(--neo-raised-sm);
}

body[data-theme='dark'].soft-dash-neo {
  --neo-bg: #252830;
  --neo-shadow-dark: #14161c;
  --neo-shadow-light: #343a4a;
  --neo-raised: 12px 12px 24px var(--neo-shadow-dark), -12px -12px 24px var(--neo-shadow-light);
  --neo-raised-sm: 9px 9px 18px var(--neo-shadow-dark), -9px -9px 18px var(--neo-shadow-light);
  --neo-inset: inset 9px 9px 18px var(--neo-shadow-dark), inset -9px -9px 18px var(--neo-shadow-light);
  --neo-pressed: inset 7px 7px 14px var(--neo-shadow-dark), inset -7px -7px 14px var(--neo-shadow-light);
  --soft-color-text: #d1d5de;
  --soft-color-text-muted: #9ca3b8;
  --soft-color-text-soft: #b0b8cc;
  --soft-color-accent: #a8acff;
  background: var(--neo-bg);
  color: var(--soft-color-text);
}

body[data-theme='dark'].soft-dash-neo .soft-dash-bg {
  background: var(--neo-bg);
}

body[data-theme='dark'].soft-dash-neo .soft-card {
  background: var(--neo-bg);
  box-shadow: var(--neo-raised);
}

body[data-theme='dark'].soft-dash-neo .soft-panel--actions,
body[data-theme='dark'].soft-dash-neo .soft-panel--tasks {
  background: var(--neo-bg);
}

body[data-theme='dark'].soft-dash-neo .soft-action-row {
  background: var(--neo-bg);
  box-shadow: var(--neo-raised-sm);
}

body[data-theme='dark'].soft-dash-neo .soft-action-row:hover {
  box-shadow: var(--neo-raised);
}

body[data-theme='dark'].soft-dash-neo .soft-task {
  background: var(--neo-bg);
  box-shadow: var(--neo-inset);
}

body[data-theme='dark'].soft-dash-neo .soft-menu-trigger {
  background: var(--neo-bg);
  border: none;
  color: var(--soft-color-text);
  box-shadow: var(--neo-raised-sm);
}

body[data-theme='dark'].soft-dash-neo .soft-menu-trigger[aria-expanded='true'],
body[data-theme='dark'].soft-dash-neo .soft-menu-trigger.is-open {
  box-shadow: var(--neo-pressed);
}

/* Dark: menu stays high-contrast vs neo gray */
body[data-theme='dark'].soft-dash-neo .soft-welcome-menu {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid rgba(248, 250, 252, 0.14);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.35),
    0 24px 48px -8px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

body[data-theme='dark'].soft-dash-neo .soft-welcome-menu__section {
  border-top-color: rgba(248, 250, 252, 0.1);
}

body[data-theme='dark'].soft-dash-neo .soft-welcome-menu .soft-lang-toggle--menu {
  background: #334155;
  border: 1px solid rgba(248, 250, 252, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

body[data-theme='dark'].soft-dash-neo .soft-welcome-menu .soft-lang-opt:not(.is-active) {
  color: #cbd5e1;
}

body[data-theme='dark'].soft-dash-neo .soft-welcome-menu .soft-theme-btn--menu {
  background: #334155;
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.14);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  opacity: 1;
}

body[data-theme='dark'].soft-dash-neo .soft-welcome-menu .soft-logout--menu {
  background: #334155;
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.14);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

body[data-theme='dark'].soft-dash-neo .soft-role-pill {
  background: rgba(52, 58, 74, 0.9);
  color: var(--soft-color-text-soft);
  box-shadow: var(--neo-raised-sm);
}

body[data-theme='dark'].soft-dash-neo.tc-page .tc-toolbar {
  background: var(--neo-bg);
  box-shadow: var(--neo-raised-sm);
}

/* Welcome — default: flex column (dashboard adds .soft-welcome--dashboard) */
.soft-welcome {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 18px 16px;
}

/* Stack above .soft-stat-hero (next sibling) so the settings dropdown can receive taps */
.soft-welcome--dashboard {
  position: relative;
  z-index: 20;
  padding-right: 56px;
}

.soft-welcome-text {
  min-width: 0;
}

.soft-welcome-line {
  margin: 0;
  font-size: var(--soft-text-secondary);
  font-weight: 500;
  line-height: var(--soft-line-snug);
  color: var(--soft-color-text-muted);
}

/* Welcome + name on one line; horizontal scroll if needed on narrow screens */
.soft-welcome-greeting {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.35em;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.soft-welcome-greeting .soft-welcome-line {
  flex-shrink: 0;
}

.soft-welcome-greeting .soft-welcome-name {
  flex: 0 0 auto;
  max-width: none;
  min-width: 0;
  white-space: nowrap;
  text-wrap: unset;
  word-break: normal;
  overflow: visible;
}

.soft-welcome-main-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}

.soft-welcome-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.soft-welcome-student-extra {
  width: 100%;
  flex-basis: 100%;
  margin-top: 0.15rem;
}

.soft-welcome-student-class {
  margin: 0;
  font-size: var(--soft-text-secondary);
  line-height: var(--soft-line-snug);
  opacity: 0.9;
  color: var(--soft-color-muted, inherit);
}

.soft-welcome-student-email-msg {
  margin: 0.35rem 0 0;
  font-size: var(--soft-text-caption);
  line-height: 1.45;
  color: #b45309;
}

body[data-theme="dark"] .soft-welcome-student-email-msg {
  color: #fbbf24;
}

.soft-welcome-name {
  margin: 0;
  font-size: var(--soft-text-display);
  font-weight: 600;
  line-height: var(--soft-line-display);
  letter-spacing: -0.015em;
  color: var(--soft-color-accent);
  word-break: break-word;
  /* Do not grow — keeps star + role pills tight after the name */
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(22ch, 100%);
  text-wrap: balance;
}

html[lang="th"] body.soft-dash-body .soft-welcome-name {
  letter-spacing: 0;
}

a.soft-welcome-name.soft-welcome-name--portal {
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

a.soft-welcome-name.soft-welcome-name--portal:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.soft-welcome-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  flex-shrink: 0;
}

.soft-role-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  justify-content: flex-start;
}

.soft-star-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffd66b, #f5b014);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(245, 176, 20, 0.35);
  flex-shrink: 0;
}

.soft-role-pill {
  font-size: var(--soft-text-overline);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--soft-color-text-soft);
  background: #eceef2;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  max-width: 100%;
  word-break: break-word;
}

.soft-logout {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid #e2e4ea;
  background: #fafbfc;
  color: #4a4a4a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.soft-logout:hover {
  background: #f0f2f5;
  transform: translateY(-1px);
}

.soft-welcome-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  margin-inline-start: auto;
  gap: 6px;
  flex-wrap: nowrap;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(250, 251, 252, 0.86);
  box-shadow: 0 2px 10px rgba(60, 80, 120, 0.08);
  white-space: nowrap;
  flex-shrink: 0;
}

.soft-welcome-controls.soft-welcome-dropdown {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 25;
  margin: 0;
}

.soft-welcome-dropdown {
  position: relative;
  isolation: isolate;
}

.soft-menu-trigger {
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border-radius: 14px;
  border: 1px solid #e2e4ea;
  background: #fafbfc;
  color: #4a4a4a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.soft-menu-trigger:hover {
  background: #f0f2f5;
  transform: translateY(-1px);
}

.soft-menu-trigger[aria-expanded='true'],
.soft-menu-trigger.is-open {
  background: #e8eaf0;
  border-color: #c5c8d0;
}

.soft-menu-trigger:focus-visible {
  outline: 2px solid #5e5ce6;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .soft-menu-trigger:hover {
    transform: none;
  }
}

.soft-welcome-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  left: auto;
  width: min(280px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  max-height: min(72vh, 420px);
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 16px 48px rgba(46, 51, 80, 0.16),
    0 4px 16px rgba(30, 36, 51, 0.06);
  z-index: 120;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.soft-welcome-menu__section {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 12px;
  margin-top: 12px;
}

.soft-welcome-menu__section:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.soft-nfc-pin-menu .soft-nfc-pin-head-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  width: 100%;
  padding: 6px 4px;
  box-sizing: border-box;
  border: none;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: start;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.soft-nfc-pin-menu .soft-nfc-pin-head-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.soft-nfc-pin-menu .soft-nfc-pin-head-btn:focus-visible {
  outline: 2px solid var(--soft-color-accent, #5e5ce6);
  outline-offset: 2px;
}

.soft-nfc-pin-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--soft-color-text-soft, #5c5c5c);
}

.soft-nfc-pin-pill {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.soft-nfc-pin-pill__on,
.soft-nfc-pin-pill__off {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.soft-nfc-pin-pill__on {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.15);
  border-color: rgba(13, 148, 136, 0.35);
}

.soft-nfc-pin-pill__off {
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
}

.soft-nfc-pin-hint {
  margin: 0 0 8px;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--soft-color-text-muted, #7d7d7d);
}

.soft-nfc-pin-config-btn {
  width: 100%;
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(250, 251, 252, 0.95);
  color: var(--soft-color-text, #1a1a1a);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.soft-nfc-pin-config-btn:hover {
  background: #f0f2f5;
}

.soft-nfc-pin-panel {
  padding-top: 8px;
}

.soft-nfc-pin-field-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--soft-color-text-soft, #5c5c5c);
}

.soft-nfc-pin-input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.9375rem;
  font-family: inherit;
  letter-spacing: 0.08em;
}

.soft-nfc-pin-action {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 12px;
  border: none;
  background: #5e5ce6;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.soft-nfc-pin-action--danger {
  background: #b91c1c;
}

.soft-nfc-pin-manage-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.soft-nfc-pin-linkish {
  background: none;
  border: none;
  padding: 6px 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #5e5ce6;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.soft-nfc-pin-linkish--muted {
  color: #94a3b8;
}

.soft-nfc-pin-msg {
  margin: 8px 0 0;
  font-size: 0.75rem;
  min-height: 1.2em;
  color: #0f766e;
}

.soft-nfc-pin-msg.soft-nfc-pin-msg--err {
  color: #b91c1c;
}

.soft-qr-pc-menu-btn {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px dashed rgba(94, 92, 230, 0.35);
  background: rgba(94, 92, 230, 0.06);
  color: #4c4f6b;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.soft-qr-pc-menu-btn:hover {
  background: rgba(94, 92, 230, 0.1);
  border-color: rgba(94, 92, 230, 0.5);
}

body[data-theme='dark'].soft-dash-body .soft-qr-pc-menu-btn {
  border-color: rgba(168, 172, 255, 0.35);
  background: rgba(94, 92, 230, 0.12);
  color: #e8ecf4;
}

.soft-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

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

.soft-qr-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.soft-qr-modal__panel {
  position: relative;
  width: min(420px, 100%);
  max-height: min(90vh, 640px);
  overflow: auto;
  padding: 1rem 1.1rem 1.25rem;
  border-radius: 18px;
  background: var(--neo-bg, #dde2e8);
  box-shadow: var(--neo-raised, 0 16px 48px rgba(0, 0, 0, 0.2));
  color: var(--soft-color-text, #1a1a1a);
}

.soft-qr-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.soft-qr-modal__hint {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--soft-color-text-muted, #7d7d7d);
}

.soft-qr-modal__paste-block {
  margin: 0.75rem 0 0;
}

.soft-qr-modal__paste-hint {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--soft-color-text-muted, #7d7d7d);
}

.soft-qr-modal__paste-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: stretch;
}

.soft-qr-modal__paste-input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.95);
  color: #1a1d26;
  font: inherit;
  font-size: 0.8rem;
}

.soft-qr-modal__paste-btn {
  flex: 0 0 auto;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.45);
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

body[data-theme='dark'].soft-dash-body .soft-qr-modal__paste-input {
  background: rgba(38, 43, 60, 0.95);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e8ecf4;
}

body[data-theme='dark'].soft-dash-body .soft-qr-modal__paste-btn {
  border-color: rgba(129, 140, 248, 0.5);
}

.soft-qr-modal__video {
  width: 100%;
  max-height: 240px;
  border-radius: 12px;
  background: #0f172a;
  object-fit: cover;
}

.soft-qr-modal__status {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  min-height: 1.25em;
}

.soft-qr-modal__close {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: inherit;
}

body[data-theme='dark'].soft-dash-body .soft-qr-modal__panel {
  background: #252830;
  color: #e8ecf4;
}

body[data-theme='dark'].soft-dash-body .soft-qr-modal__close {
  background: rgba(38, 43, 60, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e8ecf4;
}

body[data-theme='dark'].soft-dash-body .soft-nfc-pin-config-btn {
  background: rgba(38, 43, 60, 0.88);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e8ecf4;
}

body[data-theme='dark'].soft-dash-body .soft-nfc-pin-menu .soft-nfc-pin-head-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

body[data-theme='dark'].soft-dash-body .soft-nfc-pin-input {
  background: rgba(26, 29, 40, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e8ecf4;
}

.nfc-login-pin-ref {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--neo-text-muted);
}

.nfc-pin-url-step {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 22px;
  background: var(--neo-bg, #dde2e8);
  box-shadow: var(--neo-raised-sm, 0 4px 16px rgba(0, 0, 0, 0.08));
}

.nfc-pin-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nfc-pin-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neo-text, #4c5563);
}

.login-body .nfc-pin-input.neo-inset {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  letter-spacing: 0.12em;
  background: var(--neo-bg, #dde2e8);
  color: var(--neo-text, #1a1a1a);
  box-shadow: var(--neo-inset, inset 4px 4px 10px #a4afc2, inset -4px -4px 10px #ffffff);
}

.login-body .nfc-pin-submit.neo-btn {
  margin-top: 0.25rem;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  background: var(--neo-bg, #dde2e8);
  color: var(--neo-text, #1a1a1a);
  box-shadow: var(--neo-raised-sm, 8px 8px 16px #a4afc2, -8px -8px 16px #ffffff);
}

.nfc-pin-inline {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

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

.nfc-pin-inline-row .nfc-pin-input {
  flex: 1 1 120px;
  min-width: 0;
}

.nfc-pin-inline-row .nfc-pin-submit {
  flex: 0 0 auto;
}

.soft-welcome-menu .soft-lang-toggle--menu {
  position: static;
  left: auto;
  bottom: auto;
  z-index: auto;
  opacity: 1;
  width: 100%;
  justify-content: stretch;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: none;
}

.soft-welcome-menu .soft-lang-opt {
  flex: 1;
  min-height: 40px;
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
}

.soft-welcome-menu .soft-theme-btn--menu {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  font-size: 0.8125rem;
  opacity: 1;
  box-shadow: none;
  white-space: nowrap;
}

.soft-welcome-menu .soft-logout--menu {
  width: 100%;
  height: auto;
  min-height: 44px;
  border-radius: 12px;
  padding: 10px 14px;
  gap: 10px;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9375rem;
}

/* Dashboard welcome: small screens — stack “Welcome back,” above name; full name wraps */
@media (max-width: 767px) {
  .soft-welcome--dashboard .soft-welcome-main-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }

  .soft-welcome--dashboard .soft-welcome-name-row {
    flex-wrap: wrap;
    flex: 1 1 100%;
    min-width: 0;
    align-items: flex-start;
  }

  .soft-welcome--dashboard .soft-welcome-greeting {
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;
    flex-wrap: nowrap;
    gap: 0.2rem;
    overflow-x: visible;
    overflow-y: visible;
    width: 100%;
  }

  .soft-welcome--dashboard .soft-welcome-greeting .soft-welcome-line {
    flex-shrink: 0;
    line-height: 1.25;
  }

  .soft-welcome--dashboard .soft-welcome-greeting .soft-welcome-name {
    flex: 0 1 auto;
    align-self: stretch;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .soft-welcome--dashboard .soft-welcome-name {
    max-width: 100%;
  }

  .soft-welcome--dashboard .soft-welcome-meta {
    align-self: flex-start;
    padding-top: 0.1rem;
  }

  .soft-welcome-controls.soft-welcome-dropdown {
    flex-wrap: nowrap;
    white-space: normal;
  }

  .soft-panel-head {
    align-items: flex-start;
    gap: 8px;
  }

  .soft-panel-title {
    font-size: 1.0625rem;
    line-height: 1.32;
  }

  .soft-pending-badge {
    font-size: 0.8125rem;
    white-space: normal;
  }

  .soft-action-row {
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 0.95rem;
  }

  .soft-action-row .soft-chevron {
    margin-top: 0.25rem;
    flex-shrink: 0;
  }

  .soft-task {
    padding: 0.8rem 0.82rem;
  }

  .soft-task-title {
    font-size: 1rem;
  }

  .soft-task-sub {
    margin-top: 0.3rem;
  }

  .quick-actions-toolbar {
    flex-wrap: wrap;
  }

  .quick-actions-toggle {
    width: 100%;
  }
}

/* Stat grid */
.soft-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.soft-stat {
  border-radius: 24px;
  padding: 16px 14px;
  min-height: 128px;
  position: relative;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 10px 28px rgba(60, 80, 100, 0.12);
}

.soft-stat--green {
  background: linear-gradient(135deg, #2ecc71 0%, #1abc9c 100%);
}

.soft-stat--sunset {
  background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
}

a.soft-stat--link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.soft-stat--link:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(60, 80, 100, 0.2);
}

a.soft-stat--link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}

.soft-stat-content {
  position: relative;
  z-index: 1;
}

.soft-stat-label {
  margin: 0;
  font-size: var(--soft-text-overline);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.1em;
  opacity: 0.95;
}

html[lang="th"] body.soft-dash-body .soft-stat-label {
  letter-spacing: 0.03em;
  text-transform: none;
}

.soft-stat-value {
  margin: 0.5rem 0 0.375rem;
  font-size: var(--soft-text-stat);
  font-weight: 700;
  line-height: var(--soft-line-display);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.soft-stat-hint {
  margin: 0;
  font-size: var(--soft-text-caption);
  font-weight: 500;
  line-height: var(--soft-line-caption);
  opacity: 0.92;
}

.soft-stat-deco {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.soft-stat-deco--check::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 12px;
  border: solid 3px rgba(255, 255, 255, 0.85);
  border-width: 0 0 3px 3px;
  transform: rotate(-45deg) translate(2px, -4px);
}

.soft-stat-deco--alert::after {
  content: "!";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  font-family: "Inter", Niramit, sans-serif;
  line-height: 1;
  padding-bottom: 6px;
}

/* Dashboard stat orb: solid #2D2B55 core + magenta (#FF0080) → cyan (#00F2FF) organic aura */
.soft-stat-hero {
  --stat-orb-core: #2d2b55;
  --stat-orb-magenta: #ff0080;
  --stat-orb-cyan: #00f2ff;
  --ease-stat-out: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4.5vw, 2rem) max(1rem, env(safe-area-inset-right, 0px)) clamp(0.5rem, 2vw, 0.65rem)
    max(1rem, env(safe-area-inset-left, 0px));
  margin-bottom: 4px;
  isolation: isolate;
  /* Avoid paint containment here — it would clip the blurred aura that extends past the orb */
  contain: layout;
}

.soft-stat-hero__aura {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(calc(100vw - 2rem), 320px);
  height: min(calc(100vw - 2rem), 320px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.soft-stat-hero--clickable {
  cursor: pointer;
}

/* Below the stat orb — avoids circular overflow clipping and carousel swipe handlers blocking taps */
.soft-stat-hero-att-detail {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  margin-bottom: 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.9rem;
  font-size: max(var(--soft-text-caption), 0.875rem);
  font-weight: 600;
  color: var(--iqra-blue, #1e3a8a);
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

.soft-stat-hero-att-detail:hover {
  color: var(--iqra-blue-bright, #2563eb);
}

body[data-theme="dark"].soft-dash-body .soft-stat-hero-att-detail {
  color: var(--stat-orb-cyan, #00f2ff);
}

body[data-theme="dark"].soft-dash-body .soft-stat-hero-att-detail:hover {
  color: #fff;
}

.soft-stat-nfc-month-note {
  position: relative;
  z-index: 2;
  max-width: min(100%, 22rem);
  margin: 6px 12px 0;
  padding: 10px 12px;
  font-size: max(var(--soft-text-caption), 0.8125rem);
  line-height: 1.45;
  font-weight: 500;
  color: var(--soft-text-muted, #475569);
  text-align: center;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
}

body[data-theme="dark"].soft-dash-body .soft-stat-nfc-month-note {
  color: rgba(226, 232, 240, 0.88);
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.28);
}

.soft-stat-aura-stack {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 142%;
  height: 142%;
  margin: -71% 0 0 -71%;
  animation: soft-stat-aura-rotate 38s linear infinite;
  backface-visibility: hidden;
  will-change: transform;
}

.soft-stat-aura-piece {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
}

/* Magenta-weighted glow (left) — irregular “star” silhouette */
.soft-stat-aura-piece--a {
  background: radial-gradient(ellipse 72% 78% at 6% 50%, rgba(255, 120, 80, 0.62) 0%, rgba(255, 120, 80, 0.18) 48%, transparent 68%);
  filter: blur(20px);
  clip-path: polygon(46% 0%, 74% 10%, 100% 36%, 90% 58%, 100% 82%, 54% 100%, 22% 88%, 0% 58%, 6% 32%, 26% 8%);
  mix-blend-mode: screen;
  opacity: 0.88;
  animation: soft-stat-aura-pulse 6.5s ease-in-out infinite;
}

/* Cyan-weighted glow (right) */
.soft-stat-aura-piece--b {
  background: radial-gradient(ellipse 72% 78% at 94% 50%, rgba(40, 205, 190, 0.58) 0%, rgba(40, 205, 190, 0.16) 46%, transparent 66%);
  filter: blur(20px);
  clip-path: polygon(54% 2%, 88% 20%, 100% 52%, 88% 80%, 58% 98%, 28% 90%, 0% 62%, 10% 34%, 32% 10%, 62% 0%);
  mix-blend-mode: screen;
  opacity: 0.85;
  animation: soft-stat-aura-pulse 7.5s ease-in-out infinite 0.35s reverse;
}

/* Conic bridge magenta → cyan — second organic outline */
.soft-stat-aura-piece--c {
  background: conic-gradient(
    from 225deg at 50% 50%,
    rgba(255, 105, 135, 0.5),
    rgba(255, 105, 135, 0.14),
    rgba(255, 182, 72, 0.45),
    rgba(255, 182, 72, 0.12),
    rgba(72, 194, 255, 0.42),
    rgba(72, 194, 255, 0.16),
    rgba(172, 120, 255, 0.4),
    rgba(255, 105, 135, 0.5)
  );
  filter: blur(24px);
  clip-path: polygon(50% 0%, 78% 12%, 100% 42%, 92% 72%, 68% 100%, 32% 96%, 0% 68%, 4% 32%, 30% 4%);
  mix-blend-mode: screen;
  opacity: 0.58;
  animation: soft-stat-aura-pulse 5.8s ease-in-out infinite 0.15s;
}

/* Layered colored shadows — soft “peaks” without a perfect circle */
.soft-stat-aura-piece--d {
  background: transparent;
  border-radius: 40% 60% 55% 45% / 42% 38% 62% 58%;
  box-shadow:
    -32px 0 56px 12px rgba(255, 120, 80, 0.28),
    32px 0 56px 12px rgba(40, 205, 190, 0.26),
    0 -26px 48px 10px rgba(255, 105, 135, 0.22),
    0 28px 52px 10px rgba(72, 194, 255, 0.2),
    -14px -18px 40px rgba(255, 182, 72, 0.16),
    16px 20px 44px rgba(172, 120, 255, 0.15);
  filter: blur(10px);
  transform: scale(0.88);
  mix-blend-mode: screen;
  opacity: 0.92;
  animation: soft-stat-aura-pulse-d 9s ease-in-out infinite 0.8s;
}

/* Diffuse halo tying colors */
.soft-stat-aura-piece--e {
  background: radial-gradient(ellipse 90% 88% at 48% 50%, rgba(255, 182, 72, 0.12) 0%, rgba(72, 194, 255, 0.12) 45%, rgba(172, 120, 255, 0.08) 64%, transparent 74%);
  filter: blur(30px);
  border-radius: 46% 54% 51% 49% / 52% 46% 54% 48%;
  mix-blend-mode: screen;
  opacity: 0.75;
  animation: soft-stat-aura-pulse 11s ease-in-out infinite 0.5s;
}

@keyframes soft-stat-aura-rotate {
  from {
    transform: translateZ(0) rotate(0deg);
  }
  to {
    transform: translateZ(0) rotate(360deg);
  }
}

@keyframes soft-stat-aura-pulse {
  0%,
  100% {
    transform: translateZ(0) scale(1);
  }
  50% {
    transform: translateZ(0) scale(1.07);
  }
}

@keyframes soft-stat-aura-pulse-d {
  0%,
  100% {
    transform: translateZ(0) scale(0.88);
  }
  50% {
    transform: translateZ(0) scale(0.94);
  }
}

@media (prefers-reduced-motion: reduce) {
  .soft-stat-aura-stack,
  .soft-stat-aura-piece {
    animation: none !important;
    will-change: auto;
  }

  .soft-stat-aura-stack {
    transform: translateZ(0);
  }

  .soft-stat-aura-piece--d {
    transform: translateZ(0) scale(0.88) !important;
  }
}

.soft-stat-carousel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(100%, clamp(208px, 58vw, 248px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  outline: none;
  touch-action: pan-y;
}

.soft-stat-carousel:focus-visible {
  outline: 2px solid rgba(94, 92, 230, 0.65);
  outline-offset: 6px;
  border-radius: 999px;
}

.soft-stat-carousel__viewport {
  width: min(100%, clamp(200px, 72vw, 228px));
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    -14px 0 32px -4px rgba(255, 0, 128, 0.32),
    14px 0 32px -4px rgba(0, 242, 255, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 16px 44px rgba(0, 0, 0, 0.42);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.soft-stat-carousel__viewport:active {
  cursor: grabbing;
}

.soft-stat-carousel__track {
  display: flex;
  width: calc(var(--stat-carousel-slides, 4) * 100%);
  height: 100%;
  transition: transform 0.42s var(--ease-stat-out, cubic-bezier(0.22, 1, 0.36, 1));
}

.soft-stat-carousel--dragging .soft-stat-carousel__track {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .soft-stat-carousel__track {
    transition: none;
  }
}

.soft-stat-carousel__slide {
  flex: 0 0 calc(100% / var(--stat-carousel-slides, 4));
  height: 100%;
  box-sizing: border-box;
  padding: 2px;
}

.soft-stat-carousel--single {
  --stat-carousel-slides: 1;
}

.soft-stat-face {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 14px 18px;
  position: relative;
  overflow: hidden;
  color: #f4f4fb;
  background: var(--stat-orb-core, #2d2b55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.soft-stat-face .soft-stat-content {
  text-align: center;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

.soft-stat-face .soft-stat-label,
.soft-stat-face .soft-stat-value,
.soft-stat-face .soft-stat-hint {
  text-align: center;
  color: inherit;
}

.soft-stat-face--link {
  display: block;
  text-decoration: none;
  /* Match .soft-stat-face — inherit would pull body/dashboard text (#1a1a1a) on <a> */
  color: #f4f4fb;
}

.soft-stat-face--link:visited {
  color: #f4f4fb;
}

.soft-stat-face .soft-stat-hint {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 3;
  line-height: 1.55;
}

.soft-stat-face .soft-stat-value {
  text-shadow:
    0 0 24px rgba(0, 242, 255, 0.25),
    0 2px 16px rgba(0, 0, 0, 0.35);
}

.soft-stat-face .soft-stat-deco {
  right: 10%;
  top: auto;
  bottom: 10%;
  transform: none;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(255, 0, 128, 0.2), rgba(0, 242, 255, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.soft-stat-inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  margin-top: 6px;
  padding: 0.35rem 0.75rem;
  font-size: max(var(--soft-text-caption), 0.8125rem);
  font-weight: 600;
  color: var(--stat-orb-cyan, #00f2ff);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-shadow: 0 0 12px rgba(0, 242, 255, 0.35);
  border-radius: 999px;
  transition:
    color 0.2s var(--ease-stat-out, cubic-bezier(0.22, 1, 0.36, 1)),
    text-shadow 0.2s var(--ease-stat-out, cubic-bezier(0.22, 1, 0.36, 1)),
    transform 0.15s var(--ease-stat-out, cubic-bezier(0.22, 1, 0.36, 1));
}

.soft-stat-inline-link:hover {
  color: #fff;
  text-shadow:
    0 0 16px rgba(0, 242, 255, 0.55),
    0 0 20px rgba(255, 0, 128, 0.25);
}

.soft-stat-inline-link:active {
  transform: scale(0.98);
}

.soft-stat-carousel__dots {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 4px 6px;
}

/* 44×44px minimum touch targets (visual dot inside) */
.soft-stat-carousel__dot {
  position: relative;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease-stat-out, cubic-bezier(0.22, 1, 0.36, 1));
}

.soft-stat-carousel__dot:focus-visible {
  outline: 2px solid #5e5ce6;
  outline-offset: 3px;
}

.soft-stat-carousel__dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: rgba(100, 116, 139, 0.5);
  transition:
    transform 0.2s var(--ease-stat-out, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow 0.2s var(--ease-stat-out, cubic-bezier(0.22, 1, 0.36, 1)),
    background 0.2s var(--ease-stat-out, cubic-bezier(0.22, 1, 0.36, 1));
}

.soft-stat-carousel__dot:hover::after {
  transform: scale(1.2);
  background: rgba(71, 85, 105, 0.75);
}

.soft-stat-carousel__dot:active::after {
  transform: scale(0.92);
}

.soft-stat-carousel__dot.is-active::after {
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: #5e5ce6;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.2),
    0 0 10px rgba(94, 92, 230, 0.26);
}

.soft-stat-carousel__hint {
  margin: 0;
  font-size: clamp(0.8125rem, 2.6vw, 0.875rem);
  font-weight: 500;
  color: var(--soft-color-text-soft, #64748b);
  text-align: center;
  max-width: min(18rem, 92vw);
  line-height: 1.4;
  padding: 0 max(0.5rem, env(safe-area-inset-right, 0px)) 0 max(0.5rem, env(safe-area-inset-left, 0px));
}

.soft-stat-carousel--single .soft-stat-carousel__dots,
.soft-stat-carousel--single .soft-stat-carousel__hint {
  display: none;
}

body[data-theme="dark"].soft-dash-body .soft-stat-carousel__hint {
  color: #94a3b8;
}

body[data-theme="dark"].soft-dash-body .soft-stat-carousel__dot::after {
  background: rgba(148, 163, 184, 0.45);
}

body[data-theme="dark"].soft-dash-body .soft-stat-carousel__dot:hover::after {
  background: rgba(203, 213, 225, 0.55);
}

/* Panels */
.soft-panel {
  padding: 18px 16px 16px;
}

.soft-panel--actions {
  background: linear-gradient(180deg, #f5f8ff 0%, #ffffff 55%);
  border: 1px solid rgba(94, 92, 230, 0.08);
}

.soft-panel--tasks {
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 50%);
  border: 1px solid rgba(255, 180, 100, 0.12);
  overflow: hidden;
}

.soft-blob {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 120, 0.45) 0%, transparent 70%);
  top: -30px;
  right: -24px;
  pointer-events: none;
}

.soft-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.soft-panel-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: var(--soft-text-title);
  font-weight: 700;
  line-height: var(--soft-line-title);
  letter-spacing: -0.02em;
  color: var(--soft-color-text);
}

.soft-panel-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  flex-shrink: 0;
}

.soft-panel-icon--bolt {
  background: linear-gradient(135deg, #a78bfa, #5e5ce6);
  box-shadow: 0 4px 12px rgba(94, 92, 230, 0.25);
}

.soft-panel-icon--bolt::after {
  content: "⚡";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 14px;
  filter: grayscale(1) brightness(10);
}

.soft-panel-icon--board {
  background: linear-gradient(135deg, #ffb347, #ff7e5f);
  box-shadow: 0 4px 12px rgba(255, 126, 95, 0.25);
}

.soft-panel-icon--board::after {
  content: "📋";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 13px;
}

.soft-pending-badge {
  font-size: var(--soft-text-caption);
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: #7a5a2e;
  background: #fff3d4;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.soft-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0.875rem 1rem;
  background: #fff;
  border-radius: 18px;
  text-decoration: none;
  color: var(--soft-color-text);
  font-weight: 600;
  font-size: var(--soft-text-body);
  line-height: var(--soft-line-snug);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid #eef0f4;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.soft-action-row .soft-i18n {
  max-width: 36ch;
}

.quick-actions-shell {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quick-actions-toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.quick-actions-search-wrap {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.4rem 0.7rem;
  border: 1px solid #dfe4ed;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.quick-actions-search-icon {
  font-size: 0.95rem;
  color: var(--soft-color-text-muted);
  line-height: 1;
}

.quick-actions-search {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--soft-color-text);
  font: inherit;
  font-size: var(--soft-text-secondary);
  line-height: 1.35;
  outline: none;
}

.quick-actions-toggle {
  flex: 0 0 auto;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid #d9dff0;
  background: #f7f9ff;
  color: #4a4f7a;
  font-size: var(--soft-text-caption);
  font-weight: 700;
  padding: 0.45rem 0.72rem;
  cursor: pointer;
}

.quick-actions-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.quick-actions-group-title {
  margin: 0.2rem 0 0;
  font-size: var(--soft-text-caption);
  line-height: var(--soft-line-caption);
  font-weight: 700;
  color: var(--soft-color-text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

html[lang="th"] body.soft-dash-body .quick-actions-group-title {
  letter-spacing: 0;
  text-transform: none;
}

.quick-actions-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.soft-action-row:hover {
  box-shadow: 0 6px 20px rgba(94, 92, 230, 0.12);
  transform: translateY(-1px);
}

.soft-action-row:focus-visible {
  outline: 2px solid #5e5ce6;
  outline-offset: 3px;
}

/* Gmail / Drive quick links — notification-style dots (opens Google in a new tab) */
.dash-google-app__left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.dash-google-app__dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dash-google-app__dot--gmail {
  background: #ea4335;
  box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.22);
}

.dash-google-app--gmail:hover .dash-google-app__dot--gmail {
  box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.35);
}

body[data-theme="dark"].soft-dash-body .dash-google-app__dot--gmail {
  box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.35);
}

.dash-google-app__dot--drive {
  background: #4285f4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.22);
}

.dash-google-app--drive:hover .dash-google-app__dot--drive {
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.35);
}

body[data-theme="dark"].soft-dash-body .dash-google-app__dot--drive {
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.35);
}

.soft-logout:focus-visible {
  outline: 2px solid #5e5ce6;
  outline-offset: 2px;
}

.soft-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #c5c8d0;
  border-bottom: 2px solid #c5c8d0;
  transform: rotate(-45deg);
  margin-right: 4px;
}

/* Tasks */
.soft-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.parent-orb-panel {
  overflow: hidden;
}

.parent-orb-hero {
  margin: 0;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.parent-orb-scene {
  width: clamp(138px, 24vw, 178px);
  height: clamp(138px, 24vw, 178px);
  margin: 0 auto;
  perspective: 1000px;
  position: relative;
  z-index: 1;
  touch-action: pan-y;
}

.parent-orb-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.parent-orb-face {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,0.48), rgba(246,244,255,0.24) 62%, rgba(236,246,255,0.18) 100%);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  color: #4a5363;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.12);
  transition: box-shadow .16s ease, background .16s ease, transform .16s ease;
  backface-visibility: hidden;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  overflow: hidden;
}

.parent-orb-face::before,
.parent-orb-face::after {
  content: "";
  position: absolute;
  inset: 7px;
  pointer-events: none;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.parent-orb-face::before {
  border: 1.7px solid rgba(129, 118, 235, 0.48);
  animation: parent-octagon-spin-cw 8.5s linear infinite;
}

.parent-orb-face::after {
  inset: 13px;
  border: 1.4px solid rgba(150, 212, 255, 0.34);
  animation: parent-octagon-spin-ccw 10.5s linear infinite;
}

.parent-orb-scene--few .parent-orb-face {
  backface-visibility: visible;
}

.parent-orb-face__label {
  display: block;
  text-align: center;
  font-weight: 700;
  line-height: 1.2;
  font-size: 0.9rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  position: relative;
  z-index: 2;
}

.parent-orb-face:hover {
  box-shadow: 0 14px 26px rgba(91, 84, 179, 0.2);
}

.parent-orb-face.is-active {
  background:
    radial-gradient(circle at 42% 30%, rgba(255,255,255,0.84), rgba(244,239,255,0.58) 58%, rgba(228,246,255,0.5) 100%);
  box-shadow: 0 16px 30px rgba(106, 90, 205, 0.24);
}

.parent-orb-face.is-active::before {
  border-color: rgba(118, 103, 219, 0.74);
  border-width: 2px;
}

.parent-orb-face.is-active::after {
  border-color: rgba(136, 219, 255, 0.55);
}

@keyframes parent-octagon-spin-cw {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes parent-octagon-spin-ccw {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.parent-child-details-wrap {
  margin-top: 0.4rem;
}

.parent-child-detail {
  display: none;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  background: rgba(255,255,255,.72);
}

.parent-child-detail.is-active {
  display: block;
}

.parent-child-detail__title {
  margin: 0 0 0.15rem;
  font-weight: 700;
  color: #374151;
}

.parent-child-detail__meta {
  margin: 0;
  color: #6b7280;
  font-size: 0.88rem;
}

.parent-inline-dash {
  margin-top: 0.85rem;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.75);
}

.parent-inline-dash__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: rgba(248,250,252,.9);
}

.parent-inline-dash__title {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
  color: #374151;
}

.parent-inline-dash__close {
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 8px;
  background: #fff;
  color: #4b5563;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
}

.parent-inline-dash__frame {
  width: 100%;
  height: min(74vh, 860px);
  border: 0;
  display: block;
  background: #fff;
}

.soft-task {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #f0f1f4;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.soft-task-check {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid #d8dbe2;
  flex-shrink: 0;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.soft-task--done {
  opacity: 0.72;
}

.soft-task--done .soft-task-title {
  text-decoration: line-through;
  color: #9a9a9a;
}

.soft-task--done .soft-task-sub {
  color: #a8a8a8;
}

.soft-task--done .soft-task-check {
  background: #e8eaee;
  border-color: #dcdfe5;
  color: #7d7d7d;
}

.soft-task--empty {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.65);
}

.soft-task--empty .soft-task-title {
  font-weight: 600;
  color: var(--soft-color-text-muted);
}

.soft-task-body {
  min-width: 0;
}

.soft-task-title {
  margin: 0;
  font-size: var(--soft-text-lead);
  font-weight: 700;
  line-height: var(--soft-line-snug);
  letter-spacing: -0.01em;
  color: var(--soft-color-text);
  word-break: break-word;
  max-width: 44ch;
}

.soft-task-sub {
  margin: 0.25rem 0 0;
  font-size: var(--soft-text-caption);
  font-weight: 500;
  line-height: var(--soft-line-caption);
  color: var(--soft-color-text-muted);
}

/* Repair table in soft theme */
.soft-table-wrap {
  padding: 18px 16px 20px;
}

.soft-table-wrap .dash-table-head {
  flex-wrap: wrap;
  gap: 10px;
}

.soft-table-wrap .dash-table-head h2 {
  margin: 0;
  font-size: var(--soft-text-title);
  font-weight: 700;
  line-height: var(--soft-line-title);
  letter-spacing: -0.015em;
}

.soft-table-wrap .repair-table {
  font-size: var(--soft-text-caption);
  line-height: var(--soft-line-snug);
  font-variant-numeric: tabular-nums;
}

.soft-table-wrap .repair-table th {
  font-size: var(--soft-text-caption);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.soft-table-wrap .subtext {
  font-size: var(--soft-text-secondary);
  line-height: var(--soft-line-body);
  max-width: 65ch;
  color: var(--soft-color-text-muted);
}

.soft-table-wrap .badge {
  font-size: var(--soft-text-caption);
  font-weight: 600;
  line-height: 1.3;
}

.soft-table-wrap .error {
  font-size: var(--soft-text-secondary);
  line-height: var(--soft-line-snug);
  color: #b42318;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.soft-table-wrap .repair-detail-frame {
  min-height: 360px;
}

/* Language bar */
.soft-lang-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  justify-content: center;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  pointer-events: none;
}

.soft-lang-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 4px 14px rgba(60, 80, 120, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  border: 1px solid rgba(0, 0, 0, 0.06);
  pointer-events: auto;
  opacity: 0.92;
  transition: opacity 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.soft-lang-opt {
  border: 0;
  margin: 0 !important;
  padding: 0.5rem 0.9rem;
  min-height: 44px;
  min-width: 44px;
  background: transparent !important;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.25;
  font-family: inherit;
  cursor: pointer;
  color: var(--soft-color-text-muted);
  transition: background 0.2s ease, color 0.2s ease;
}

.soft-lang-opt:focus-visible {
  outline: 2px solid #5e5ce6;
  outline-offset: 2px;
}

.soft-lang-opt.is-active {
  background: rgba(94, 92, 230, 0.84) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(94, 92, 230, 0.24);
}

.soft-lang-opt:not(.is-active):hover {
  color: #1a1a1a;
}

.soft-lang-toggle:hover,
.soft-lang-toggle:focus-within {
  opacity: 1;
}

.soft-lang-bar .soft-lang-toggle {
  position: fixed;
  left: max(12px, env(safe-area-inset-left, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
}

.soft-bottom-bar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.soft-bottom-bar-inner .soft-theme-btn,
.soft-bottom-bar-inner .soft-lang-toggle {
  pointer-events: auto;
}

.soft-theme-btn {
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin: 0;
  padding: 0.45rem 0.8rem;
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.25;
  font-family: inherit;
  cursor: pointer;
  color: var(--soft-color-text);
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 4px 14px rgba(60, 80, 120, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  opacity: 0.92;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.soft-theme-btn:focus-visible {
  outline: 2px solid #5e5ce6;
  outline-offset: 3px;
}

.soft-theme-btn:hover,
.soft-theme-btn:focus-visible {
  opacity: 1;
}

.soft-lang-bar .soft-theme-btn,
.login-theme-bar .soft-theme-btn {
  position: fixed;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
}

.login-theme-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  justify-content: center;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Dark theme: soft dashboard + attendance log (body.soft-dash-body) */
body[data-theme="dark"].soft-dash-body {
  --soft-color-text: #e8ecf4;
  --soft-color-text-muted: #98a1b8;
  --soft-color-text-soft: #b0b8cc;
  --soft-color-accent: #a8acff;
  color: var(--soft-color-text);
  -webkit-tap-highlight-color: rgba(140, 148, 255, 0.2);
}

body[data-theme="dark"].soft-dash-body .soft-dash-bg {
  background: linear-gradient(155deg, #12151f 0%, #1a1f2e 42%, #152026 100%);
}

body[data-theme="dark"].soft-dash-body .soft-card {
  background: #262b3c;
  box-shadow:
    0 4px 28px rgba(0, 0, 0, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

body[data-theme="dark"].soft-dash-body .soft-logout {
  border-color: #3d4458;
  background: #2a3042;
  color: #e8ecf4;
}

body[data-theme="dark"].soft-dash-body .soft-logout:hover {
  background: #343a50;
}

body[data-theme="dark"].soft-dash-body .soft-role-pill {
  background: #343a50;
  color: var(--soft-color-text-soft);
}

body[data-theme="dark"].soft-dash-body .soft-panel--actions {
  background: linear-gradient(180deg, #2a3048 0%, #262b3c 55%);
  border-color: rgba(155, 158, 255, 0.14);
}

body[data-theme="dark"].soft-dash-body .soft-panel--tasks {
  background: linear-gradient(180deg, #2d2838 0%, #262b3c 50%);
  border-color: rgba(255, 160, 120, 0.12);
}

body[data-theme="dark"].soft-dash-body .soft-blob {
  background: radial-gradient(circle, rgba(255, 200, 100, 0.12) 0%, transparent 70%);
}

body[data-theme="dark"].soft-dash-body .soft-action-row {
  background: #2f3548;
  border-color: #3d4458;
  color: var(--soft-color-text);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

body[data-theme="dark"].soft-dash-body .soft-action-row:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.22);
}

body[data-theme="dark"].soft-dash-body .quick-actions-search-wrap {
  border-color: rgba(186, 196, 223, 0.28);
  background: rgba(30, 35, 46, 0.65);
}

body[data-theme="dark"].soft-dash-body .quick-actions-search {
  color: #e8ecf8;
}

body[data-theme="dark"].soft-dash-body .quick-actions-toggle {
  background: rgba(76, 86, 118, 0.26);
  border-color: rgba(177, 188, 219, 0.28);
  color: #dbe4ff;
}

body[data-theme="dark"].soft-dash-body .soft-chevron {
  border-color: #7a8199;
}

body[data-theme="dark"].soft-dash-body .soft-task {
  background: #2f3548;
  border-color: #3d4458;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body[data-theme="dark"].soft-dash-body .soft-task-check {
  background: #262b3c;
  border-color: #555c72;
}

body[data-theme="dark"].soft-dash-body .soft-task--done .soft-task-title {
  color: #8f96a8;
}

body[data-theme="dark"].soft-dash-body .soft-task--done .soft-task-sub {
  color: #7a8194;
}

body[data-theme="dark"].soft-dash-body .soft-task--done .soft-task-check {
  background: #323848;
  border-color: #4a5166;
  color: #9aa0b0;
}

body[data-theme="dark"].soft-dash-body .soft-pending-badge {
  color: #f0d49a;
  background: rgba(120, 90, 40, 0.4);
}

body[data-theme="dark"].soft-dash-body .soft-lang-toggle {
  background: rgba(38, 43, 60, 0.76);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

body[data-theme="dark"].soft-dash-body .soft-welcome-controls.soft-welcome-dropdown {
  background: transparent;
  border: none;
  box-shadow: none;
}

body[data-theme="dark"].soft-dash-body .soft-menu-trigger {
  background: rgba(38, 43, 60, 0.88);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e8ecf4;
}

body[data-theme="dark"].soft-dash-body .soft-menu-trigger:hover {
  background: rgba(48, 54, 74, 0.95);
}

body[data-theme="dark"].soft-dash-body .soft-menu-trigger[aria-expanded='true'],
body[data-theme="dark"].soft-dash-body .soft-menu-trigger.is-open {
  background: rgba(38, 43, 60, 0.98);
  border-color: rgba(255, 255, 255, 0.16);
}

body[data-theme="dark"].soft-dash-body .soft-welcome-menu {
  background: rgba(38, 43, 60, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

body[data-theme="dark"].soft-dash-body .soft-welcome-menu__section {
  border-top-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"].soft-dash-body .soft-welcome-menu .soft-lang-toggle--menu {
  background: rgba(38, 43, 60, 0.94);
}

body[data-theme="dark"].soft-dash-body .soft-lang-opt:not(.is-active):hover {
  color: #e8ecf4;
}

body[data-theme="dark"].soft-dash-body .soft-theme-btn {
  background: rgba(38, 43, 60, 0.76);
  color: var(--soft-color-text);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

body[data-theme="dark"].soft-dash-body .soft-welcome-menu .soft-theme-btn--menu {
  background: rgba(38, 43, 60, 0.94);
  box-shadow: none;
}

body[data-theme="dark"].soft-dash-body .soft-theme-btn:focus-visible {
  outline-color: #8b8fff;
}

/* Neo dashboard: beat generic .soft-dash-body dark rules above — kebab + panel stay readable */
body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-menu-trigger {
  background: var(--neo-bg);
  border: none;
  color: var(--soft-color-text);
  box-shadow: var(--neo-raised-sm);
}

body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-menu-trigger:hover {
  background: var(--neo-bg);
  filter: brightness(1.02);
  transform: translateY(-1px);
}

body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-menu-trigger[aria-expanded='true'],
body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-menu-trigger.is-open {
  box-shadow: var(--neo-pressed);
  filter: none;
}

body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-welcome-menu {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid rgba(248, 250, 252, 0.14);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.35),
    0 24px 48px -8px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-welcome-menu__section {
  border-top-color: rgba(248, 250, 252, 0.1);
}

body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-welcome-menu .soft-lang-toggle--menu {
  background: #334155;
  border: 1px solid rgba(248, 250, 252, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-welcome-menu .soft-lang-opt:not(.is-active) {
  color: #cbd5e1;
}

body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-welcome-menu .soft-lang-opt:not(.is-active):hover {
  color: #f1f5f9;
}

body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-welcome-menu .soft-theme-btn--menu {
  background: #334155;
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.14);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  opacity: 1;
}

body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-welcome-menu .soft-theme-btn--menu:hover,
body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-welcome-menu .soft-theme-btn--menu:focus-visible {
  background: #3d4f63;
}

body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-welcome-menu .soft-logout--menu {
  background: #334155;
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.14);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

body[data-theme="dark"].soft-dash-body.soft-dash-neo .soft-welcome-menu .soft-logout--menu:hover {
  background: #3d4f63;
}

body[data-theme="dark"].soft-dash-body .soft-table-wrap .repair-detail-frame {
  background: #1a1d28;
  border-color: var(--border);
}

body[data-theme="dark"].soft-dash-body .repair-row:hover {
  background: rgba(122, 92, 255, 0.14);
}

body[data-theme="dark"].soft-dash-body .soft-table-wrap .error {
  color: #fca5a5;
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.35);
}

body[data-theme="dark"].soft-dash-body .att-log-banner {
  background: #2a3042;
  border-color: #3d4458;
  color: var(--soft-color-text);
}

body[data-theme="dark"].soft-dash-body .att-log-sub code,
body[data-theme="dark"].soft-dash-body .att-log-cycle-hint code,
body[data-theme="dark"].soft-dash-body .att-log-active-hint code {
  background: rgba(0, 0, 0, 0.22);
  color: #c8d0e8;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  font-size: 0.9em;
}

body[data-theme="dark"].soft-dash-body .skip-link:focus {
  background: #262b3c;
  color: var(--soft-color-text);
  border-color: #8b8fff;
}

/* Login: theme toggle — neumorphic to match login page */
.login-body .soft-theme-btn {
  background: var(--neo-bg);
  color: var(--neo-text);
  border: none;
  border-radius: 22px;
  box-shadow: var(--neo-raised-sm);
  opacity: 1;
}

.login-body .soft-theme-btn:hover {
  opacity: 1;
}

.login-body .soft-theme-btn:focus-visible {
  opacity: 1;
  outline: 2px solid rgba(76, 85, 99, 0.45);
  outline-offset: 3px;
}

.login-body .soft-theme-btn:active {
  box-shadow: var(--neo-pressed);
}

/* Login: theme toggle + dark palette (uses global body vars from body[data-theme="dark"]) */
body[data-theme="dark"].login-body {
  color-scheme: dark;
}

body[data-theme="dark"].login-body .soft-theme-btn {
  background: var(--neo-bg);
  color: var(--neo-text);
  border: none;
  box-shadow: var(--neo-raised-sm);
}

body[data-theme="dark"].login-body .soft-theme-btn:focus-visible {
  outline: 2px solid rgba(180, 190, 255, 0.55);
  outline-offset: 3px;
}

/* Narrow phones: avoid cramped welcome row */
@media (max-width: 360px) {
  .soft-dash {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .soft-star-badge {
    width: 40px;
    height: 40px;
  }

  .soft-star-badge svg {
    width: 13px;
    height: 13px;
  }

  .soft-stat-grid {
    grid-template-columns: 1fr;
  }

  .soft-stat {
    min-height: 112px;
  }

  .soft-stat-carousel__viewport {
    width: min(100%, 200px);
  }

  .soft-stat-hero__aura {
    width: min(94vw, 240px);
    height: min(94vw, 240px);
  }
}

/* Short viewports (landscape phones) */
@media (max-height: 520px) and (orientation: landscape) {
  body.soft-dash-body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .soft-dash {
    gap: 12px;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
  }

  .soft-welcome {
    padding: 12px 14px;
  }

  .soft-welcome-main-row {
    gap: 6px 8px;
  }

  .soft-welcome-name-row {
    gap: 6px 8px;
  }

  .soft-dash-columns,
  .soft-dash-col {
    gap: 12px;
  }

  .soft-stat {
    min-height: 100px;
  }

  .soft-stat-hero {
    padding-top: 0.65rem;
    padding-bottom: 0.25rem;
  }

  .soft-stat-hero__aura {
    width: min(calc(100vw - 2.5rem), 260px);
    height: min(calc(100vw - 2.5rem), 260px);
  }

  .soft-stat-carousel__viewport {
    width: min(100%, clamp(176px, 42vw, 200px));
  }

  .soft-stat-carousel__hint {
    display: none;
  }

  .soft-lang-bar {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
}

/* Tablet: two columns — summary + tasks side by side */
@media (min-width: 768px) {
  body.soft-dash-body {
    --soft-text-display: 1.625rem;
    --soft-text-stat: 2rem;
  }

  .soft-dash {
    max-width: min(920px, calc(100% - 32px));
    padding-top: 28px;
  }

  .soft-dash-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px 24px;
    align-items: start;
  }

  .soft-dash-columns.soft-dash-columns--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .soft-stat-grid {
    gap: 14px;
  }
}

/* Desktop: match wider shell above (calendar + two-column summary) */
@media (min-width: 1024px) {
  .soft-dash {
    max-width: min(1120px, calc(100% - 48px));
  }

  .soft-table-wrap .repair-detail-frame {
    min-height: min(560px, 70vh);
  }
}

@media (min-width: 520px) and (max-width: 767px) {
  .soft-dash {
    max-width: min(480px, 100%);
    padding-top: 24px;
  }
}

/* Touch: keep feedback without relying on hover */
@media (hover: none) and (pointer: coarse) {
  .soft-action-row:hover {
    transform: none;
  }

  .soft-action-row:active {
    transform: scale(0.99);
    box-shadow: 0 2px 8px rgba(94, 92, 230, 0.1);
  }

  .soft-logout:hover {
    transform: none;
  }

  .soft-logout:active {
    background: #e8ebf0;
  }

  .soft-theme-btn:active {
    transform: scale(0.98);
    opacity: 0.92;
  }
}

@media (prefers-reduced-motion: reduce) {
  .soft-action-row,
  .soft-logout,
  .soft-theme-btn {
    transition: none;
  }

  .soft-action-row:hover,
  .soft-logout:hover {
    transform: none;
  }

  .soft-theme-btn:active {
    transform: none;
  }
}

/* test_name_log.php */
.att-log-page .att-log-banner,
.att-log-page .att-log-error,
.att-log-page .subtext {
  overflow-wrap: anywhere;
}

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

.skip-link:focus {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
  z-index: 2000;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  padding: 10px 16px;
  border-radius: 10px;
  border: 2px solid var(--accent-1, #7a5cff);
  background: var(--surface, #fff);
  color: var(--text, #2e3350);
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.skip-link--dash-second:focus {
  top: max(56px, calc(12px + env(safe-area-inset-top, 0px) + 44px));
  left: max(12px, env(safe-area-inset-left, 0px));
}

.att-log-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top, 0px) * 0.35) max(16px, env(safe-area-inset-right, 0px))
    calc(48px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

.att-log-filters {
  padding: 18px 16px 20px;
  box-sizing: border-box;
  min-width: 0;
}

.att-log-header.soft-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px 14px;
}

.att-log-header .soft-welcome-text {
  min-width: 0;
}

.att-log-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.att-log-title {
  margin: 0;
  font-size: var(--soft-text-display, 1.25rem);
  font-weight: 700;
  line-height: var(--soft-line-display, 1.2);
  letter-spacing: -0.02em;
  color: var(--soft-color-text, #1a1a1a);
}

.att-log-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border, #e1e6f4);
  background: var(--surface-2, #f7f9ff);
  color: var(--text, #2e3350);
  font-size: 14px;
  line-height: 1.5;
}

.att-log-banner code {
  font-size: 13px;
}

/* Dashboard .soft-logout is a fixed 44×44 icon; att-log / inject use text links — size to content */
.att-log-header .soft-logout {
  width: auto;
  height: auto;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
  font-weight: 600;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.att-log-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.att-log-sub code {
  font-size: 13px;
}

.att-log-h2 {
  margin: 0 0 12px;
  font-size: 1.125rem;
}

.att-log-cycle-hint {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.att-log-error {
  margin-bottom: 16px;
}

.att-log-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.att-log-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.att-log-select,
.att-log-date,
.att-log-staff-filter {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 44px;
}

.att-log-staff-filter-hint {
  margin: 0 0 8px;
}

.att-log-staff-filter-label {
  margin-top: 4px;
}

.att-log-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.att-log-date-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.att-log-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  max-width: 36rem;
}

.att-log-checkbox-row input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.att-log-checkbox-label {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted, #5c5c5c);
  cursor: pointer;
}

.att-log-checkbox-label code {
  font-size: 0.92em;
}

.att-log-checkbox-hint {
  margin: -6px 0 14px;
  max-width: 36rem;
}

.inject-manage-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.inject-manage-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #e8e8e8);
}

.inject-manage-remove-form {
  margin: 0;
}

/* --- inject.php / inject_manage: typography + layout --- */
.inject-wrap {
  max-width: 56rem;
}

.inject-lede {
  font-size: 1rem;
  line-height: 1.55;
  max-width: 65ch;
}

.inject-code {
  font-size: 0.9375em;
  font-weight: 500;
}

.inject-header:not(.inject-header--single-action) {
  align-items: start;
}

.inject-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.625rem;
  align-items: center;
  justify-content: flex-end;
}

.inject-header-actions .soft-logout {
  flex-shrink: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.inject-hint {
  margin-top: 0.5rem;
  margin-bottom: 0;
  max-width: 65ch;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted);
}

.inject-form-get {
  margin-bottom: 1.125rem;
}

.inject-label-spaced {
  margin-top: 0.75rem;
}

.inject-actions-tight {
  margin-top: 0.75rem;
}

.inject-flash--ok {
  color: var(--success);
  font-weight: 600;
  line-height: 1.5;
}

/* email_test.php — result after send (PRG flash) */
.email-test-feedback {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
  scroll-margin-top: 1rem;
  box-sizing: border-box;
}

.email-test-feedback--ok {
  border: 1px solid var(--success, #1a7f37);
  background: rgba(26, 127, 55, 0.1);
  color: var(--text, #1a1a1a);
}

.email-test-feedback--err {
  margin-bottom: 0;
}

body[data-theme="dark"].soft-dash-body .email-test-feedback--ok {
  background: rgba(46, 160, 67, 0.15);
  border-color: #3fb950;
  color: var(--text, #e6edf3);
}

/* Replace-existing: comfortable tap target; label remains primary hit area */
.inject-page .att-log-checkbox-row {
  min-height: 44px;
  align-items: center;
  padding: 10px 12px;
  margin-left: -12px;
  margin-right: -12px;
  width: calc(100% + 24px);
  max-width: calc(36rem + 24px);
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid var(--border, #e1e6f4);
  background: var(--surface-2, #f7f9ff);
}

.inject-page .att-log-checkbox-row input[type="checkbox"] {
  margin-top: 0;
  width: 20px;
  height: 20px;
}

body[data-theme="dark"].soft-dash-body .inject-page .att-log-checkbox-row {
  border-color: #3d4458;
  background: rgba(0, 0, 0, 0.2);
}

/* Calendar management + attendance detail */
.cal-mng-weekend-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 1rem;
}

.cal-mng-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
}

.cal-mng-textarea {
  width: 100%;
  max-width: 36rem;
  min-height: 100px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border, #e1e6f4);
  background: var(--surface, #fff);
  color: var(--text, #2e3350);
  font: inherit;
  line-height: 1.45;
  box-sizing: border-box;
}

.cal-mng-hint {
  margin-bottom: 0.5rem;
}

.cal-mng-late-head {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 160px);
  gap: 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted, #7f86a8);
  margin: 0.75rem 0 6px;
}

.cal-mng-late-row {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 160px);
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.att-nfc-month-banner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.1);
}

.att-nfc-month-banner__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text, #2e3350);
}

body[data-theme="dark"].soft-dash-body .att-nfc-month-banner__text {
  color: rgba(241, 245, 249, 0.92);
}

.att-nfc-month-banner__link {
  align-self: stretch;
  text-align: center;
}

.att-detail-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.att-detail-nav-link--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  user-select: none;
}

.att-detail-table .att-detail-row--off {
  opacity: 0.65;
}

.att-detail-table .att-detail-row--absent th,
.att-detail-table .att-detail-row--absent td:nth-child(2) {
  color: #c0392b;
  font-weight: 600;
}

.att-detail-table .att-detail-row--nodata th,
.att-detail-table .att-detail-row--nodata td:nth-child(2) {
  color: #6b7280;
  font-weight: 600;
}

.att-detail-table .att-detail-row--late td:nth-child(2) {
  color: #d35400;
  font-weight: 600;
}

.att-detail-table .att-detail-row--early td:nth-child(2) {
  color: #b45309;
  font-weight: 600;
}

.att-detail-table .att-detail-row--late_early td:nth-child(2) {
  color: #b91c1c;
  font-weight: 600;
}

body[data-theme="dark"].soft-dash-body .att-detail-table .att-detail-row--absent th,
body[data-theme="dark"].soft-dash-body .att-detail-table .att-detail-row--absent td:nth-child(2) {
  color: #f5a3a3;
}

body[data-theme="dark"].soft-dash-body .att-detail-table .att-detail-row--nodata th,
body[data-theme="dark"].soft-dash-body .att-detail-table .att-detail-row--nodata td:nth-child(2) {
  color: #9ca3af;
}

body[data-theme="dark"].soft-dash-body .att-detail-table .att-detail-row--late td:nth-child(2) {
  color: #f0b27a;
}

body[data-theme="dark"].soft-dash-body .att-detail-table .att-detail-row--early td:nth-child(2) {
  color: #fbbf24;
}

body[data-theme="dark"].soft-dash-body .att-detail-table .att-detail-row--late_early td:nth-child(2) {
  color: #fca5a5;
}

.cal-mng-grid-head {
  display: grid;
  gap: 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted, #7f86a8);
  margin: 0.75rem 0 6px;
}

.cal-mng-grid-head--hol {
  grid-template-columns: 1fr 1fr 1fr;
}

.cal-mng-grid-row--hol {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
  align-items: center;
}

.cal-mng-shift-head {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 120px 120px 100px;
  gap: 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted, #7f86a8);
  margin: 0.75rem 0 6px;
}

.cal-mng-shift-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 120px 120px 100px;
  gap: 10px;
  margin-bottom: 8px;
  align-items: center;
}

.cal-mng-buffer {
  max-width: 100%;
  min-width: 0;
}

.cal-mng-leave-head {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 1fr 1fr;
  gap: 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted, #7f86a8);
  margin: 0.75rem 0 6px;
}

.cal-mng-leave-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
  align-items: center;
}

.cal-mng-leave-num {
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 640px) {
  .cal-mng-leave-head,
  .cal-mng-leave-row {
    grid-template-columns: 1fr;
  }

  .cal-mng-shift-head,
  .cal-mng-shift-row {
    grid-template-columns: 1fr 1fr;
  }

  .cal-mng-shift-head span:nth-child(3),
  .cal-mng-shift-head span:nth-child(4) {
    grid-column: span 1;
  }
}

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

.inject-table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--border, #e1e6f4);
  background: var(--surface);
}

.inject-table {
  width: 100%;
  min-width: 20rem;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.45;
}

.inject-table thead th {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.75rem 0.625rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: bottom;
}

.inject-th-muted {
  display: block;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.75rem;
  margin-top: 0.2rem;
  opacity: 0.92;
}

.inject-table tbody th.inject-date-cell,
.inject-table tbody td {
  padding: 0.625rem 0.625rem;
  border-bottom: 1px solid var(--border, #e8e8e8);
  vertical-align: middle;
}

.inject-table tbody th.inject-date-cell {
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
}

.inject-table tbody tr:last-child th,
.inject-table tbody tr:last-child td {
  border-bottom: none;
}

.inject-time-input {
  min-height: 2.75rem;
  min-width: 7.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: inherit;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  width: 100%;
  max-width: 10rem;
  box-sizing: border-box;
}

.inject-time-input:focus-visible {
  outline: 2px solid var(--accent-1, #6366f1);
  outline-offset: 2px;
}

.inject-save-row {
  margin-top: 1.25rem;
}

.inject-email-input {
  max-width: 22rem;
}

.inject-manage-page .inject-manage-row code {
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .inject-header:not(.inject-header--single-action) {
    grid-template-columns: 1fr;
  }

  .inject-header-actions {
    justify-content: stretch;
  }

  .inject-header-actions .soft-logout {
    flex: 1 1 calc(50% - 0.3125rem);
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .inject-table tbody th.inject-date-cell {
    position: sticky;
    left: 0;
    z-index: 1;
    box-shadow: 4px 0 10px -6px rgba(0, 0, 0, 0.12);
  }

  body[data-theme="dark"].soft-dash-body .inject-table tbody th.inject-date-cell {
    box-shadow: 4px 0 12px -6px rgba(0, 0, 0, 0.45);
  }
}

@media (max-width: 520px) {
  .att-log-dates {
    grid-template-columns: 1fr;
  }
}

.att-log-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.att-log-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}

.att-log-btn:focus-visible {
  outline: 2px solid var(--accent-1, #7a5cff);
  outline-offset: 2px;
}

.att-log-btn--ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.att-log-header .soft-logout:focus-visible {
  outline: 2px solid var(--accent-1, #7a5cff);
  outline-offset: 2px;
}

.att-log-table-card {
  overflow: hidden;
  min-width: 0;
}

.att-log-table-card .repair-table-wrap {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.att-log-punch-rule {
  margin: 0 0 12px;
}

.att-log-active-hint {
  margin: 0 0 12px;
}

.att-log-table th,
.att-log-table td {
  white-space: nowrap;
}

.att-log-caption {
  caption-side: top;
  text-align: left;
  padding: 0 0 12px;
  font-size: var(--soft-text-secondary, 0.875rem);
  font-weight: 500;
  color: var(--soft-color-text-muted, #7d7d7d);
  line-height: 1.4;
}

@media (max-width: 640px) {
  .att-log-table th,
  .att-log-table td {
    white-space: normal;
  }
}

/* Narrow phones: header stacks, dashboard link is a full-width touch target */
@media (max-width: 420px) {
  .att-log-header.soft-welcome {
    grid-template-columns: 1fr;
  }

  .att-log-header .soft-logout {
    justify-self: stretch;
    justify-content: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
  }
}

/* iOS Safari: inputs below 16px trigger zoom — keep readable body size on small screens */
@media (max-width: 480px) {
  .att-log-select,
  .att-log-date,
  .att-log-staff-filter {
    font-size: max(16px, 1rem);
  }

  .att-log-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .att-log-btn,
  a.att-log-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Slightly tighter rhythm on very small widths */
@media (max-width: 360px) {
  .att-log-wrap {
    gap: 16px;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .att-log-h2 {
    font-size: clamp(1rem, 4.2vw, 1.125rem);
  }

  /* Override dashboard .soft-welcome 360px grid (meta row) — this page has no meta strip */
  .att-log-header.soft-welcome {
    grid-template-columns: 1fr;
    grid-template-areas: unset;
  }

  .att-log-header .soft-welcome-text,
  .att-log-header .soft-logout {
    grid-area: unset;
  }
}

/* Landscape phones: reduce vertical padding so the table stays reachable */
@media (max-height: 520px) and (orientation: landscape) {
  .att-log-wrap {
    gap: 14px;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .att-log-main {
    gap: 14px;
  }
}

/* Card table area: allow slightly narrower min width so less horizontal pan on small phones */
@media (max-width: 480px) {
  .att-log-table-card .repair-table {
    min-width: min(100%, 520px);
  }
}

@media (hover: none) and (pointer: coarse) {
  .att-log-btn:active {
    transform: scale(0.99);
    opacity: 0.96;
  }

  .att-log-btn--ghost:active {
    opacity: 1;
    background: #e8ebf0;
  }

  .att-log-header .soft-logout:active {
    background: #e8ebf0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .att-log-btn:active,
  .att-log-btn--ghost:active {
    transform: none;
  }
}

/* --- test_calendar.php (2026 IQRA academic calendar) --- */
body.soft-dash-body.tc-page {
  /* Match dashboard font stack (was system-ui only — broke Niramit/Plus Jakarta Sans on dashboard) */
  --tc-font-sans: var(--soft-font);
  --tc-text-caption: 0.875rem;
  --tc-text-label: 0.9375rem;
  --tc-text-ui: 1rem;
  --tc-text-body: 1rem;
  --tc-text-subhead: 1.125rem;
  --tc-text-heading: 1.3125rem;
  --tc-text-dialog: 1.375rem;
  --tc-text-display: 1.5rem;
  --tc-leading-tight: 1.15;
  --tc-leading-snug: 1.32;
  --tc-leading-ui: 1.45;
  --tc-leading-body: 1.58;
  --tc-leading-relaxed: 1.68;
  --tc-track-tight: -0.02em;
  --tc-track-overline: 0.06em;
  --tc-weight-medium: 500;
  --tc-weight-semibold: 600;
  --tc-weight-bold: 700;
  font-family: var(--soft-font);
  font-size: 100%;
  line-height: var(--tc-leading-body);
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  --tc-holiday-bg: #fee2e2;
  --tc-holiday-fg: #991b1b;
  --tc-holiday-bd: #fecaca;
  --tc-break-bg: #e2e8f0;
  --tc-break-fg: #1e293b;
  --tc-break-bd: #cbd5e1;
  --tc-meeting-bg: #dbeafe;
  --tc-meeting-fg: #1d4ed8;
  --tc-meeting-bd: #93c5fd;
  --tc-training-bg: #ede9fe;
  --tc-training-fg: #5b21b6;
  --tc-training-bd: #c4b5fd;
  --tc-program-bg: #ccfbf1;
  --tc-program-fg: #0f766e;
  --tc-program-bd: #2dd4bf;
  --tc-exam-bg: #ffedd5;
  --tc-exam-fg: #9a3412;
  --tc-exam-bd: #fb923c;
  --tc-milestone-bg: #f3e8ff;
  --tc-milestone-fg: #6b21a8;
  --tc-milestone-bd: #d8b4fe;
  --tc-registration-bg: #cffafe;
  --tc-registration-fg: #0e7490;
  --tc-registration-bd: #22d3ee;
  --tc-camp-bg: #ffedd5;
  --tc-camp-fg: #c2410c;
  --tc-camp-bd: #fdba74;
  --tc-admin-bg: #e2e8f0;
  --tc-admin-fg: #334155;
  --tc-admin-bd: #cbd5e1;
  --tc-safety-bg: #fce7f3;
  --tc-safety-fg: #831843;
  --tc-safety-bd: #f9a8d4;
  --tc-religious-bg: #dcfce7;
  --tc-religious-fg: #14532d;
  --tc-religious-bd: #4ade80;
}

body[data-theme="dark"].soft-dash-body.tc-page {
  --tc-leading-body: 1.62;
  --tc-holiday-bg: #3f1d1d;
  --tc-holiday-fg: #fecaca;
  --tc-holiday-bd: #7f1d1d;
  --tc-break-bg: #1e293b;
  --tc-break-fg: #cbd5e1;
  --tc-break-bd: #334155;
  --tc-meeting-bg: #1e3a5f;
  --tc-meeting-fg: #bfdbfe;
  --tc-meeting-bd: #2563eb;
  --tc-training-bg: #311b4d;
  --tc-training-fg: #ddd6fe;
  --tc-training-bd: #6d28d9;
  --tc-program-bg: #134e4a;
  --tc-program-fg: #99f6e4;
  --tc-program-bd: #0d9488;
  --tc-exam-bg: #422006;
  --tc-exam-fg: #fed7aa;
  --tc-exam-bd: #c2410c;
  --tc-milestone-bg: #3b0764;
  --tc-milestone-fg: #e9d5ff;
  --tc-milestone-bd: #7c3aed;
  --tc-registration-bg: #164e63;
  --tc-registration-fg: #a5f3fc;
  --tc-registration-bd: #0891b2;
  --tc-camp-bg: #431407;
  --tc-camp-fg: #fdba74;
  --tc-camp-bd: #ea580c;
  --tc-admin-bg: #292f3d;
  --tc-admin-fg: #cbd5e1;
  --tc-admin-bd: #475569;
  --tc-safety-bg: #4a044e;
  --tc-safety-fg: #fbcfe8;
  --tc-safety-bd: #a21caf;
  --tc-religious-bg: #14532d;
  --tc-religious-fg: #bbf7d0;
  --tc-religious-bd: #16a34a;
}

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

.tc-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) calc(100px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Dashboard: hero calendar uses parent .soft-dash horizontal padding — avoid double inset */
.tc-wrap.tc-wrap--dash-calendar {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  /* Override .tc-wrap bottom padding (reserved for full-page calendar mobile nav) — dashboard has its own layout */
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  max-width: none;
  width: 100%;
}

/* Large phones: let calendar-first use full width (narrow 480px cap below still applies to generic .soft-dash) */
@media (min-width: 520px) {
  body.soft-dash-body.tc-page .soft-dash.soft-dash--calendar-first {
    max-width: min(1200px, calc(100% - 24px));
  }
}

.tc-header .tc-pdf-link,
.tc-legend .tc-pdf-link {
  color: var(--accent-2);
  font-weight: var(--tc-weight-semibold, 600);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tc-header.tc-header--nav-only {
  grid-template-columns: 1fr;
  justify-items: end;
  align-items: center;
}

.tc-header.tc-header--nav-only .soft-logout.tc-header-back {
  justify-self: end;
}

.tc-legend-pdf {
  margin: 14px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: var(--tc-text-ui, 0.875rem);
  line-height: var(--tc-leading-ui, 1.35);
  font-weight: var(--tc-weight-medium, 500);
  color: var(--muted, #6b7280);
}

body[data-theme="dark"] .tc-legend-pdf {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.tc-page .tc-header .att-log-title {
  font-size: var(--tc-text-display);
  line-height: var(--tc-leading-tight);
  font-weight: var(--tc-weight-bold);
  letter-spacing: var(--tc-track-tight);
  color: var(--text);
}

@media (max-width: 400px) {
  .tc-page .tc-header .att-log-title {
    font-size: clamp(1.25rem, 5.5vw, var(--tc-text-display));
  }
}

.tc-page .tc-header .att-log-sub {
  margin: 0.375rem 0 0;
  max-width: 65ch;
  font-size: var(--tc-text-body);
  font-weight: var(--tc-weight-medium);
  line-height: var(--tc-leading-body);
  color: var(--muted);
}

/* Calendar header: not the 44×44 icon-only logout control — full “back” affordance */
.tc-page .tc-header.soft-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px 16px;
}

/* Dashboard embed: no back link — single column title block */
.tc-page .tc-header.soft-welcome:not(:has(.tc-header-back)) {
  grid-template-columns: minmax(0, 1fr);
}

.tc-page .tc-header .soft-logout.tc-header-back {
  width: auto;
  height: auto;
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 10px 16px;
  box-sizing: border-box;
  font-size: var(--tc-text-ui);
  font-weight: var(--tc-weight-semibold);
  line-height: var(--tc-leading-ui);
  white-space: nowrap;
}

.tc-header-back__icon {
  flex-shrink: 0;
  font-weight: var(--tc-weight-bold);
  opacity: 0.88;
}

.tc-header-back__label {
  flex-shrink: 0;
}

@media (max-width: 420px) {
  .tc-page .tc-header .soft-logout.tc-header-back {
    justify-self: start;
    max-width: 100%;
  }
}

.tc-scroll-hint {
  display: none;
  margin: 0 0 12px;
  padding: 0;
  max-width: 65ch;
  font-size: var(--tc-text-label);
  line-height: var(--tc-leading-ui);
  font-weight: var(--tc-weight-medium);
  color: var(--muted);
  text-wrap: balance;
}

.tc-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 12px;
}

.tc-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  min-width: 0;
  flex: 0 1 auto;
}

.tc-month-label {
  margin: 0;
  font-size: var(--tc-text-heading);
  font-weight: var(--tc-weight-bold);
  line-height: var(--tc-leading-snug);
  min-width: 0;
  text-align: center;
}

.tc-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: var(--tc-weight-semibold);
  text-decoration: none;
  font-size: var(--tc-text-ui);
  line-height: var(--tc-leading-ui);
  box-sizing: border-box;
}

.tc-nav-btn:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}

button.tc-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font: inherit;
}

.tc-jump {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.tc-view-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.62);
  max-width: 100%;
  justify-content: flex-end;
}

.tc-view-btn {
  border: 0;
  background: transparent;
  color: var(--soft-color-text-muted, #6b7390);
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  min-height: 30px;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
}

.tc-view-btn.is-active {
  background: rgba(94, 92, 230, 0.12);
  color: #51508e;
}

.tc-view-btn:focus-visible {
  outline: 2px solid #5e5ce6;
  outline-offset: 2px;
}

.tc-jump-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(3.75rem, 4.5rem) auto;
  gap: 6px 8px;
  align-items: end;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.tc-jump-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tc-jump-field label {
  font-size: var(--tc-text-caption);
  font-weight: var(--tc-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin: 0;
  line-height: 1.35;
}

.tc-jump select {
  width: 100%;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: var(--tc-weight-medium);
  font-size: var(--tc-text-caption);
  line-height: var(--tc-leading-ui);
  font-family: var(--tc-font-sans);
  box-sizing: border-box;
}

.tc-jump-btn {
  display: none;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: var(--accent-1);
  color: #fff;
  font-weight: var(--tc-weight-bold);
  font-size: var(--tc-text-caption);
  line-height: var(--tc-leading-ui);
  font-family: var(--tc-font-sans);
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
  flex-shrink: 0;
}

.tc-jump-btn:hover {
  filter: brightness(0.92);
}

.tc-jump-btn:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
}

.tc-calendar-card {
  padding: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.tc-cal {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: min(100%, 900px);
}

.tc-cal.tc-cal--weekly .tc-cal-head,
.tc-cal.tc-cal--weekly .tc-cal-row--days {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.tc-cal.tc-cal--weekly .tc-cal-head > :nth-child(7),
.tc-cal.tc-cal--weekly .tc-cal-row--days > :nth-child(7) {
  display: none;
}

.tc-cal.tc-cal--weekly .tc-cal-span-strip {
  display: none;
}

.tc-cal.tc-cal--daily {
  display: none;
}

.tc-daily-panel {
  margin-top: 0;
}

.tc-daily-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.tc-daily-nav-btn {
  min-width: 2.25rem;
  min-height: 2.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.tc-daily-nav-btn:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}

.tc-daily-date {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--tc-font-sans);
  text-align: center;
  min-width: 12rem;
}

.tc-daily-tier-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 0 0.6rem;
  flex-wrap: wrap;
}

.tc-daily-tier-lbl {
  font-size: 0.78rem;
  opacity: 0.7;
}

.tc-daily-tier-btn {
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tc-daily-tier-btn:hover {
  border-color: var(--accent-1);
}

.tc-daily-tier-btn.is-active {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 1px 4px rgba(0, 0, 0, 0.18);
}

.tc-daily-slots-wrap {
  padding: 0;
  margin: 0;
  font-family: var(--tc-font-sans);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tc-daily-session {
  border-radius: 12px;
  padding: 0.5rem 0.65rem 0.65rem;
  border: 1px solid var(--border);
}

/* Before lunch: light green; after lunch: light orange */
.tc-daily-session--morning {
  background: linear-gradient(145deg, rgba(187, 247, 208, 0.42) 0%, rgba(220, 252, 231, 0.55) 100%);
  border-color: rgba(34, 197, 94, 0.22);
}

.tc-daily-session--afternoon {
  background: linear-gradient(145deg, rgba(254, 215, 170, 0.42) 0%, rgba(255, 237, 213, 0.52) 100%);
  border-color: rgba(249, 115, 22, 0.2);
}

.tc-daily-session-h {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.tc-daily-session-slots {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tc-daily-session-slots .tc-daily-slot + .tc-daily-slot {
  border-top: 1px solid rgba(26, 29, 38, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  margin-top: 0.15rem;
  padding-top: 0.55rem;
}

.tc-daily-slot {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.4rem 0.35rem;
  margin: 0 -0.35rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tc-daily-slot:hover,
.tc-daily-slot:focus-visible {
  border-color: rgba(94, 92, 230, 0.28);
  outline: none;
}

.tc-daily-session--morning .tc-daily-slot:hover,
.tc-daily-session--morning .tc-daily-slot:focus-visible {
  background: rgba(255, 255, 255, 0.35);
}

.tc-daily-session--afternoon .tc-daily-slot:hover,
.tc-daily-session--afternoon .tc-daily-slot:focus-visible {
  background: rgba(255, 255, 255, 0.38);
}

.tc-daily-slot-time-col {
  flex: 0 0 auto;
  width: auto;
  min-width: 6.85rem;
  max-width: none;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.25;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  align-self: flex-start;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
  white-space: nowrap;
}

.tc-daily-slot--am .tc-daily-slot-time-col {
  background: rgba(187, 247, 208, 0.55);
  color: #14532d;
}

.tc-daily-slot--pm .tc-daily-slot-time-col {
  background: rgba(254, 215, 170, 0.6);
  color: #7c2d12;
}

.tc-daily-slot-body {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tc-daily-slot--break .tc-daily-slot-label {
  font-style: italic;
}

.tc-daily-slot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.tc-daily-slot-label {
  color: var(--muted);
  flex: 1 1 auto;
  min-width: 0;
}

.tc-daily-slot-note-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(94, 92, 230, 0.15);
  color: #51508e;
  flex-shrink: 0;
}

.tc-daily-slot-right {
  width: 100%;
  text-align: center;
}

@media (min-width: 640px) {
  .tc-daily-slot-right {
    width: auto;
    align-self: stretch;
    margin-left: 0;
    flex: 1 1 auto;
    min-width: 8rem;
  }

  .tc-daily-slot-body {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .tc-daily-slot-row {
    flex: 1 1 100%;
  }

  .tc-daily-slot-right {
    width: 100%;
    order: 2;
  }
}

.tc-daily-tt-table {
  width: 100%;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  color: #1a1d26;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.tc-daily-tt-table td {
  padding: 0.35rem 0.5rem;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: #ffffff;
}

.tc-daily-tt-table tr:last-child td {
  border-bottom: none;
}

.tc-daily-tt-table .tc-chip {
  display: inline-block;
  max-width: 100%;
  text-align: center;
}

.tc-daily-slot-free {
  opacity: 0.45;
}

.tc-daily-slot--empty {
  border: 0;
  color: var(--muted);
  font-style: italic;
  cursor: default;
}

.tc-slot-dialog .tc-slot-dialog-surface {
  max-width: min(100vw - 2rem, 34rem);
}

.tc-slot-dialog-sub {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.tc-slot-hub {
  margin-bottom: 0.75rem;
}

.tc-slot-hub-empty {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.tc-slot-notes-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: min(40vh, 14rem);
  overflow-y: auto;
}

.tc-slot-notes-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.65);
}

.tc-slot-notes-item-preview {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text);
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.tc-slot-notes-item-preview--thumb {
  display: flex;
  align-items: center;
  max-width: min(100%, 12rem);
}

.tc-slot-notes-thumb-img {
  display: block;
  max-width: 100%;
  max-height: 4.5rem;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.tc-slot-notes-item-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.35rem;
  align-items: center;
}

.tc-slot-notes-item-edit,
.tc-slot-notes-item-del {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-weight: 600;
}

.tc-slot-notes-item-del {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.25);
}

.tc-slot-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tc-slot-edit-panel {
  margin-bottom: 0.25rem;
}

.tc-slot-edit-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.tc-slot-edit-footer .tc-dialog-btn--primary {
  margin-left: auto;
}

.tc-slot-mode-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.55rem;
}

.tc-slot-mode-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tc-slot-mode-btn.is-active {
  background: rgba(94, 92, 230, 0.14);
  border-color: rgba(94, 92, 230, 0.35);
  color: #51508e;
}

.tc-slot-panel--board {
  margin-bottom: 0.5rem;
}

.tc-whiteboard-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.45rem;
}

.tc-whiteboard-tools-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 0.15rem;
}

.tc-wb-color {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  padding: 0;
}

.tc-wb-color[data-color="#1a1d26"] {
  background: #1a1d26;
}
.tc-wb-color[data-color="#2563eb"] {
  background: #2563eb;
}
.tc-wb-color[data-color="#dc2626"] {
  background: #dc2626;
}

.tc-wb-color.is-active {
  box-shadow: 0 0 0 2px rgba(94, 92, 230, 0.55);
}

#tc-whiteboard-clear {
  margin-left: auto;
  min-height: 2rem;
  padding: 0.2rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.75rem;
  cursor: pointer;
}

.tc-whiteboard-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.tc-whiteboard-hint {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.tc-inline-wb .tc-whiteboard-img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: 0.35rem 0 0;
}

.tc-slot-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.5rem;
  align-items: center;
}

.tc-slot-tool-btn {
  min-width: 2rem;
  min-height: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
}

.tc-slot-tool-btn:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}

.tc-slot-file-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.tc-slot-editor {
  min-height: 10rem;
  max-height: min(50vh, 22rem);
  overflow: auto;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 0.65rem;
}

.tc-slot-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}

.tc-slot-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.tc-slot-remind-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.tc-slot-hint {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.tc-daily-official {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.tc-daily-official-h {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.tc-daily-official-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

body[data-theme="dark"] .tc-daily-session--morning {
  background: linear-gradient(145deg, rgba(20, 83, 45, 0.35) 0%, rgba(22, 101, 52, 0.22) 100%);
  border-color: rgba(74, 222, 128, 0.2);
}

body[data-theme="dark"] .tc-daily-session--afternoon {
  background: linear-gradient(145deg, rgba(124, 45, 18, 0.32) 0%, rgba(154, 52, 18, 0.2) 100%);
  border-color: rgba(251, 146, 60, 0.22);
}

body[data-theme="dark"] .tc-daily-slot--am .tc-daily-slot-time-col {
  background: rgba(22, 101, 52, 0.45);
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.15);
}

body[data-theme="dark"] .tc-daily-slot--pm .tc-daily-slot-time-col {
  background: rgba(154, 52, 18, 0.42);
  color: #fed7aa;
  border-color: rgba(251, 146, 60, 0.18);
}

.tc-cal.tc-cal--weekly .tc-cal-week {
  display: none;
}

.tc-cal.tc-cal--weekly .tc-cal-week.is-active-week {
  display: block;
}

.tc-cal-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1px;
}

.tc-cal-week {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1px;
  background: var(--border);
}

.tc-cal-row--days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
}

.tc-cal-span-strip {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 0 8px;
}

.tc-cal-span-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  row-gap: 5px;
}

.tc-span-bar {
  display: flex;
  align-items: center;
  min-height: 24px;
  padding: 0 6px;
  font-size: var(--tc-text-label);
  font-weight: var(--tc-weight-semibold);
  line-height: var(--tc-leading-snug);
  font-family: var(--tc-font-sans);
  border: 1px solid transparent;
  box-sizing: border-box;
}

.tc-span-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.tc-span-bar:not(.tc-span-bar--continue-left) {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.tc-span-bar:not(.tc-span-bar--continue-right) {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.tc-chip--holiday,
.tc-span-bar--holiday {
  background: var(--tc-holiday-bg);
  color: var(--tc-holiday-fg);
  border-color: var(--tc-holiday-bd);
}

.tc-chip--break,
.tc-span-bar--break {
  background: var(--tc-break-bg);
  color: var(--tc-break-fg);
  border-color: var(--tc-break-bd);
}

.tc-chip--meeting,
.tc-span-bar--meeting {
  background: var(--tc-meeting-bg);
  color: var(--tc-meeting-fg);
  border-color: var(--tc-meeting-bd);
}

.tc-chip--training,
.tc-span-bar--training {
  background: var(--tc-training-bg);
  color: var(--tc-training-fg);
  border-color: var(--tc-training-bd);
}

.tc-chip--tt,
.tc-span-bar--tt {
  background: rgba(130, 110, 220, 0.38);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(170, 150, 255, 0.5);
}

.tc-chip--eval,
.tc-span-bar--eval {
  background: #0d9488;
  color: #fff;
  border-color: #0f766e;
}

.tc-chip--program,
.tc-span-bar--program {
  background: var(--tc-program-bg);
  color: var(--tc-program-fg);
  border-color: var(--tc-program-bd);
}

.tc-chip--exam,
.tc-span-bar--exam {
  background: var(--tc-exam-bg);
  color: var(--tc-exam-fg);
  border-color: var(--tc-exam-bd);
}

.tc-chip--milestone,
.tc-span-bar--milestone {
  background: var(--tc-milestone-bg);
  color: var(--tc-milestone-fg);
  border-color: var(--tc-milestone-bd);
}

.tc-chip--registration,
.tc-span-bar--registration {
  background: var(--tc-registration-bg);
  color: var(--tc-registration-fg);
  border-color: var(--tc-registration-bd);
}

.tc-chip--camp,
.tc-span-bar--camp {
  background: var(--tc-camp-bg);
  color: var(--tc-camp-fg);
  border-color: var(--tc-camp-bd);
}

.tc-chip--admin,
.tc-span-bar--admin {
  background: var(--tc-admin-bg);
  color: var(--tc-admin-fg);
  border-color: var(--tc-admin-bd);
}

.tc-chip--safety,
.tc-span-bar--safety {
  background: var(--tc-safety-bg);
  color: var(--tc-safety-fg);
  border-color: var(--tc-safety-bd);
}

.tc-chip--religious,
.tc-span-bar--religious {
  background: var(--tc-religious-bg);
  color: var(--tc-religious-fg);
  border-color: var(--tc-religious-bd);
}

.tc-cal-dow {
  background: var(--surface-2);
  padding: 10px 8px;
  text-align: center;
  font-size: var(--tc-text-caption);
  font-weight: var(--tc-weight-bold);
  letter-spacing: var(--tc-track-overline);
  line-height: var(--tc-leading-snug);
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--tc-font-sans);
}

.tc-cal-dow-short {
  display: none;
}

@media (max-width: 400px) {
  .tc-cal-dow-long {
    display: none;
  }

  .tc-cal-dow-short {
    display: inline;
  }

  .tc-cal-dow {
    padding: 10px 2px;
    font-size: var(--tc-text-caption);
    letter-spacing: 0.04em;
  }
}

.tc-day {
  background: var(--surface);
  min-height: 120px;
  padding: 6px 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tc-day--clickable {
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  .tc-day--clickable {
    transition: none;
  }
}

.tc-day--clickable:hover {
  background: var(--surface-2);
}

.tc-day--clickable:focus {
  outline: 2px solid var(--accent-1);
  outline-offset: -2px;
  z-index: 1;
}

.tc-day--clickable:focus:not(:focus-visible) {
  outline: none;
}

.tc-day--clickable:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: -2px;
  z-index: 1;
}

.tc-day--has-note .tc-day-num::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--accent-2);
  vertical-align: middle;
}

.tc-day--has-remind .tc-day-num {
  box-decoration-break: clone;
}

.tc-day--has-remind .tc-day-num::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 2px;
  background: #f59e0b;
  vertical-align: middle;
}

.tc-day-user-notes {
  margin-top: 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  max-width: 100%;
  pointer-events: none;
}

.tc-day-user-notes[hidden] {
  display: none !important;
}

.tc-day-user-preview-line {
  font-size: 9px;
  line-height: 1.25;
  font-weight: var(--tc-weight-medium);
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  font-family: var(--tc-font-sans);
}

.tc-day-user-more {
  font-size: 8px;
  font-weight: var(--tc-weight-bold);
  color: var(--accent-1);
  font-family: var(--tc-font-sans);
  letter-spacing: 0.02em;
}

.tc-day--muted {
  background: var(--surface-2);
  opacity: 0.72;
}

.tc-day--today {
  box-shadow: inset 0 0 0 2px var(--accent-1);
}

.tc-day-num {
  font-weight: var(--tc-weight-bold);
  font-size: var(--tc-text-subhead);
  line-height: var(--tc-leading-tight);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text);
  font-family: var(--tc-font-sans);
}

.tc-day--muted .tc-day-num {
  color: var(--muted);
}

.tc-day-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tc-chip {
  display: block;
  font-size: var(--tc-text-label);
  line-height: var(--tc-leading-snug);
  font-weight: var(--tc-weight-semibold);
  font-family: var(--tc-font-sans);
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.tc-chip--static {
  display: inline-block;
  -webkit-line-clamp: unset;
  max-width: 100%;
  font-size: var(--tc-text-ui);
  line-height: var(--tc-leading-ui);
  font-weight: var(--tc-weight-semibold);
  padding: 6px 10px;
}

/* Inset content from soft-card’s large radius so chips don’t hug / clip the curve */
.soft-card.tc-legend {
  box-sizing: border-box;
  padding: 18px 22px 22px;
  border-radius: 22px;
}

.tc-legend-details {
  margin: 0;
}

.tc-legend-summary.tc-legend-title {
  margin: 0;
  font-size: var(--tc-text-subhead);
  font-weight: var(--tc-weight-bold);
  line-height: var(--tc-leading-snug);
  letter-spacing: var(--tc-track-tight);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 1.35rem;
}

.tc-legend-summary.tc-legend-title::-webkit-details-marker {
  display: none;
}

.tc-legend-summary.tc-legend-title::after {
  content: "";
  position: absolute;
  right: 0.1rem;
  top: 50%;
  width: 0.45em;
  height: 0.45em;
  margin-top: -0.2em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.45;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.tc-legend-details[open] > .tc-legend-summary.tc-legend-title::after {
  transform: rotate(-135deg);
  margin-top: 0.1em;
}

.tc-legend-details[open] > .tc-legend-list {
  margin-top: 12px;
}

.tc-legend-title {
  margin: 0 0 12px;
  font-size: var(--tc-text-subhead);
  font-weight: var(--tc-weight-bold);
  line-height: var(--tc-leading-snug);
  letter-spacing: var(--tc-track-tight);
}

.tc-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

@media (max-width: 560px) {
  .tc-legend-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    align-items: start;
  }

  .tc-legend-list .tc-chip--static {
    width: 100%;
    box-sizing: border-box;
  }
}

.tc-reminder-banner {
  border-radius: 12px;
  border: 1px solid #fcd34d;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  padding: 14px 16px;
}

.tc-reminder-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
}

.tc-reminder-banner-title {
  display: block;
  width: 100%;
  font-size: var(--tc-text-body);
  font-weight: var(--tc-weight-bold);
  line-height: var(--tc-leading-snug);
  color: #92400e;
}

.tc-reminder-banner-text {
  margin: 0;
  flex: 1 1 200px;
  font-size: var(--tc-text-body);
  line-height: var(--tc-leading-body);
  font-weight: var(--tc-weight-medium);
  color: #78350f;
  max-width: 65ch;
}

.tc-reminder-banner-dismiss {
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid #d97706;
  background: #fff;
  color: #92400e;
  font-weight: var(--tc-weight-semibold);
  font-size: var(--tc-text-body);
  line-height: var(--tc-leading-ui);
  font-family: var(--tc-font-sans);
  cursor: pointer;
  box-sizing: border-box;
}

.tc-reminder-banner-dismiss:hover {
  background: #fff7ed;
}

.tc-dialog {
  padding: 0;
  border: none;
  border-radius: 16px;
  width: min(420px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  max-width: 100%;
  max-height: min(92dvh, calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  background: transparent;
  box-shadow: none;
  margin: auto;
}

.tc-dialog::backdrop {
  background: rgba(15, 18, 35, 0.45);
  backdrop-filter: blur(2px);
}

@media (prefers-reduced-motion: reduce) {
  .tc-dialog::backdrop {
    backdrop-filter: none;
  }
}

.tc-dialog-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
  position: relative;
  box-shadow: 0 24px 48px rgba(30, 35, 60, 0.18);
  max-height: min(88dvh, 100vh - 2rem);
  overflow-y: auto;
  box-sizing: border-box;
}

.tc-dialog-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tc-dialog-close:hover {
  background: var(--border);
  color: var(--text);
}

.tc-dialog-title {
  margin: 0 40px 16px 0;
  font-size: var(--tc-text-dialog);
  font-weight: var(--tc-weight-bold);
  line-height: var(--tc-leading-snug);
  letter-spacing: var(--tc-track-tight);
  font-family: var(--tc-font-sans);
  color: var(--text);
}

.tc-dialog-title:focus {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
  border-radius: 4px;
}

.tc-dialog-block {
  margin-bottom: 16px;
}

.tc-dialog-h {
  margin: 0 0 8px;
  font-size: var(--tc-text-caption);
  font-weight: var(--tc-weight-bold);
  letter-spacing: var(--tc-track-overline);
  line-height: var(--tc-leading-snug);
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--tc-font-sans);
}

.tc-dialog-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tc-dialog-events .tc-chip {
  -webkit-line-clamp: unset;
  display: block;
  font-size: var(--tc-text-ui);
  line-height: var(--tc-leading-ui);
  font-weight: var(--tc-weight-semibold);
}

.tc-dialog-muted {
  margin: 0;
  font-size: var(--tc-text-body);
  line-height: var(--tc-leading-body);
  font-weight: var(--tc-weight-medium);
  color: var(--muted);
}

.tc-dialog-note {
  width: 100%;
  min-height: 88px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--tc-font-sans);
  font-size: var(--tc-text-body);
  line-height: var(--tc-leading-relaxed);
  resize: vertical;
}

.tc-dialog-note:focus {
  outline: 2px solid var(--accent-1);
  outline-offset: 1px;
  border-color: transparent;
}

.tc-dialog-remind-block .tc-dialog-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: var(--tc-weight-semibold);
  font-size: var(--tc-text-body);
  line-height: var(--tc-leading-body);
  cursor: pointer;
  margin: 0;
  font-family: var(--tc-font-sans);
}

.tc-dialog-check input {
  margin-top: 3px;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--accent-1);
}

.tc-dialog-hint {
  margin: 10px 0 0;
  padding-left: 0;
  font-size: var(--tc-text-label);
  line-height: var(--tc-leading-body);
  font-weight: var(--tc-weight-medium);
  color: var(--muted);
  max-width: 58ch;
}

.tc-dialog-notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.tc-dialog-note-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.tc-dialog-note-row .tc-dialog-note {
  width: 100%;
  box-sizing: border-box;
  min-height: 72px;
}

.tc-dialog-note-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tc-dialog-check--inline {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: var(--tc-weight-semibold);
  font-size: var(--tc-text-label);
  line-height: var(--tc-leading-body);
  cursor: pointer;
  margin: 0;
  font-family: var(--tc-font-sans);
}

.tc-dialog-note-remove {
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  font-family: var(--tc-font-sans);
}

.tc-dialog-note-remove:hover {
  color: var(--text);
  border-color: var(--accent-1);
}

.tc-dialog-note-remove:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
}

.tc-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.tc-dialog-btn {
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: var(--tc-weight-bold);
  font-size: var(--tc-text-body);
  line-height: var(--tc-leading-ui);
  font-family: var(--tc-font-sans);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  box-sizing: border-box;
}

.tc-dialog-btn--primary {
  border: none;
  background: var(--accent-1);
  color: #fff;
}

.tc-dialog-btn--primary:hover {
  filter: brightness(0.92);
}

.tc-dialog-btn--primary:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
}

.tc-dialog-btn--ghost {
  display: flex;
  align-items: center;
  margin-top: 8px;
  width: 100%;
  justify-content: center;
  background: transparent;
  border-style: dashed;
  color: var(--accent-1);
  font-weight: var(--tc-weight-semibold);
}

.tc-dialog-btn--ghost:hover {
  background: var(--surface-2);
  border-style: solid;
}

body[data-theme="dark"].soft-dash-body .tc-cal-dow {
  background: #252836;
  color: #9aa3c2;
}

body[data-theme="dark"].soft-dash-body .tc-day {
  background: #1e2130;
}

body[data-theme="dark"].soft-dash-body .tc-day--muted {
  background: #181b26;
  opacity: 0.85;
}

body[data-theme="dark"].soft-dash-body .tc-nav-btn {
  background: #252836;
  border-color: #3d4459;
  color: #e8eaf7;
}

body[data-theme="dark"].soft-dash-body .tc-jump select {
  background: #1e2130;
  border-color: #3d4459;
  color: #e8eaf7;
}

body[data-theme="dark"].soft-dash-body .tc-view-toggle {
  background: rgba(38, 43, 60, 0.62);
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"].soft-dash-body .tc-view-btn {
  color: #98a0b9;
}

body[data-theme="dark"].soft-dash-body .tc-view-btn.is-active {
  background: rgba(139, 143, 255, 0.18);
  color: #c9ceff;
}

body[data-theme="dark"].soft-dash-body .tc-cal-span-strip {
  background: #1e2130;
  border-top-color: #3d4459;
}

body[data-theme="dark"].soft-dash-body .tc-reminder-banner {
  border-color: #b45309;
  background: linear-gradient(135deg, #422006 0%, #451a03 100%);
}

body[data-theme="dark"].soft-dash-body .tc-reminder-banner-title,
body[data-theme="dark"].soft-dash-body .tc-reminder-banner-text {
  color: #fde68a;
}

body[data-theme="dark"].soft-dash-body .tc-reminder-banner-dismiss {
  background: #292524;
  border-color: #d97706;
  color: #fcd34d;
}

body[data-theme="dark"].soft-dash-body .tc-dialog-surface {
  background: #1e2130;
  border-color: #3d4459;
}

body[data-theme="dark"].soft-dash-body .tc-dialog-close {
  background: #252836;
  color: #c4c9e0;
}

body[data-theme="dark"].soft-dash-body .tc-dialog-note {
  background: #181b26;
  border-color: #3d4459;
  color: #e8eaf7;
}

body[data-theme="dark"].soft-dash-body .tc-dialog-note-row {
  background: #181b26;
  border-color: #3d4459;
}

body[data-theme="dark"].soft-dash-body .tc-day-user-preview-line {
  color: #9aa3c2;
}

body[data-theme="dark"].soft-dash-body .tc-day--clickable:hover {
  background: #252836;
}

@media (max-width: 1024px) {
  .tc-scroll-hint {
    display: block;
  }

  .tc-toolbar {
    position: sticky;
    top: max(0px, env(safe-area-inset-top, 0px));
    z-index: 8;
    background: var(--surface);
    box-shadow: 0 6px 20px rgba(30, 35, 60, 0.08);
  }

  body[data-theme="dark"].soft-dash-body .tc-toolbar {
    background: #262b3c;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}

@media (max-width: 720px) {
  .tc-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    gap: 10px;
  }

  .tc-nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px 8px;
    width: 100%;
    min-width: 0;
  }

  .tc-month-label {
    margin: 0;
    min-width: 0;
    font-size: clamp(0.95rem, 3.8vw, var(--tc-text-heading));
    text-align: center;
    line-height: var(--tc-leading-tight);
  }

  .tc-nav-btn {
    min-height: 44px;
    padding: 8px 10px;
    font-size: max(var(--tc-text-caption), 0.875rem);
  }

  .tc-jump {
    width: 100%;
    max-width: 100%;
  }

  .tc-view-toggle {
    width: 100%;
    justify-content: center;
  }

  .tc-jump-row {
    grid-template-columns: minmax(0, 1fr) minmax(3.5rem, 4.25rem) auto;
    gap: 6px 8px;
  }

  .tc-jump select {
    min-height: 44px;
    padding: 8px 8px;
  }

  .tc-jump-btn {
    min-height: 44px;
    padding: 8px 12px;
  }

  .tc-calendar-card {
    padding: 12px max(12px, env(safe-area-inset-left, 0px)) 12px max(12px, env(safe-area-inset-right, 0px));
  }

  .tc-day {
    min-height: clamp(88px, 22vw, 120px);
  }

  .tc-chip:not(.tc-chip--static) {
    font-size: var(--tc-text-caption);
    -webkit-line-clamp: 2;
  }

  .tc-span-bar {
    font-size: var(--tc-text-caption);
    min-height: 22px;
  }
}

@media (max-width: 480px) {
  .tc-wrap {
    gap: 14px;
  }

  .tc-header.soft-welcome {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .tc-dialog-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .tc-dialog-btn,
  .tc-dialog-btn--primary {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .tc-wrap {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .tc-day {
    min-height: 72px;
  }

  .tc-dialog-surface {
    max-height: min(95dvh, 100vh);
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .tc-dialog-title {
    font-size: var(--tc-text-subhead);
    margin-bottom: 10px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .tc-wrap {
    padding-left: max(24px, env(safe-area-inset-left, 0px));
    padding-right: max(24px, env(safe-area-inset-right, 0px));
  }

  .tc-calendar-card {
    padding: 20px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .tc-day--clickable:active {
    background: var(--surface-2);
    opacity: 0.95;
  }

  .tc-nav-btn:active,
  .tc-jump-btn:active {
    filter: brightness(0.9);
  }

  .tc-dialog-remind-block .tc-dialog-check {
    padding: 8px 0;
    min-height: 44px;
    align-items: center;
  }

  .tc-dialog-check input {
    width: 24px;
    height: 24px;
    margin-top: 0;
  }
}

@media print {
  body.soft-dash-body.tc-page {
    background: #fff !important;
    color: #111 !important;
  }

  body.soft-dash-body.tc-page .soft-dash-bg,
  body.soft-dash-body.tc-page .soft-lang-bar,
  body.soft-dash-body.tc-page .skip-link,
  body.soft-dash-body.tc-page #tc-live {
    display: none !important;
  }

  body.soft-dash-body.tc-page .tc-wrap {
    max-width: none;
    padding: 10mm 12mm;
    gap: 10px;
  }

  body.soft-dash-body.tc-page .soft-card {
    box-shadow: none !important;
    border: 1px solid #bbb;
    break-inside: avoid;
  }

  body.soft-dash-body.tc-page .tc-toolbar {
    position: static !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  body.soft-dash-body.tc-page .tc-scroll-hint {
    display: none !important;
  }

  body.soft-dash-body.tc-page .tc-calendar-card {
    overflow: visible !important;
    padding: 8px !important;
  }

  body.soft-dash-body.tc-page .tc-cal {
    min-width: 0 !important;
  }

  body.soft-dash-body.tc-page .tc-cal-week {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  body.soft-dash-body.tc-page #tc-day-dialog {
    display: none !important;
  }

  body.soft-dash-body.tc-page a {
    color: #000 !important;
    text-decoration: underline;
  }

  body.soft-dash-body.tc-page .tc-nav-btn,
  body.soft-dash-body.tc-page .tc-jump-btn,
  body.soft-dash-body.tc-page .soft-logout {
    border: 1px solid #999 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.soft-dash-body.tc-page .tc-chip--static,
  body.soft-dash-body.tc-page .tc-chip:not(.tc-chip--static),
  body.soft-dash-body.tc-page .tc-span-bar {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* —— Admin portal (parent tokens, children report) —— */
/*
 * login-body .page is display:flex; centered for index.php login shell.
 * Admin pages reuse .page without .login-shell — without this override, headings
 * and .soft-card children sit in a row and overlap.
 */
.login-body .page.admin-portal {
  display: block;
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.login-body .page.admin-portal.admin-portal--wide {
  max-width: 960px;
}

.login-body .page.admin-portal.admin-portal--full {
  max-width: none;
}

.login-body .page.admin-portal > * {
  width: 100%;
  box-sizing: border-box;
}

.login-body .page.admin-portal .admin-portal__title {
  color: var(--neo-text);
}

.login-body .page.admin-portal .admin-portal__lede {
  color: var(--neo-text-muted);
  max-width: none;
  margin-bottom: 1.25rem;
}

.login-body .page.admin-portal .admin-portal__lede code {
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: rgba(76, 85, 99, 0.1);
  color: var(--neo-text);
}

body[data-theme="dark"].login-body .page.admin-portal .admin-portal__lede code {
  background: rgba(255, 255, 255, 0.08);
}

.login-body .page.admin-portal .admin-portal__title--sub {
  color: var(--neo-text);
}

.login-body .page.admin-portal .soft-card,
.login-body .page.admin-portal .admin-token-box {
  padding: 1.35rem 1.4rem;
  background: var(--surface);
  border: none;
  border-radius: 22px;
  box-shadow: var(--neo-raised-sm);
}

.login-body .page.admin-portal .admin-portal__section {
  margin-top: 1.25rem;
}

.login-body .page.admin-portal .admin-portal__title--sub--flush {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

.login-body .page.admin-portal .admin-token-box__url {
  margin: 0.35rem 0 0;
  word-break: break-word;
  line-height: 1.45;
}

.login-body .page.admin-portal .admin-token-box__hint {
  font-weight: 400;
  color: var(--neo-text-muted);
  font-size: 0.875rem;
}

.login-body .page.admin-portal .admin-portal__submit {
  margin-top: 0.85rem;
}

.login-body .page.admin-portal .admin-form-field .login-field {
  margin-bottom: 1rem;
}

.login-body .page.admin-portal .admin-form-field .login-field:last-of-type {
  margin-bottom: 0;
}

body[data-theme="dark"].login-body .page.admin-portal .soft-card,
body[data-theme="dark"].login-body .page.admin-portal .admin-token-box {
  background: var(--surface);
  box-shadow: var(--neo-raised-sm);
}

.login-resume-notice {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.admin-portal {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 20px;
}

.admin-portal--wide {
  max-width: 960px;
}

.admin-portal--full {
  max-width: none;
}

.admin-portal__back-wrap {
  margin: 0 0 0.25rem;
}

.admin-portal__back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0.35rem 0.25rem 0;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent-1);
}

.admin-portal__back:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
}

.admin-portal__title {
  margin: 0.5rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.admin-portal__title--sub {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.admin-portal__lede {
  max-width: 65ch;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.admin-flash {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.admin-flash--success {
  border-color: rgba(11, 107, 82, 0.35);
  background: rgba(11, 107, 82, 0.08);
  color: var(--text);
}

.admin-flash--success::before {
  content: "✓ ";
  font-weight: 700;
  color: var(--success);
}

.admin-token-box {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.admin-token-box pre {
  margin: 0.5rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-2);
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.6rem 1.15rem;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

.admin-btn:focus-visible,
.admin-token-url-link:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

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

.admin-token-url-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.admin-btn--primary {
  background: var(--accent-1);
  color: #fff;
}

.admin-btn--danger {
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  font-size: 0.9375rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.admin-form-field input[type="text"],
.admin-form-field input[type="email"] {
  width: 100%;
  max-width: 28rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.admin-table-wrap .repair-table {
  min-width: 100%;
}

.admin-table-wrap .repair-table th,
.admin-table-wrap .repair-table td {
  font-variant-numeric: tabular-nums;
}

.id-mask {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.admin-revoke-form {
  display: inline;
  margin: 0;
}

.admin-mobile-meta {
  display: none;
}

/* Admin tables must NOT use the dashboard “stacked rows” pattern (no data-label on cells). */
@media (max-width: 700px) {
  .admin-table-wrap {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
  }

  .admin-table-wrap .repair-table {
    display: table;
    min-width: 520px;
  }

  .admin-table-wrap .repair-table thead {
    display: table-header-group;
  }

  .admin-table-wrap .repair-table tbody {
    display: table-row-group;
  }

  .admin-table-wrap .repair-table tr {
    display: table-row;
    border-bottom: 0;
    padding: 0;
  }

  .admin-table-wrap .repair-table th,
  .admin-table-wrap .repair-table td {
    display: table-cell;
    width: auto;
    white-space: normal;
    border-bottom: 1px solid var(--border);
    padding: 10px 8px;
  }

  .admin-table-wrap .repair-table th:nth-child(2),
  .admin-table-wrap .repair-table td:nth-child(2),
  .admin-table-wrap .repair-table th:nth-child(6),
  .admin-table-wrap .repair-table td:nth-child(6) {
    display: none;
  }

  .admin-table-wrap .repair-table td::before {
    content: none !important;
  }

  .admin-mobile-meta {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.4;
  }

  .admin-mobile-meta > span {
    display: block;
  }
}

@media (max-width: 767px) {
  .admin-portal,
  .admin-portal--wide {
    margin: 1rem auto;
    padding: 0 max(12px, env(safe-area-inset-right)) 1.5rem max(12px, env(safe-area-inset-left));
  }

  .admin-portal__title {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
  }

  .admin-portal__lede {
    font-size: 1rem;
    max-width: none;
  }

  .admin-portal__back {
    margin-left: -0.35rem;
    padding-left: 0.35rem;
  }

  .admin-form-field input[type="text"],
  .admin-form-field input[type="email"] {
    max-width: none;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
  }

  .admin-btn--primary {
    width: 100%;
    max-width: 100%;
  }

  .admin-token-box a {
    display: inline-block;
    padding: 0.35rem 0;
    min-height: 44px;
    line-height: 1.4;
    word-break: break-word;
  }

  .admin-revoke-form {
    display: block;
  }

  .admin-revoke-form .admin-btn {
    width: 100%;
    max-width: 280px;
  }
}

/* ASC timetable (dashboard — daily strip + week grid) */
.dash-asc-tt {
  margin-top: 1rem;
}

.dash-asc-tt-sub {
  margin: 0.35rem 0 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.dash-asc-daily-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: stretch;
}

.dash-asc-daily-slot {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dash-asc-daily-meta {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.85;
  line-height: 1.25;
}

.dash-asc-cell {
  border-radius: 10px;
  padding: 0.45rem 0.5rem;
  min-height: 3rem;
  font-size: 0.82rem;
  line-height: 1.3;
}

.dash-asc-tier-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0;
}

.dash-asc-tier-lbl {
  font-size: 0.78rem;
  opacity: 0.7;
}

.dash-asc-tier-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.dash-asc-tier-pill input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  position: absolute;
  opacity: 0;
}

.dash-asc-tier-pill:hover {
  border-color: var(--accent-1, #7a5cff);
}

.dash-asc-tier-pill.is-active,
.dash-asc-tier-pill:has(input[type="radio"]:checked) {
  background: var(--accent-1, #7a5cff);
  color: #fff;
  border-color: var(--accent-1, #7a5cff);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 1px 4px rgba(0, 0, 0, 0.18);
}

.dash-asc-tier-save {
  padding: 0.28rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--accent-1, #7a5cff);
  background: transparent;
  color: var(--accent-1, #7a5cff);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dash-asc-tier-save:hover {
  background: var(--accent-1, #7a5cff);
  color: #fff;
}

.dash-asc-save-img {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.8rem;
  margin-left: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dash-asc-save-img:hover {
  background: var(--accent-1, #7a5cff);
  color: #fff;
  border-color: var(--accent-1, #7a5cff);
}

.dash-asc-save-img:disabled {
  opacity: 0.6;
  cursor: progress;
}

.dash-asc-save-img-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.dash-asc-tt--week.is-capturing .dash-asc-cell--lesson,
.dash-asc-tt--week.is-capturing .dash-asc-week-corner,
.dash-asc-tt--week.is-capturing .dash-asc-week-day,
.dash-asc-tt--week.is-capturing .dash-asc-week-scroll,
.dash-asc-tt--week.is-capturing .dash-asc-week-table,
.dash-asc-tt--week.is-capturing .dash-asc-week-table * {
  box-shadow: none !important;
  filter: none !important;
}

.dash-asc-tt--week.is-capturing .dash-asc-week-table,
.dash-asc-tt--week.is-capturing .dash-asc-week-table * {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

.dash-asc-tt--week.is-capturing .dash-asc-week-table {
  width: auto !important;
  table-layout: auto !important;
}

.dash-asc-tt--week.is-capturing .dash-asc-week-scroll {
  overflow: visible !important;
}

.dash-tt-iframe-card {
  margin-bottom: 1rem;
}

.dash-tt-iframe-open {
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.dash-tt-iframe-open:hover {
  border-color: var(--accent-1, #7a5cff);
  color: var(--accent-1, #7a5cff);
}

.dash-tt-iframe-wrap {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  background: var(--surface-2, #f7f9ff);
}

.dash-tt-iframe {
  display: block;
  width: 100%;
  height: 760px;
  border: 0;
  background: #fff;
}

@media (max-width: 720px) {
  .dash-tt-iframe {
    height: 620px;
  }
}

.dash-asc-cell--lesson {
  /* background + color set inline per-subject for glance-style coloring */
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.4rem 0.5rem;
}

.dash-asc-cell--lesson strong {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.dash-asc-cell--lesson .dash-asc-cell-meta {
  font-size: 0.76rem;
  opacity: 0.92;
  line-height: 1.25;
  font-weight: 500;
}

.dash-asc-cell--lesson .dash-asc-subject-link,
.dash-asc-cell--lesson .dash-asc-class-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.dash-asc-cell--lesson .dash-asc-subject-link:hover strong,
.dash-asc-cell--lesson .dash-asc-class-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.dash-asc-cell--lesson .dash-asc-subject-link:focus-visible,
.dash-asc-cell--lesson .dash-asc-class-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 1px;
  border-radius: 3px;
}

.dash-asc-cell--stripe {
  background: repeating-linear-gradient(
    -35deg,
    rgba(45, 212, 191, 0.35),
    rgba(45, 212, 191, 0.35) 6px,
    rgba(255, 255, 255, 0.55) 6px,
    rgba(255, 255, 255, 0.55) 12px
  );
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: 0.78rem;
}

.dash-asc-cell--empty,
.dash-asc-week-empty {
  opacity: 0.35;
  text-align: center;
}

.dash-asc-week-scroll {
  overflow-x: auto;
  margin-top: 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  scrollbar-gutter: stable;
}

@media (max-width: 1023px) {
  @supports (scrollbar-color: auto) {
    .dash-asc-week-scroll {
      scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
      scrollbar-width: thin;
    }
  }
}

.dash-asc-week-table {
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}

.dash-asc-week-corner {
  width: 6.5rem;
  min-width: 6.5rem;
  background: #1e3a5f;
  color: #f8fafc;
  padding: 0.5rem 0.4rem;
  text-align: center;
  vertical-align: middle;
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 8px 0 14px -10px rgba(15, 23, 42, 0.35);
}

.dash-asc-week-hdr {
  padding: 0.45rem 0.35rem;
  text-align: center;
  vertical-align: bottom;
  font-weight: 700;
  color: #f8fafc;
  min-width: 4.5rem;
}

.dash-asc-week-hdr.is-navy {
  background: linear-gradient(180deg, #1e3a5f 0%, #1e40af 100%);
}

.dash-asc-week-hdr.is-teal {
  background: linear-gradient(180deg, #0f766e 0%, #14b8a6 100%);
}

.dash-asc-hdr-label {
  display: block;
  font-size: 0.72rem;
  line-height: 1.2;
}

.dash-asc-hdr-time {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 0.2rem;
  white-space: nowrap;
}

.dash-asc-week-day {
  background: #f1f5f9;
  padding: 0.45rem 0.35rem;
  text-align: center;
  font-weight: 700;
  position: sticky;
  left: 0;
  z-index: 1;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 8px 0 14px -10px rgba(15, 23, 42, 0.22);
}

.dash-asc-week-td {
  padding: 0.35rem;
  vertical-align: middle;
  text-align: center;
  background: #fff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  border-right: 1px solid rgba(15, 23, 42, 0.05);
}

.dash-asc-week-td.is-break,
.dash-asc-week-td.is-hr-empty {
  padding: 0;
}

body[data-theme="dark"].soft-dash-body .dash-asc-week-day {
  background: #2b3143;
  color: #e2e8f0;
}

body[data-theme="dark"].soft-dash-body .dash-asc-week-td {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.15);
}

body[data-theme="dark"].soft-dash-body .dash-asc-cell--lesson {
  background: linear-gradient(145deg, #115e59, #0d9488);
  color: #ecfdf5;
}

body[data-theme="dark"].soft-dash-body .dash-asc-cell--stripe {
  color: #e2e8f0;
}

/* ── Role Switcher (staff ↔ parent) ─────────────────────────────────────── */
.soft-role-switch-btn {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  color: #065f46;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}
.soft-role-switch-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.55);
}
.soft-role-switch-btn--back {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.07);
  color: #3730a3;
}
.soft-role-switch-btn--back:hover {
  background: rgba(99, 102, 241, 0.13);
  border-color: rgba(99, 102, 241, 0.5);
}
body[data-theme='dark'] .soft-role-switch-btn {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}
body[data-theme='dark'] .soft-role-switch-btn--back {
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.1);
}
.soft-role-link-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--soft-color-text-soft, #64748b);
  margin: 0 0 6px 0;
}
.soft-role-link-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.soft-role-link-phone {
  width: 100%;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: #fff;
  font-size: 0.85rem;
  font-family: inherit;
  box-sizing: border-box;
}
body[data-theme='dark'] .soft-role-link-phone {
  background: #1e293b;
  border-color: rgba(248, 250, 252, 0.15);
  color: #f1f5f9;
}
.soft-role-switch-flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 12px;
}
.soft-role-switch-flash--ok {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #065f46;
}
.soft-role-switch-flash--err {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #991b1b;
}
body[data-theme='dark'] .soft-role-switch-flash--ok {
  color: #6ee7b7;
}
body[data-theme='dark'] .soft-role-switch-flash--err {
  color: #fca5a5;
}
.soft-role-active-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.82rem;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 12px;
}
body[data-theme='dark'] .soft-role-active-banner {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.1);
}
