:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --line: #d8dee5;
  --line-strong: #b9c3cf;
  --text: #17212b;
  --muted: #667485;
  --accent: #0f766e;
  --accent-dark: #0a5e58;
  --danger: #b42318;
  --warning: #b54708;
  --ok: #027a48;
  --info: #175cd3;
  --sidebar: #15202b;
  --sidebar-muted: #aab6c4;
  --shadow: 0 10px 24px rgba(23, 33, 43, 0.08);
}

/* Yasen Management Portal Design System */
:root {
  color-scheme: light;
  --primary: #f36a21;
  --primary-hover: #d95712;
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --sidebar: #111827;
  --text: #111827;
  --text-secondary: #6b7280;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #e5e7eb;
  --shadow: 0 14px 34px rgba(17, 24, 39, 0.06);
  --shadow-subtle: 0 1px 2px rgba(17, 24, 39, 0.05);
  --radius-card: 16px;
  --radius-control: 12px;
  --control-height: 40px;
  --input-height: 44px;
  --bg: var(--background);
  --line: var(--border);
  --line-strong: #d1d5db;
  --muted: var(--text-secondary);
  --accent: var(--primary);
  --accent-dark: var(--primary-hover);
  --ok: var(--success);
  --info: #2563eb;
  --sidebar-muted: #9ca3af;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #0f172a;
  --surface: #111827;
  --surface-2: #1f2937;
  --text: #f9fafb;
  --text-secondary: #9ca3af;
  --border: #374151;
  --bg: var(--background);
  --line: var(--border);
  --line-strong: #4b5563;
}

body {
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  grid-template-columns: 1fr;
  padding: 32px;
  background: var(--background);
}

.login-tools {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.login-panel {
  width: min(100%, 420px);
  padding: 42px;
  display: grid;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.login-brand {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
}

.login-brand img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.login-brand h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}

.login-brand p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 16px;
  max-width: none;
}

.field {
  gap: 8px;
}

.field span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea,
.table-input {
  min-height: var(--input-height);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  font-size: 14px;
  box-shadow: none;
}

.field textarea,
textarea.table-input {
  padding-top: 12px;
  padding-bottom: 12px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.table-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(243, 106, 33, 0.14);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  overflow: hidden;
}

.password-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(243, 106, 33, 0.14);
}

.password-field input {
  border: 0;
  box-shadow: none;
}

.password-field input:focus {
  box-shadow: none;
}

.password-field button {
  min-height: var(--input-height);
  padding: 0 14px;
  color: var(--text-secondary);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 13px;
}

.remember-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.remember-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.login-options a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  min-height: var(--control-height);
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 700;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
}

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

.secondary-btn {
  background: #f3f4f6;
  color: var(--text);
  border: 1px solid var(--border);
}

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

.danger-btn {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.row-actions {
  display: grid;
  gap: 8px;
  min-width: 150px;
}

.demo-accounts {
  margin-top: 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.demo-accounts .ghost-btn {
  justify-content: center;
}

.error,
.notice {
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-control);
  padding: 12px 14px;
}

.app-shell {
  grid-template-columns: 240px minmax(0, 1fr);
  background: var(--background);
}

.sidebar {
  width: 240px;
  background: var(--sidebar);
  padding: 20px 14px;
  gap: 22px;
}

.brand {
  min-height: 56px;
  padding: 0 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand strong {
  font-size: 16px;
  font-weight: 700;
}

.brand span {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 500;
}

.nav {
  gap: 8px;
}

.nav button {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 12px;
  color: #cbd5e1;
  font-weight: 600;
}

.nav button.active {
  color: #fff;
  background: var(--primary);
}

.nav button.is-loading {
  cursor: progress;
  opacity: 0.94;
}

.nav-spinner {
  width: 14px;
  height: 14px;
  margin-left: auto;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  animation: spin 0.75s linear infinite;
}

.nav button:hover:not(.disabled):not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav button.disabled {
  opacity: 0.54;
  cursor: default;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

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

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #9ca3af;
}

.main {
  background: var(--background);
}

.topbar {
  min-height: 76px;
  height: auto;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 18px 32px;
}

.topbar h1 {
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
}

.topbar small {
  color: var(--text-secondary);
  font-weight: 500;
}

.user-chip {
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.content {
  padding: 32px;
}

.panel,
.kpi {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
}

.panel-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 20px;
}

.panel-header h2,
.panel-header h3 {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.panel-header small,
.section-title small {
  color: var(--text-secondary);
}

.panel-body {
  padding: 20px;
}

.loading-panel {
  min-height: 260px;
}

.loading-body {
  display: grid;
  gap: 14px;
}

.loading-body span {
  display: block;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(90deg, #f3f4f6 0%, #ffffff 45%, #f3f4f6 100%);
  background-size: 220% 100%;
  animation: loading-shimmer 1.2s ease-in-out infinite;
  border: 1px solid var(--border);
}

.loading-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(243, 106, 33, 0.1);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.loading-chip::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(243, 106, 33, 0.24);
  border-top-color: var(--primary);
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loading-shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

.dashboard-home {
  display: grid;
  gap: 24px;
}

.dashboard-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-subtle);
  padding: 24px;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.dashboard-hero h2 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
}

.dashboard-hero p {
  margin: 8px 0 0;
  color: var(--text-secondary);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.kpi {
  min-height: 132px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.kpi > div {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: rgba(243, 106, 33, 0.1);
}

.kpi span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.kpi strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px;
}

.calendar-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-item {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.compact-item strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.compact-item span {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 12px;
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding: 2px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

.calendar-weekday {
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 58px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.calendar-day strong {
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}

.calendar-day small {
  min-height: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.calendar-day.is-empty {
  background: transparent;
  border-color: transparent;
}

.calendar-day.is-weekend:not(.today) {
  background: var(--surface-2);
  color: var(--text-secondary);
}

.calendar-day.has-task,
.calendar-day.has-report {
  border-color: rgba(243, 106, 33, 0.22);
  background: rgba(243, 106, 33, 0.04);
}

.mini-calendar .today {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 10px 22px rgba(243, 106, 33, 0.22);
}

.mini-calendar .today .calendar-dot {
  background: #fff;
}

.calendar-dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 999px;
}

.task-dot {
  background: var(--primary);
}

.report-dot {
  background: var(--success);
}

.dashboard-solo-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(180px, 1fr));
  gap: 16px;
}

.dashboard-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.report-status-card {
  min-height: 150px;
}

.report-status-card small {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.dashboard-status-panel .panel-body {
  padding: 16px 20px 20px;
}

.status-breakdown {
  display: grid;
  gap: 10px;
}

.status-breakdown-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.status-breakdown-row strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--text-secondary);
}

.tone-success,
.tone-done {
  background: var(--success);
}

.tone-warning,
.tone-waiting,
.tone-doing {
  background: var(--warning);
}

.tone-danger,
.tone-overdue {
  background: var(--danger);
}

.tone-muted,
.tone-todo,
.tone-canceled {
  background: #94a3b8;
}

.unsubmitted-list {
  display: grid;
  gap: 10px;
}

.status-breakdown + .unsubmitted-list,
.status-breakdown + .empty-compact {
  margin-top: 14px;
}

.unsubmitted-list.is-compact {
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.list-heading {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.unsubmitted-user {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.unsubmitted-user strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.unsubmitted-user span {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
}

.empty-compact {
  min-height: 54px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

@media (max-width: 1180px) {
  .dashboard-solo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .dashboard-insight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .dashboard-solo-grid {
    grid-template-columns: 1fr;
  }
}

.meta-card,
.task-summary-box,
.report-table-wrap,
.simple-table,
.task-table-wrap {
  border-color: var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.meta-card,
.task-summary-box {
  background: var(--surface-2);
}

.report-table,
.simple-table {
  background: var(--surface);
}

.recurring-report-table {
  table-layout: fixed;
  min-width: 1120px;
}

.recurring-report-table th:nth-child(1) {
  width: 32%;
}

.recurring-report-table th:nth-child(2),
.recurring-report-table th:nth-child(3),
.recurring-report-table th:nth-child(4),
.recurring-report-table th:nth-child(5) {
  width: 12%;
}

.recurring-report-table th:nth-child(6) {
  width: 20%;
}

.recurring-report-table td {
  vertical-align: middle;
}

.recurring-report-table .table-input {
  width: 100%;
}

.recurring-report-table textarea.table-input {
  min-height: 52px;
  resize: vertical;
}

.report-table th,
.simple-table th {
  background: var(--surface-2);
  color: var(--text-secondary);
}

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

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

  .calendar-panel {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .login-page {
    padding: 24px 16px;
  }

  .login-tools {
    position: static;
    justify-self: end;
    margin-bottom: 14px;
  }

  .login-panel {
    padding: 30px 22px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: 100%;
    position: static;
  }

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

  .nav button {
    justify-content: flex-start;
  }

  .topbar,
  .content {
    padding: 18px;
  }

  .top-actions {
    flex-wrap: wrap;
  }

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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 470px) minmax(420px, 1fr);
  background: linear-gradient(90deg, #ffffff 0%, #ffffff 45%, #edf2f5 45%, #edf2f5 100%);
}

.login-panel {
  padding: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-panel h1 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.15;
}

.login-panel p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 14px;
  max-width: 360px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 650;
}

.field input,
.field select,
.field textarea,
.table-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  min-height: 40px;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.table-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  border-radius: 6px;
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

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

.secondary-btn {
  background: #e7eef3;
  color: #17212b;
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.danger-btn {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid #fecdca;
}

.icon-btn {
  width: 36px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.login-visual {
  padding: 44px;
  display: flex;
  align-items: center;
}

.mock-window {
  width: min(780px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
  overflow: hidden;
}

.mock-top {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c5ced8;
}

.mock-body {
  display: grid;
  grid-template-columns: 170px 1fr;
  min-height: 430px;
}

.mock-side {
  background: var(--sidebar);
  padding: 18px 12px;
}

.mock-side div {
  height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

.mock-main {
  padding: 22px;
}

.mock-main h2 {
  margin: 0 0 14px;
  font-size: 21px;
}

.mock-row {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 0.8fr 0.8fr;
  gap: 8px;
  margin-bottom: 8px;
}

.mock-row span {
  height: 32px;
  border-radius: 5px;
  background: #edf2f5;
}

.demo-accounts {
  margin-top: 22px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.demo-accounts code {
  color: var(--text);
  background: #eef3f5;
  border-radius: 5px;
  padding: 2px 6px;
}

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

.sidebar {
  background: var(--sidebar);
  color: #fff;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 16px;
}

.brand span {
  display: block;
  color: var(--sidebar-muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav button {
  min-height: 40px;
  border-radius: 6px;
  background: transparent;
  color: var(--sidebar-muted);
  text-align: left;
  padding: 0 10px;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav button.active,
.nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 8px 0;
  color: var(--sidebar-muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.topbar small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-chip {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  background: var(--surface-2);
  font-size: 13px;
  color: var(--muted);
}

.content {
  padding: 22px;
  min-width: 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(23, 33, 43, 0.04);
  min-width: 0;
}

.panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 17px;
}

.panel-header small {
  color: var(--muted);
}

.panel-body {
  padding: 16px 18px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.meta-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--surface-2);
}

.meta-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.meta-card strong {
  font-size: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 9px;
  gap: 10px;
}

.section-title h3 {
  margin: 0;
  font-size: 15px;
}

.section-title small {
  color: var(--muted);
}

.report-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: #fff;
}

.report-table th {
  background: #eef3f5;
  color: #354250;
  font-size: 12px;
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.report-table td {
  padding: 8px;
  border-bottom: 1px solid #edf1f4;
  vertical-align: top;
}

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

.table-input {
  padding: 8px;
  min-height: 36px;
  font-size: 13px;
}

textarea.table-input {
  min-height: 54px;
  resize: vertical;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.status-draft {
  background: #eef3f5;
  color: #475467;
}

.status-submitted {
  background: #e0f2fe;
  color: var(--info);
}

.status-returned {
  background: #fff4e5;
  color: var(--warning);
}

.status-approved {
  background: #dcfae6;
  color: var(--ok);
}

.status-task-todo {
  background: #eef3f5;
  color: #475467;
}

.status-task-doing {
  background: #e0f2fe;
  color: var(--info);
}

.status-task-waiting {
  background: #f4ebff;
  color: #6941c6;
}

.status-task-done {
  background: #dcfae6;
  color: var(--ok);
}

.status-task-overdue {
  background: #fee4e2;
  color: var(--danger);
}

.status-task-canceled {
  background: #f3f4f6;
  color: #6b7280;
}

.task-flag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  margin-left: 6px;
}

.flag-warning {
  background: #fffaeb;
  color: var(--warning);
  border: 1px solid #fedf89;
}

.task-summary-title {
  margin-top: 0;
}

.task-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.task-summary-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  min-width: 0;
}

.task-summary-head {
  min-height: 38px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-summary-head strong {
  font-size: 13px;
}

.task-summary-head span {
  color: var(--muted);
  font-weight: 800;
}

.task-mini {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-bottom: 1px solid #edf1f4;
}

.task-mini:last-child {
  border-bottom: 0;
}

.task-mini strong {
  font-size: 13px;
  line-height: 1.3;
}

.task-mini span {
  color: var(--muted);
  font-size: 12px;
}

.task-mini em {
  justify-self: start;
  font-style: normal;
}

.compact-empty {
  padding: 14px 10px;
  font-size: 13px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.review-panel {
  position: sticky;
  top: 86px;
}

.comment-box {
  display: grid;
  gap: 10px;
}

.comments {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.comment {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--surface-2);
}

.comment strong {
  display: block;
  font-size: 13px;
}

.comment p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.kpi strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

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

.simple-table th,
.simple-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.simple-table th {
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
}

.simple-table tr[data-open-report] {
  cursor: pointer;
}

.simple-table tr[data-open-report]:hover td {
  background: #f2f7f7;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.master-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.field-wide {
  grid-column: 1 / -1;
}

.inline-field {
  min-width: 150px;
}

.multi-filter {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 520px;
}

.multi-filter legend {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  padding: 0;
}

.status-filter-options {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.status-filter-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.status-filter-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.status-filter-chip span {
  color: inherit;
}

.status-filter-count {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.status-filter-chip:hover {
  background: var(--surface-2);
  color: var(--text);
}

.status-filter-chip.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(243, 106, 33, 0.18);
}

.status-filter-chip.is-active .status-filter-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.filter-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px 0 12px;
  margin-top: 12px;
}

.task-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.task-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

.task-table {
  table-layout: fixed;
  min-width: 820px;
}

.task-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.task-table th:nth-child(1) {
  width: 34%;
}

.task-table th:nth-child(2) {
  width: 18%;
}

.task-table th:nth-child(3) {
  width: 15%;
}

.task-table th:nth-child(4) {
  width: 20%;
}

.task-table th:nth-child(5) {
  width: 13%;
}

.task-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 5px 0;
  color: var(--muted);
  font-size: 12px;
}

.task-actions {
  text-align: right;
}

.task-actions .primary-btn,
.task-actions .secondary-btn,
.task-actions .ghost-btn {
  display: block;
  margin-left: auto;
  min-height: 32px;
  padding: 0 10px;
  width: 100%;
}

.task-actions button + button {
  margin-top: 8px;
}

.filter-summary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  padding-bottom: 10px;
}

.filter-summary strong {
  color: var(--ink);
  font-size: 22px;
}

.simple-table code {
  white-space: nowrap;
  background: #eef3f5;
  border-radius: 5px;
  padding: 2px 6px;
}

.debug-json {
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--surface-2);
}

.debug-json summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.debug-json pre {
  margin: 10px 0 0;
  white-space: pre-wrap;
  font-size: 12px;
  color: #354250;
}

.notice {
  border: 1px solid #fedf89;
  background: #fffaeb;
  color: #93370d;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.account-security-body {
  display: grid;
  gap: 4px;
}

.account-security-body span {
  font-weight: 700;
}

.account-security-body small {
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(21, 32, 43, 0.42);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-panel {
  width: min(760px, 100%);
  max-height: min(680px, calc(100vh - 36px));
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
}

.check-field {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.check-field input {
  width: 16px;
  height: 16px;
}

.check-field span {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.review-department-group small {
  color: var(--muted);
}

.is-hidden {
  display: none !important;
}

.error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
}

.empty {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.mobile-menu {
  display: none;
}

@media (max-width: 1100px) {
  .workspace,
  .split,
  .master-form,
  .task-summary-grid {
    grid-template-columns: 1fr;
  }

  .review-panel {
    position: static;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 900px) {
  .task-table-wrap {
    border: 0;
    overflow: visible;
  }

  .task-table {
    display: block;
    min-width: 0;
    table-layout: auto;
  }

  .task-table thead {
    display: none;
  }

  .task-table tbody {
    display: grid;
    gap: 10px;
  }

  .task-table tr {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
  }

  .task-table td {
    display: grid;
    gap: 4px;
    border-bottom: 1px solid #edf1f4;
    padding: 10px 12px;
  }

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

  .task-table td::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
  }

  .task-table td:nth-child(1)::before {
    content: "Task Details";
  }

  .task-table td:nth-child(2)::before {
    content: "Owner / Dept";
  }

  .task-table td:nth-child(3)::before {
    content: "Due / Status";
  }

  .task-table td:nth-child(4)::before {
    content: "Last Update";
  }

  .task-table td:nth-child(5)::before {
    content: "Actions";
  }

  html[lang="zh-Hant"] .task-table td:nth-child(1)::before {
    content: "任務內容";
  }

  html[lang="zh-Hant"] .task-table td:nth-child(2)::before {
    content: "負責 / 部門";
  }

  html[lang="zh-Hant"] .task-table td:nth-child(3)::before {
    content: "截止 / 狀態";
  }

  html[lang="zh-Hant"] .task-table td:nth-child(4)::before {
    content: "最後更新";
  }

  html[lang="zh-Hant"] .task-table td:nth-child(5)::before {
    content: "操作";
  }

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

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

@media (max-width: 760px) {
  .login-page,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    padding: 32px 22px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 12px;
  }

  .brand {
    padding-bottom: 8px;
  }

  .nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .nav button {
    justify-content: center;
    padding: 0 6px;
    font-size: 12px;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    height: auto;
    padding: 14px;
    align-items: flex-start;
    flex-direction: column;
  }

  .content {
    padding: 14px;
  }

  .meta-grid,
  .cards-grid,
  .task-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Final Yasen overrides: keep these last so legacy prototype styles cannot override the design system. */
.login-page {
  display: grid;
  place-items: center;
  grid-template-columns: 1fr;
  padding: 32px;
  background: var(--background);
}

.login-panel {
  width: min(100%, 420px);
  padding: 42px;
  display: grid;
  gap: 28px;
  justify-content: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.login-brand,
.login-tools,
.login-options,
.remember-option,
.password-field,
.compact-item,
.top-actions {
  display: flex;
}

.login-brand {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.login-brand img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.login-brand h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}

.login-brand p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.login-tools {
  position: fixed;
  top: 20px;
  right: 20px;
  gap: 8px;
  z-index: 2;
}

.login-options {
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 13px;
}

.remember-option {
  align-items: center;
  gap: 8px;
}

.remember-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.login-options a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  overflow: hidden;
}

.password-field input,
.password-field input:focus {
  border: 0;
  box-shadow: none;
}

.password-field button {
  min-height: var(--input-height);
  padding: 0 14px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.login-visual {
  display: none;
}

.app-shell {
  grid-template-columns: 240px minmax(0, 1fr);
  background: var(--background);
}

.sidebar {
  width: 240px;
  background: var(--sidebar);
  padding: 20px 14px;
  gap: 22px;
}

.brand {
  min-height: 56px;
  padding: 0 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-mark {
  display: none;
}

.nav {
  gap: 6px;
}

.nav button {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 12px;
  color: #cbd5e1;
  font-weight: 600;
}

.nav button.active {
  color: #fff;
  background: var(--primary);
}

.nav button:hover:not(.disabled):not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

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

.topbar {
  min-height: 76px;
  height: auto;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 18px 32px;
}

.content {
  padding: 32px;
}

.dashboard-home {
  display: grid;
  gap: 24px;
}

.dashboard-hero,
.panel,
.kpi {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
}

.dashboard-hero {
  padding: 24px;
}

.dashboard-hero h2 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
}

.dashboard-hero p {
  margin: 8px 0 0;
  color: var(--text-secondary);
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.kpi {
  min-height: 132px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.kpi > div {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: rgba(243, 106, 33, 0.1);
}

.kpi span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.kpi strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px;
}

.calendar-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-item {
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding: 2px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

.calendar-weekday {
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 58px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.calendar-day strong {
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}

.calendar-day small {
  min-height: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.calendar-day.is-empty {
  background: transparent;
  border-color: transparent;
}

.calendar-day.is-weekend:not(.today) {
  background: var(--surface-2);
  color: var(--text-secondary);
}

.calendar-day.has-task,
.calendar-day.has-report {
  border-color: rgba(243, 106, 33, 0.22);
  background: rgba(243, 106, 33, 0.04);
}

.mini-calendar .today {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 10px 22px rgba(243, 106, 33, 0.22);
}

.mini-calendar .today .calendar-dot {
  background: #fff;
}

.calendar-dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 999px;
}

.task-dot {
  background: var(--primary);
}

.report-dot {
  background: var(--success);
}

@media (max-width: 1100px) {
  .kpi-grid,
  .dashboard-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .calendar-panel {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .login-page,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .login-tools {
    position: static;
    justify-self: end;
    margin-bottom: 14px;
  }

  .login-panel {
    padding: 30px 22px;
  }

  .sidebar {
    width: 100%;
    position: static;
  }

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

  .nav button {
    justify-content: flex-start;
    font-size: 13px;
  }

  .topbar,
  .content {
    padding: 18px;
  }

  .top-actions {
    flex-wrap: wrap;
  }
}

.field input,
.field select,
.field textarea,
.table-input {
  min-height: var(--input-height);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
}

.field textarea,
textarea.table-input {
  padding-top: 12px;
  padding-bottom: 12px;
}

:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .table-input,
:root[data-theme="dark"] .password-field {
  background: #0f172a;
  color: #f9fafb;
  border-color: #374151;
}

:root[data-theme="dark"] .field input::placeholder,
:root[data-theme="dark"] .field textarea::placeholder {
  color: #6b7280;
}

.password-field input {
  background: transparent !important;
  color: var(--text);
}

:root[data-theme="dark"] .password-field input {
  color: #f9fafb;
}

.error:empty {
  display: none;
}

/* Yasen interior pages: shared design system for reports, tasks, recurring task, settings, and review. */
.nav-group {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-group > span {
  padding: 0 12px 4px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.nav-group button {
  margin: 0;
}

.content {
  display: grid;
  gap: 18px;
  align-content: start;
}

.page-workspace,
.page-panel {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.meeting-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 24px;
}

.meeting-workspace.without-review-panel {
  grid-template-columns: minmax(0, 1fr);
}

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

.panel {
  overflow: hidden;
}

.panel-header {
  min-height: 72px;
  padding: 20px 24px;
  background: var(--surface);
}

.panel-header h2,
.panel-header h3 {
  font-size: 19px;
  line-height: 1.25;
}

.panel-header small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.panel-body {
  padding: 24px;
}

.meta-grid,
.task-summary-grid {
  gap: 14px;
}

.meta-card,
.task-summary-box,
.comment,
.check-field {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: none;
}

.meta-card {
  padding: 14px 16px;
}

.meta-card span,
.section-title small,
.task-mini span,
.comment p,
.account-security-body small,
.review-department-group small {
  color: var(--text-secondary);
}

.meta-card strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
}

.section-title {
  margin: 28px 0 12px;
}

.section-title h3 {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.report-table-wrap,
.task-table-wrap {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: auto;
}

.report-table,
.simple-table,
.task-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

.simple-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.report-table th,
.simple-table th,
.task-table th {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.report-table td,
.simple-table td,
.task-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  vertical-align: top;
}

.report-table tr:last-child td,
.simple-table tr:last-child td,
.task-table tr:last-child td {
  border-bottom: 0;
}

.simple-table tr[data-open-report]:hover td,
.task-table tbody tr:hover td {
  background: rgba(243, 106, 33, 0.035);
}

.table-input {
  min-height: 40px;
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
}

textarea.table-input {
  min-height: 68px;
}

.row-actions {
  display: grid;
  gap: 8px;
  min-width: 150px;
}

.row-actions .secondary-btn,
.row-actions .ghost-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
  white-space: nowrap;
}

.master-form,
.login-form {
  gap: 14px;
}

.master-form {
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  padding: 0 0 6px;
}

.field span {
  margin-bottom: 1px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.table-input {
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.toolbar {
  gap: 10px;
  margin-top: 18px;
}

.filter-bar {
  margin: 24px 0 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}

.task-filters {
  gap: 12px;
}

.inline-field {
  min-width: 190px;
}

.multi-filter {
  min-width: 560px;
}

.filter-summary {
  min-height: 44px;
  padding: 0 2px;
  color: var(--text-secondary);
}

.filter-summary strong {
  color: var(--text);
  font-size: 24px;
}

.status-pill,
.task-flag,
.task-status {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.comment-box {
  gap: 12px;
}

.comment-box .field textarea {
  min-height: 90px;
}

.comments {
  gap: 12px;
}

.comments > strong {
  margin-top: 8px;
  color: var(--text);
  font-size: 15px;
}

.comment {
  padding: 14px;
}

.task-summary-box {
  min-height: 116px;
}

.task-summary-head {
  min-height: 44px;
  padding: 11px 14px;
  border-color: var(--border);
}

.task-mini {
  padding: 12px 14px;
  border-color: var(--border);
}

.task-table {
  min-width: 980px;
}

.task-actions {
  text-align: right;
}

.task-actions .primary-btn,
.task-actions .secondary-btn,
.task-actions .ghost-btn,
.fixed-items-page .simple-table button {
  min-height: 34px;
  border-radius: 10px;
  font-size: 13px;
}

.simple-table code {
  background: rgba(17, 24, 39, 0.05);
  color: var(--text);
  border-radius: 8px;
  padding: 3px 7px;
}

.debug-json {
  border-color: var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.debug-json pre {
  color: var(--text-secondary);
}

.modal-panel {
  border-color: var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.check-field {
  min-height: 44px;
  background: var(--surface);
}

.check-field input {
  accent-color: var(--primary);
}

.account-security-body {
  gap: 8px;
}

.notice {
  border-color: #fed7aa;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
}

.toast-notice {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1200;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: start;
  width: min(440px, calc(100vw - 48px));
  padding: 14px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.toast-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.toast-copy strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.toast-copy span {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.toast-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.toast-close:hover {
  background: rgba(17, 24, 39, 0.06);
  color: var(--text);
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.35);
}

.toast-success .toast-icon {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.35);
}

.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.toast-info .toast-icon {
  background: rgba(243, 106, 33, 0.12);
  color: var(--primary);
}

.empty {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .dashboard-hero,
:root[data-theme="dark"] .kpi,
:root[data-theme="dark"] .report-table,
:root[data-theme="dark"] .simple-table,
:root[data-theme="dark"] .task-table,
:root[data-theme="dark"] .report-table-wrap,
:root[data-theme="dark"] .task-table-wrap,
:root[data-theme="dark"] .modal-panel {
  background: var(--surface);
  border-color: var(--border);
}

:root[data-theme="dark"] .panel-header,
:root[data-theme="dark"] .report-table th,
:root[data-theme="dark"] .simple-table th,
:root[data-theme="dark"] .task-table th,
:root[data-theme="dark"] .filter-bar,
:root[data-theme="dark"] .meta-card,
:root[data-theme="dark"] .task-summary-box,
:root[data-theme="dark"] .comment,
:root[data-theme="dark"] .debug-json {
  background: var(--surface-2);
}

:root[data-theme="dark"] .report-table td,
:root[data-theme="dark"] .simple-table td,
:root[data-theme="dark"] .task-table td,
:root[data-theme="dark"] .task-mini,
:root[data-theme="dark"] .task-summary-head {
  border-color: var(--border);
}

:root[data-theme="dark"] .secondary-btn {
  background: #1f2937;
  color: #f9fafb;
  border-color: #374151;
}

:root[data-theme="dark"] .ghost-btn,
:root[data-theme="dark"] .icon-btn,
:root[data-theme="dark"] .check-field {
  background: #111827;
  border-color: #374151;
  color: #d1d5db;
}

:root[data-theme="dark"] .notice {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

:root[data-theme="dark"] .toast-notice {
  background: #111827;
  border-color: #374151;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] .toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 1180px) {
  .meeting-workspace,
  .master-form,
  .meta-grid,
  .task-summary-grid {
    grid-template-columns: 1fr;
  }

  .review-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .toast-notice {
    top: 14px;
    right: 14px;
    left: 14px;
    width: auto;
  }
}

@media (max-width: 900px) {
  .simple-table {
    border-radius: 14px;
    overflow-x: auto;
    display: block;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .task-filters,
  .inline-field {
    width: 100%;
  }

  .multi-filter {
    min-width: 0;
  }

  .task-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .content {
    gap: 14px;
  }

  .panel-header,
  .panel-body {
    padding: 18px;
  }

  .nav-group {
    border-top: 0;
    padding: 0;
  }

  .nav-group > span {
    grid-column: 1 / -1;
    padding-top: 8px;
  }

  .task-filters {
    grid-template-columns: 1fr;
  }

  .report-table-wrap {
    border-radius: 14px;
  }
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  min-height: var(--control-height);
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 700;
}

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

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

.secondary-btn {
  background: #f3f4f6;
  color: var(--text);
  border: 1px solid var(--border);
}

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

.danger-btn {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

@media (min-width: 761px) {
  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 30;
  }

  .main {
    margin-left: 240px;
    min-height: 100vh;
  }
}

@media (max-width: 760px) {
  .main {
    margin-left: 0;
  }
}
