:root {
  color-scheme: dark;
  --color-bg: #111826;
  --color-bg-soft: #151F2E;
  --color-surface: #111826;
  --color-surface-dim: #0F1723;
  --color-surface-container-lowest: #192333;
  --color-surface-container-low: #162130;
  --color-surface-container: #1B2637;
  --color-surface-container-high: #223044;
  --color-surface-container-highest: #2B3A51;
  --color-surface-muted: #253449;
  --color-surface-info: #0B3C49;
  --color-surface-info-alt: #0A4450;
  --color-surface-danger: #44212A;
  --color-surface-success: #123D32;
  --color-on-primary: #FFFFFF;
  --color-on-primary-container: #FFFFFF;
  --color-text: #F8FBFF;
  --color-text-soft: #C8D4E7;
  --color-text-muted: #8FA3BF;
  --color-primary: #1CC7AE;
  --color-primary-strong: #11A892;
  --color-secondary: #334155;
  --color-tertiary: #3B82F6;
  --color-danger: #EF4444;
  --color-info: #38BDF8;
  --color-success: #22C55E;
  --color-warning: #F59E0B;
  --color-purple: #A855F7;
  --color-border: #2C3A50;
  --color-border-soft: #263448;
  --sidebar-bg: #162130;
  --sidebar-bg-soft: #1D2A3D;
  --sidebar-border: #263448;
  --sidebar-text: #8EA4C2;
  --sidebar-text-strong: #FFFFFF;
  --state-hover: rgba(28, 199, 174, 0.1);
  --state-focus: rgba(28, 199, 174, 0.25);
  --state-pressed: rgba(28, 199, 174, 0.18);
  --login-accent: rgba(28, 199, 174, 0.16);
  --shadow-sm: 0 14px 30px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 18px 42px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.35);
  --motion-standard: 180ms ease;
  --sidebar-width: 315px;
  --sidebar-collapsed-width: 80px;
}

body[data-theme="light"] {
  color-scheme: light;
  --color-bg: #F4F7FB;
  --color-bg-soft: #EEF3F8;
  --color-surface: #F4F7FB;
  --color-surface-dim: #E7EEF7;
  --color-surface-container-lowest: #FFFFFF;
  --color-surface-container-low: #F8FBFE;
  --color-surface-container: #F1F6FB;
  --color-surface-container-high: #E8F0F8;
  --color-surface-container-highest: #DDE8F3;
  --color-surface-muted: #DCE7F2;
  --color-surface-info: #E0F7FA;
  --color-surface-info-alt: #D7F3F8;
  --color-surface-danger: #FEE7EA;
  --color-surface-success: #DCFCE7;
  --color-on-primary: #FFFFFF;
  --color-on-primary-container: #073B36;
  --color-text: #0F172A;
  --color-text-soft: #334155;
  --color-text-muted: #64748B;
  --color-primary: #0F9F8B;
  --color-primary-strong: #0B806F;
  --color-secondary: #CBD5E1;
  --color-tertiary: #2563EB;
  --color-danger: #DC2626;
  --color-info: #0284C7;
  --color-success: #16A34A;
  --color-warning: #D97706;
  --color-purple: #9333EA;
  --color-border: #CBD5E1;
  --color-border-soft: #DDE7F2;
  --sidebar-bg: #FFFFFF;
  --sidebar-bg-soft: #EAF5F3;
  --sidebar-border: #DDE7F2;
  --sidebar-text: #52647A;
  --sidebar-text-strong: #0F172A;
  --state-hover: rgba(15, 159, 139, 0.09);
  --state-focus: rgba(15, 159, 139, 0.18);
  --state-pressed: rgba(15, 159, 139, 0.14);
  --login-accent: rgba(15, 159, 139, 0.13);
  --shadow-sm: 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 18px 38px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(28, 199, 174, 0.2), transparent 34%),
    linear-gradient(135deg, #0D1522, var(--color-surface));
}

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-container-lowest);
  box-shadow: var(--shadow-lg);
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
}

.muted {
  color: var(--color-text-muted);
}

.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--color-text-soft);
  font-size: 12px;
  font-weight: 500;
}

input,
select,
textarea {
  min-height: 40px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #121B28;
  color: var(--color-text);
  outline: none;
  transition: background-color var(--motion-standard), border-color var(--motion-standard), box-shadow var(--motion-standard);
}

textarea {
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  background: #152235;
  border-color: #3A4E69;
}

input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  accent-color: var(--color-primary);
}

select[multiple] {
  min-height: 96px;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
  color-scheme: dark;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--state-focus);
  outline: none;
}

input.is-valid,
select.is-valid,
textarea.is-valid {
  border-color: var(--color-success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}

.message {
  min-height: 20px;
  margin: 0;
  color: var(--color-text-muted);
}

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

.storage-warning {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-text);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #172235;
  color: var(--color-text-soft);
  font-weight: 700;
  transition: color var(--motion-standard), background-color var(--motion-standard), border-color var(--motion-standard), box-shadow var(--motion-standard);
}

.btn:hover {
  border-color: var(--color-primary);
  background: #1A2B3E;
  color: var(--color-primary);
}

.btn:active {
  background: var(--state-pressed);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

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

.btn-primary:hover {
  background: var(--color-primary-strong);
  border-color: var(--color-primary-strong);
  color: var(--color-on-primary);
}

.btn-secondary {
  border-color: var(--color-border);
  background: #1C293B;
  color: #DCE8FA;
}

.btn-secondary:hover {
  border-color: #3A4E69;
  background: #22334A;
  color: #FFFFFF;
}

.btn-danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #FCA5A5;
}

.btn-danger:hover {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.2);
  color: #FFFFFF;
}

.btn-icon {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.app-view {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns var(--motion-standard);
}

.app-view.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 0;
  overflow: hidden;
  padding: 0;
  height: 100vh;
  border-right: 0;
  background: var(--sidebar-bg);
  box-shadow: inset -1px 0 var(--sidebar-border);
  transition: background-color var(--motion-standard), padding var(--motion-standard);
}

.sidebar-header {
  display: grid;
  align-items: center;
  gap: 18px;
  padding: 6px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand {
  display: inline-grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 58px;
  padding: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--sidebar-text-strong);
  transition: background-color var(--motion-standard), border-radius var(--motion-standard), padding var(--motion-standard), width var(--motion-standard);
}

.brand-mark {
  border: 0;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--color-surface-container-lowest);
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  transition: background-color var(--motion-standard), box-shadow var(--motion-standard);
}

.brand-mark img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.brand-copy,
.nav-label {
  overflow: hidden;
  white-space: nowrap;
  transition: color var(--motion-standard), opacity var(--motion-standard), width var(--motion-standard);
}

.brand strong,
.brand span,
.brand small {
  display: block;
}

.brand strong {
  overflow: hidden;
  font-size: 15px;
  line-height: 18px;
  text-overflow: ellipsis;
}

.brand span,
.brand small {
  color: var(--sidebar-text);
  font-size: 11px;
  line-height: 15px;
}

.brand small {
  color: var(--sidebar-text-muted);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sidebar-text);
  transition: background-color var(--motion-standard), border-color var(--motion-standard), color var(--motion-standard);
}

.sidebar-menu-button {
  justify-self: start;
  margin-left: 0;
  font-size: 21px;
}

.icon-button:hover {
  background: var(--sidebar-bg-soft);
  color: var(--sidebar-text-strong);
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 3px;
  overflow: auto;
  padding: 18px 14px;
}

.nav-section {
  margin: 16px 10px 6px;
  color: #5F7695;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 16px;
  text-transform: uppercase;
}

.nav-section:first-child {
  margin-top: 4px;
}

.nav-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-text);
  text-align: left;
  transition: background-color var(--motion-standard), border-radius var(--motion-standard), color var(--motion-standard), grid-template-columns var(--motion-standard), padding var(--motion-standard);
}

.nav-item i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border-radius: 8px;
  font-size: 17px;
  transition: background-color var(--motion-standard), color var(--motion-standard), width var(--motion-standard);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--sidebar-text-strong);
}

.nav-item.active {
  background: rgba(28, 199, 174, 0.09);
  color: var(--sidebar-text-strong);
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.nav-item.active {
  font-weight: 600;
}

.sidebar-footer {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-border);
  background: rgba(0, 0, 0, 0.08);
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #FFFFFF;
  font-weight: 800;
}

.sidebar-footer strong,
.sidebar-footer span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer span {
  color: var(--sidebar-text);
  font-size: 12px;
}

.app-view.sidebar-collapsed .brand-copy {
  width: 0;
  height: 0;
  opacity: 0;
}

.app-view.sidebar-collapsed .nav-section {
  width: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
}

.app-view.sidebar-collapsed .sidebar {
  padding: 0;
  background: var(--sidebar-bg);
  box-shadow: inset -1px 0 var(--sidebar-border);
}

.app-view.sidebar-collapsed .sidebar-header {
  justify-items: center;
  gap: 0;
  padding: 6px 0;
}

.app-view.sidebar-collapsed .brand {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: center;
  gap: 0;
  width: 58px;
  min-height: 58px;
  padding: 0;
  border-radius: 50%;
}

.app-view.sidebar-collapsed .brand-mark {
  width: 58px;
  height: 58px;
}

.app-view.sidebar-collapsed .sidebar-menu-button {
  justify-self: center;
  margin-left: 0;
}

.app-view.sidebar-collapsed .icon-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--sidebar-text);
}

.app-view.sidebar-collapsed .brand-mark:hover,
.app-view.sidebar-collapsed .icon-button:hover {
  background: var(--sidebar-bg-soft);
}

.app-view.sidebar-collapsed .nav-item {
  position: relative;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
  width: 100%;
  min-height: 46px;
  padding: 8px 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}

.app-view.sidebar-collapsed .nav-item i {
  width: 38px;
  height: 34px;
  border-radius: 8px;
  color: #6F8199;
  font-size: 18px;
}

.app-view.sidebar-collapsed .nav-item::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 0;
  width: 3px;
  height: 28px;
  border-radius: 999px 0 0 999px;
  background: transparent;
  transition: background-color var(--motion-standard);
}

.app-view.sidebar-collapsed .nav-item.active i {
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-text-strong);
}

.app-view.sidebar-collapsed .nav-item:hover {
  background: transparent;
  color: var(--sidebar-text-strong);
  box-shadow: none;
}

.app-view.sidebar-collapsed .nav-item.active {
  background: transparent;
  color: var(--sidebar-text-strong);
  box-shadow: none;
}

.app-view.sidebar-collapsed .nav-item.active::after {
  background: #FFFFFF;
}

.app-view.sidebar-collapsed .nav-item:hover i {
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-text-strong);
}

.app-view.sidebar-collapsed .nav-label {
  width: 0;
  opacity: 0;
  color: var(--sidebar-text);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}

.app-view.sidebar-collapsed .sidebar-footer {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 72px;
  padding: 12px 0 16px;
}

.main-panel {
  min-width: 0;
  padding: 28px 30px;
  background: var(--color-bg);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(240px, 420px) auto auto;
  align-items: center;
  gap: 20px;
  margin: -28px -30px 24px;
  padding: 14px 30px;
  border-bottom: 1px solid var(--color-border-soft);
  background: #121B28;
  box-shadow: none;
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-left .sidebar-menu-button {
  color: var(--color-text-soft);
}

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

.topbar-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: #0F1724;
  color: var(--color-text-muted);
}

.topbar-search input {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.topbar-search input:focus-visible {
  box-shadow: none;
}

.topbar-search span {
  padding: 1px 6px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 18px;
}

.btn-docs {
  min-height: 40px;
  border-color: rgba(28, 199, 174, 0.28);
  background: rgba(28, 199, 174, 0.08);
  color: var(--color-primary);
}

.btn-docs:hover {
  border-color: rgba(28, 199, 174, 0.44);
  background: rgba(28, 199, 174, 0.14);
  color: #7FFAE8;
}

.notification-anchor {
  position: relative;
}

.notification-button {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: min(430px, calc(100vw - 32px));
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #121B28;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.notification-header,
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--color-border-soft);
}

.notification-header {
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.notification-header strong {
  font-size: 16px;
}

.notification-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notification-list {
  display: grid;
}

.notification-item {
  width: 100%;
  border-inline: 0;
  border-top: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.notification-item:not(.read) {
  background: linear-gradient(90deg, rgba(28, 199, 174, 0.08), transparent 52%);
}

.notification-item:not(.read)::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-top: 11px;
  border-radius: 999px;
  background: var(--color-primary);
}

.notification-item:hover,
.notification-item:focus-visible {
  background: rgba(255, 255, 255, 0.035);
}

.notification-item.read {
  opacity: 0.64;
}

.notification-item i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: rgba(28, 199, 174, 0.12);
  color: var(--color-primary);
}

.notification-item.danger i {
  background: rgba(239, 68, 68, 0.14);
  color: #FCA5A5;
}

.notification-item.warning i {
  background: rgba(245, 158, 11, 0.14);
  color: #FCD34D;
}

.notification-item strong,
.notification-item span {
  display: block;
}

.notification-copy {
  display: grid !important;
  gap: 5px;
  min-width: 0;
}

.notification-title-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.notification-title-row strong {
  overflow: hidden;
  color: var(--color-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-item .notification-message {
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 18px;
}

.notification-meta {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 11px;
}

.notification-meta span + span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 8px 2px 0;
  border-radius: 999px;
  background: var(--color-text-muted);
}

.notification-type {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(28, 199, 174, 0.12);
  color: var(--color-primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 16px;
  text-transform: uppercase;
}

.notification-type.warning {
  background: rgba(245, 158, 11, 0.14);
  color: #FCD34D;
}

.notification-type.danger {
  background: rgba(239, 68, 68, 0.14);
  color: #FCA5A5;
}

.notification-type.success {
  background: rgba(34, 197, 94, 0.14);
  color: #86EFAC;
}

.help-panel {
  width: min(520px, 100vw);
}

body[data-theme="light"] .login-view {
  background:
    radial-gradient(circle at top left, rgba(15, 159, 139, 0.16), transparent 34%),
    linear-gradient(135deg, #EAF5F3, var(--color-surface));
}

body[data-theme="light"] input,
body[data-theme="light"] select,
body[data-theme="light"] textarea,
body[data-theme="light"] .topbar-search,
body[data-theme="light"] .filter-bar input,
body[data-theme="light"] .filter-bar select {
  background: #FFFFFF;
}

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

body[data-theme="light"] input:hover,
body[data-theme="light"] select:hover,
body[data-theme="light"] textarea:hover {
  background: #F8FBFE;
}

body[data-theme="light"] .btn-secondary,
body[data-theme="light"] .subtask-row,
body[data-theme="light"] .detail-grid div,
body[data-theme="light"] .detail-item,
body[data-theme="light"] .status-tagging,
body[data-theme="light"] .activity-item-section,
body[data-theme="light"] .activity-item-form,
body[data-theme="light"] .activity-item-card,
body[data-theme="light"] .workflow-card,
body[data-theme="light"] .settings-toggle,
body[data-theme="light"] .involvement-card,
body[data-theme="light"] .notification-panel {
  background: #FFFFFF;
}

body[data-theme="light"] .person-chip {
  background: #F8FBFE;
}

body[data-theme="light"] .topbar,
body[data-theme="light"] .detail-header,
body[data-theme="light"] .chart-body,
body[data-theme="light"] .calendar-weekdays,
body[data-theme="light"] th,
body[data-theme="light"] .subtask-table-row,
body[data-theme="light"] .detail-panel {
  background: var(--color-surface-container-lowest);
}

body[data-theme="light"] .calendar-day {
  background: rgba(255, 255, 255, 0.78);
}

body[data-theme="light"] .calendar-day.outside {
  background: rgba(241, 246, 251, 0.82);
}

body[data-theme="light"] tbody tr:hover,
body[data-theme="light"] .notification-item:hover,
body[data-theme="light"] .notification-item:focus-visible {
  background: rgba(15, 159, 139, 0.055);
}

body[data-theme="light"] .notification-item:not(.read) {
  background: linear-gradient(90deg, rgba(15, 159, 139, 0.08), transparent 52%);
}

body[data-theme="light"] .settings-card:hover,
body[data-theme="light"] .settings-card:focus-visible {
  background: #F1FBF8;
}

body[data-theme="light"] .sidebar-footer {
  background: rgba(15, 23, 42, 0.025);
}

body[data-theme="light"] .app-view.sidebar-collapsed .nav-item.active::after {
  background: var(--color-primary);
}

body[data-theme="light"] .notification-panel {
  box-shadow: var(--shadow-lg);
}

body[data-theme="light"] .notification-type.warning {
  color: #92400E;
}

body[data-theme="light"] .notification-type.danger {
  color: #B91C1C;
}

body[data-theme="light"] .notification-type.success {
  color: #166534;
}

body[data-theme="light"] .btn {
  background: #FFFFFF;
  color: var(--color-text-soft);
}

body[data-theme="light"] .btn:hover {
  background: #F1F6FB;
  color: var(--color-primary-strong);
}

body[data-theme="light"] .btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

body[data-theme="light"] .btn-primary:hover {
  background: var(--color-primary-strong);
  color: var(--color-on-primary);
}

body[data-theme="light"] .btn-secondary {
  background: #FFFFFF;
  color: #243449;
}

body[data-theme="light"] .btn-secondary:hover {
  background: #EDF4FB;
  color: #0F172A;
}

body[data-theme="light"] .nav-section {
  color: #526988;
}

body[data-theme="light"] .nav-item:hover,
body[data-theme="light"] .app-view.sidebar-collapsed .nav-item:hover i {
  background: rgba(15, 159, 139, 0.08);
  color: var(--sidebar-text-strong);
}

body[data-theme="light"] .nav-item.active {
  background: #E8F7F4;
  color: var(--sidebar-text-strong);
}

body[data-theme="light"] .app-view.sidebar-collapsed .nav-item.active i {
  background: #E8F7F4;
  color: var(--sidebar-text-strong);
}

body[data-theme="light"] .calendar-task {
  border-color: rgba(15, 159, 139, 0.28);
  background: #DDF7F2;
  color: #075E53;
}

body[data-theme="light"] .calendar-task.in_progress {
  border-color: rgba(2, 132, 199, 0.28);
  background: #E0F2FE;
  color: #075985;
}

body[data-theme="light"] .calendar-task.partially_submitted {
  border-color: rgba(217, 119, 6, 0.28);
  background: #FEF3C7;
  color: #92400E;
}

body[data-theme="light"] .calendar-task.completed {
  border-color: rgba(22, 163, 74, 0.28);
  background: #DCFCE7;
  color: #166534;
}

body[data-theme="light"] .calendar-task.cancelled {
  border-color: rgba(100, 116, 139, 0.24);
  background: #E2E8F0;
  color: #475569;
}

body[data-theme="light"] .calendar-task:hover {
  border-color: rgba(15, 159, 139, 0.48);
  background: #C9F2EA;
  color: #064E45;
}

body[data-theme="light"] .calendar-popover {
  background: #FFFFFF;
}

body[data-theme="light"] .filter-bar {
  background: #F1F6FB;
}

body[data-theme="light"] .filter-bar label {
  color: #334155;
}

body[data-theme="light"] th {
  background: #F8FBFE;
  color: #526988;
}

body[data-theme="light"] tbody tr:hover {
  background: #F6FBFA;
}

body[data-theme="light"] .subtask-table-row {
  background: #F8FBFE;
}

body[data-theme="light"] .tree-toggle {
  background: #FFFFFF;
  color: #243449;
}

body[data-theme="light"] .tree-toggle:not(:disabled):hover {
  background: var(--color-primary);
  color: #FFFFFF;
}

body[data-theme="light"] .subtask-table-row .tree-toggle:disabled {
  background: #F1F6FB;
}

body[data-theme="light"] .badge.assigned,
body[data-theme="light"] .badge.pending,
body[data-theme="light"] .badge.for_distribution,
body[data-theme="light"] .badge.user {
  background: #E8EEF6;
  color: #475569;
}

body[data-theme="light"] .badge.in_progress,
body[data-theme="light"] .badge.distributed,
body[data-theme="light"] .badge.for_callback,
body[data-theme="light"] .badge.supervisor {
  background: #E0F2FE;
  color: #075985;
}

body[data-theme="light"] .badge.task {
  background: #DBEAFE;
  color: #1D4ED8;
}

body[data-theme="light"] .badge.activity,
body[data-theme="light"] .badge.admin {
  background: #DDF7F2;
  color: #075E53;
}

body[data-theme="light"] .badge.low,
body[data-theme="light"] .badge.completed,
body[data-theme="light"] .badge.before_due_date,
body[data-theme="light"] .badge.on_time,
body[data-theme="light"] .badge.collected,
body[data-theme="light"] .badge.closed {
  background: #DCFCE7;
  color: #166534;
}

body[data-theme="light"] .badge.medium,
body[data-theme="light"] .badge.partially_submitted,
body[data-theme="light"] .badge.for_follow_up {
  background: #FEF3C7;
  color: #92400E;
}

body[data-theme="light"] .badge.high,
body[data-theme="light"] .badge.cancelled,
body[data-theme="light"] .badge.late,
body[data-theme="light"] .badge.refused {
  background: #FEE2E2;
  color: #991B1B;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin: 0;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.user-menu strong,
.user-menu span {
  display: block;
  text-align: right;
}

.user-menu span {
  color: var(--color-text-muted);
  font-size: 11px;
}

.warning-banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--color-warning);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-text);
}

.settings-intro {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.settings-card {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-container-lowest);
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--motion-standard),
    background-color var(--motion-standard),
    transform var(--motion-standard);
}

.settings-card:hover,
.settings-card:focus-visible {
  border-color: rgba(28, 199, 174, 0.6);
  background: var(--color-surface-container);
}

.settings-card:active {
  transform: translateY(1px);
}

.settings-card i {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(28, 199, 174, 0.12);
  color: var(--color-primary);
  font-size: 18px;
}

.settings-card strong,
.settings-card span {
  display: block;
}

.settings-card strong {
  margin-bottom: 4px;
}

.settings-card span {
  color: var(--color-text-muted);
}

.settings-section + .settings-section {
  margin-top: 20px;
}

.settings-workspace {
  align-items: start;
}

.settings-side-stack {
  display: grid;
  gap: 16px;
}

.settings-action-grid {
  display: grid;
  gap: 10px;
}

.settings-action-grid .btn {
  justify-content: flex-start;
}

.automation-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.automation-summary > div {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: var(--color-surface-container-low);
}

.automation-summary span {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.automation-summary strong {
  color: var(--color-text);
}

.settings-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: var(--color-surface-container-low);
}

.settings-toggle.compact {
  padding: 10px;
}

.settings-toggle input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-primary);
}

.settings-toggle strong,
.settings-toggle small {
  display: block;
}

.settings-toggle small {
  color: var(--color-text-muted);
}

.email-preferences {
  display: grid;
  gap: 10px;
}

.email-preference-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.workflow-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: var(--color-surface-container-low);
}

.template-builder-grid {
  align-items: start;
}

.template-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.template-list-header h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.template-node-list {
  gap: 10px;
}

.template-node-fields {
  grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1.1fr);
}

.workflow-card.inactive {
  opacity: 0.72;
}

.workflow-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.workflow-card-header strong,
.workflow-card-header span {
  display: block;
}

.workflow-card-header > div:first-child span,
.workflow-name {
  color: var(--color-text-muted);
  font-size: 12px;
}

.workflow-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workflow-status-list span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(143, 163, 191, 0.22);
  border-radius: 999px;
  background: rgba(143, 163, 191, 0.1);
  color: var(--color-text-soft);
  font-size: 12px;
  font-weight: 700;
}

.workflow-status-list span.terminal {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.12);
  color: #86EFAC;
}

.density-compact th,
.density-compact td {
  padding: 8px 10px;
}

.density-compact .detail-item,
.density-compact .activity-item-card,
.density-compact .subtask-row {
  padding: 10px;
}

.activity-timeline {
  display: grid;
  gap: 0;
}

.activity-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border-soft);
}

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

.activity-item > i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(28, 199, 174, 0.12);
  color: var(--color-primary);
}

.activity-item.user > i {
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-tertiary);
}

.activity-item strong,
.activity-item span {
  display: block;
}

.activity-item span {
  color: var(--color-text-muted);
}

.activity-item p {
  margin: 6px 0 0;
}

.activity-actions {
  display: flex;
  justify-content: flex-end;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.metric-card,
.content-panel {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-container-lowest);
  box-shadow: none;
}

.metric-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value";
  align-items: center;
  column-gap: 14px;
  min-height: 108px;
  padding: 16px;
  overflow: hidden;
  background: var(--color-surface-container-lowest);
  color: var(--color-text);
}

.metric-card::before,
.metric-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.metric-card::before {
  inset: auto 14px 16px auto;
  width: 66px;
  height: 34px;
  border-bottom: 6px solid rgba(28, 199, 174, 0.42);
  border-radius: 50%;
  opacity: 0.8;
}

.metric-card::after {
  inset: auto 16px 25px auto;
  width: 70px;
  height: 34px;
  background: repeating-linear-gradient(
    90deg,
    rgba(28, 199, 174, 0.56) 0 4px,
    transparent 4px 9px
  );
  mask-image: linear-gradient(to top, #000 55%, transparent 100%);
  opacity: 0.5;
}

.metric-card:nth-child(2)::before {
  border-color: rgba(59, 130, 246, 0.42);
}

.metric-card:nth-child(3)::before {
  border-color: rgba(245, 158, 11, 0.42);
}

.metric-card:nth-child(4)::before {
  border-color: rgba(34, 197, 94, 0.42);
}

.metric-card.danger::before {
  border-color: rgba(239, 68, 68, 0.42);
}

.metric-card:nth-child(2)::after {
  background: repeating-linear-gradient(90deg, rgba(59, 130, 246, 0.58) 0 4px, transparent 4px 9px);
}

.metric-card:nth-child(3)::after {
  background: repeating-linear-gradient(90deg, rgba(245, 158, 11, 0.58) 0 4px, transparent 4px 9px);
}

.metric-card:nth-child(4)::after {
  background: repeating-linear-gradient(90deg, rgba(34, 197, 94, 0.58) 0 4px, transparent 4px 9px);
}

.metric-card.danger::after {
  background: repeating-linear-gradient(90deg, rgba(239, 68, 68, 0.58) 0 4px, transparent 4px 9px);
}

.metric-card i {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(28, 199, 174, 0.12);
  color: var(--color-primary);
  font-size: 20px;
}

.metric-card:nth-child(2) i {
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-tertiary);
}

.metric-card:nth-child(3) i {
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-warning);
}

.metric-card:nth-child(4) i {
  background: rgba(34, 197, 94, 0.12);
  color: var(--color-success);
}

.metric-card.danger i {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-danger);
}

.metric-card span {
  grid-area: label;
  display: block;
  margin: 0 0 2px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.metric-card strong {
  grid-area: value;
  font-size: 28px;
  line-height: 32px;
  font-weight: 700;
  color: var(--color-text);
}

.metric-card.danger strong {
  color: var(--color-text);
}

.content-panel {
  overflow: hidden;
  background: var(--color-surface-container-lowest);
}

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

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

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

.report-wide-panel {
  grid-column: 1 / -1;
}

.involvement-panel {
  grid-column: 1 / -1;
}

.involvement-filters {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border-soft);
}

.involvement-search-field {
  grid-column: span 3;
}

.involvement-results {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-top: 1px solid var(--color-border-soft);
}

.involvement-results-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.involvement-results-header h3 {
  margin: 0 0 4px;
}

.involvement-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  border-top: 1px solid var(--color-border-soft);
}

.involvement-grid h3 {
  margin: 0 0 10px;
}

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

.involvement-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: #142033;
}

.involvement-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.involvement-card-title {
  border: 0;
  padding: 0;
  color: var(--color-primary);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.involvement-card-title:hover,
.involvement-card-title:focus-visible {
  color: #4DE1D0;
}

.involvement-meta,
.involvement-people {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--color-border-soft);
  border-radius: 999px;
  color: var(--color-text-soft);
  background: #101928;
  font-size: 0.85rem;
  font-weight: 700;
}

.person-chip i {
  color: var(--color-primary);
}

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

.chart-body {
  min-height: 180px;
  padding: 18px 20px;
}

.chart-empty {
  margin: 0;
  color: var(--color-text-muted);
}

.donut-chart {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border-radius: 999px;
  background: var(--color-surface-container-high);
}

.donut::after {
  content: "";
  position: absolute;
  width: 82px;
  height: 82px;
  border-radius: inherit;
  background: var(--color-surface-container-lowest);
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center strong,
.donut-center span,
.legend-item strong,
.legend-item em {
  display: block;
}

.donut-center strong {
  font-size: 26px;
  line-height: 28px;
}

.donut-center span,
.legend-item em {
  color: var(--color-text-muted);
  font-size: 12px;
  font-style: normal;
}

.chart-legend {
  display: grid;
  gap: 8px;
}

.legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.legend-item > span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--legend-color);
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.8fr) minmax(120px, 1.4fr) auto;
  align-items: center;
  gap: 12px;
}

.bar-row > span {
  overflow: hidden;
  color: var(--color-text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row > strong {
  min-width: 42px;
  text-align: right;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #111A27;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.column-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  min-height: 180px;
}

.column-item {
  display: grid;
  grid-template-rows: auto minmax(96px, 1fr) auto;
  align-items: end;
  gap: 8px;
  min-width: 0;
  text-align: center;
}

.column-item i {
  display: block;
  width: 100%;
  min-height: 8px;
  border-radius: 8px 8px 2px 2px;
  opacity: 0.9;
}

.column-item strong {
  color: var(--color-text);
}

.column-item span {
  color: var(--color-text-muted);
  font-size: 12px;
}

.calendar-panel {
  margin-bottom: 18px;
}

.calendar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  border-top: 1px solid var(--color-border-soft);
  border-bottom: 1px solid var(--color-border-soft);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.calendar-weekdays span {
  padding: 10px 12px;
}

.calendar-grid {
  grid-auto-rows: minmax(118px, 1fr);
  min-height: 708px;
}

.calendar-day {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--color-border-soft);
  border-bottom: 1px solid var(--color-border-soft);
  background: rgba(15, 23, 36, 0.36);
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.outside {
  background: rgba(15, 23, 36, 0.18);
  color: var(--color-text-muted);
}

.calendar-day.today {
  box-shadow: inset 0 0 0 1px rgba(28, 199, 174, 0.5);
}

.calendar-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-day-heading strong {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
}

.calendar-day.today .calendar-day-heading strong {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.calendar-task-list {
  display: grid;
  align-content: start;
  gap: 5px;
  overflow: hidden;
  min-width: 0;
}

.calendar-task {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid rgba(28, 199, 174, 0.2);
  border-radius: 5px;
  background: rgba(28, 199, 174, 0.14);
  color: #9FFCF0;
  font-size: 12px;
  line-height: 16px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-task.in_progress {
  border-color: rgba(56, 189, 248, 0.24);
  background: rgba(56, 189, 248, 0.14);
  color: #BAE6FD;
}

.calendar-task.partially_submitted {
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.14);
  color: #FCD34D;
}

.calendar-task.completed {
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(34, 197, 94, 0.14);
  color: #BBF7D0;
}

.calendar-task.cancelled {
  border-color: rgba(143, 163, 191, 0.22);
  background: rgba(143, 163, 191, 0.12);
  color: var(--color-text-muted);
}

.calendar-task:hover {
  border-color: rgba(28, 199, 174, 0.48);
  color: #FFFFFF;
}

.calendar-more {
  width: fit-content;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 18px;
  text-align: left;
}

.calendar-more:hover,
.calendar-more[aria-expanded="true"] {
  color: var(--color-primary);
}

.calendar-popover {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 6;
  display: grid;
  gap: 8px;
  width: min(280px, calc(100% - 16px));
  max-height: 260px;
  padding: 10px;
  border: 1px solid rgba(28, 199, 174, 0.35);
  border-radius: 8px;
  background: #111A27;
  box-shadow: var(--shadow-lg);
}

.calendar-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-popover-header strong {
  color: var(--color-text);
  font-size: 13px;
}

.calendar-popover-close {
  width: 28px;
  height: 28px;
  min-height: 28px;
}

.calendar-popover-list {
  display: grid;
  gap: 6px;
  overflow: auto;
}

.due-list {
  display: grid;
}

.due-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--color-border-soft);
}

.due-item:first-child {
  border-top: 0;
}

.due-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.due-item span:not(.badge) {
  color: var(--color-text-muted);
  font-size: 12px;
}

.report-rate {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 116px;
}

.report-rate span {
  position: relative;
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-surface-container-high);
}

.report-rate span::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--rate);
  border-radius: inherit;
  background: var(--color-primary);
}

.report-rate strong {
  font-size: 12px;
  font-weight: 700;
}

.report-item-title {
  display: block;
}

.report-item-meta {
  display: block;
  margin-top: 4px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.report-wide-panel table {
  min-width: 1120px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border-soft);
  background: var(--color-surface-container-lowest);
}

.panel-header p {
  margin-bottom: 0;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  align-items: end;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-soft);
  background: #162130;
}

.filter-bar label {
  gap: 6px;
}

.filter-bar input,
.filter-bar select {
  min-height: 34px;
  background: #111A27;
}

.search-field {
  min-width: 0;
  grid-column: span 2;
}

.filter-clear {
  min-height: 36px;
  white-space: nowrap;
}

.panel-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

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

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.subtask-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.subtask-list {
  display: grid;
  gap: 12px;
}

.subtask-row {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: #142033;
}

.subtask-row-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subtask-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.subtask-row-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
}

.subtask-children {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  border-left: 1px solid rgba(143, 163, 191, 0.24);
}

.subtask-children:empty {
  display: none;
}

.subtask-children .subtask-row {
  background: rgba(20, 32, 51, 0.72);
}

body[data-theme="light"] .subtask-children {
  border-left-color: rgba(100, 116, 139, 0.26);
}

body[data-theme="light"] .subtask-children .subtask-row {
  background: #F8FBFE;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface-container-lowest);
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #151F2E;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

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

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

.task-table th:nth-child(6),
.task-table td:nth-child(6) {
  width: 10%;
}

.task-table th:nth-child(7),
.task-table td:nth-child(7) {
  width: 12%;
}

.task-table th:nth-child(8),
.task-table td:nth-child(8) {
  width: 10%;
}

tbody tr {
  transition: background-color var(--motion-standard);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

td strong,
td span {
  display: block;
}

td span {
  color: var(--color-text-muted);
}

.task-title-cell {
  position: relative;
  min-width: 220px;
}

.date-cell,
.count-cell,
.action-cell {
  white-space: nowrap;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-button {
  display: inline-block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font-weight: 700;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-button:hover {
  color: var(--color-primary-strong);
}

.task-tree-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  padding-left: calc(var(--tree-depth) * 24px);
  min-width: 0;
}

.tree-toggle {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
  background: #111A27;
  color: var(--color-text-soft);
  font-weight: 600;
}

.tree-toggle:not(:disabled):hover {
  background: var(--color-primary);
  color: #FFFFFF;
}

.tree-toggle:disabled {
  border-color: transparent;
  background: transparent;
  cursor: default;
}

.subtask-table-row {
  background: #162130;
}

.has-tree-branch .task-title-cell::before,
.has-tree-branch .task-title-cell::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.has-tree-branch .task-title-cell::before {
  top: 0;
  bottom: 0;
  left: calc(14px + (var(--tree-depth) - 1) * 24px + 12px);
  width: 1px;
  background: rgba(143, 163, 191, 0.26);
}

.has-tree-branch .task-title-cell::after {
  top: 50%;
  left: calc(14px + (var(--tree-depth) - 1) * 24px + 12px);
  width: 28px;
  height: 1px;
  background: rgba(143, 163, 191, 0.32);
}

.subtask-table-row .tree-toggle:disabled {
  border-color: rgba(143, 163, 191, 0.18);
  background: #111A27;
}

.badge {
  display: inline-block;
  min-width: 76px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.badge.assigned,
.badge.pending {
  background: rgba(143, 163, 191, 0.16);
  color: #B9C7DA;
}

.badge.in_progress {
  background: rgba(56, 189, 248, 0.16);
  color: #7DD3FC;
}

.badge.distributed,
.badge.for_callback {
  background: rgba(56, 189, 248, 0.16);
  color: #7DD3FC;
}

.badge.for_distribution {
  background: rgba(143, 163, 191, 0.16);
  color: #B9C7DA;
}

.badge.for_follow_up {
  background: rgba(245, 158, 11, 0.16);
  color: #FBBF24;
}

.badge.task {
  background: rgba(59, 130, 246, 0.16);
  color: #93C5FD;
}

.badge.activity {
  background: rgba(28, 199, 174, 0.16);
  color: #7FFAE8;
}

.badge.low {
  background: rgba(34, 197, 94, 0.14);
  color: #86EFAC;
}

.badge.medium {
  background: rgba(245, 158, 11, 0.16);
  color: #FBBF24;
}

.badge.high {
  background: rgba(239, 68, 68, 0.16);
  color: #FCA5A5;
}

.badge.partially_submitted {
  background: rgba(245, 158, 11, 0.16);
  color: #FBBF24;
}

.badge.completed,
.badge.before_due_date,
.badge.on_time,
.badge.collected,
.badge.closed {
  background: rgba(34, 197, 94, 0.16);
  color: #86EFAC;
}

.badge.cancelled,
.badge.late,
.badge.refused {
  background: rgba(239, 68, 68, 0.16);
  color: #FCA5A5;
}

.badge.admin {
  background: rgba(28, 199, 174, 0.16);
  color: #7FFAE8;
}

.badge.supervisor {
  background: rgba(56, 189, 248, 0.16);
  color: #7DD3FC;
}

.badge.user {
  background: rgba(143, 163, 191, 0.16);
  color: #B9C7DA;
}

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

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(520px, 100vw);
  height: 100vh;
  border-left: 1px solid var(--color-border-soft);
  background: var(--color-surface-container-lowest);
  box-shadow: var(--shadow-lg);
  animation: detail-enter var(--motion-standard);
}

@keyframes detail-enter {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--color-border-soft);
  background: var(--color-surface-container-lowest);
}

.detail-body {
  display: grid;
  align-content: start;
  gap: 16px;
  overflow: auto;
  padding: 20px;
}

.detail-section {
  display: grid;
  gap: 12px;
}

.detail-section h3 {
  margin: 0;
  font-size: 15px;
  line-height: 22.5px;
}

.detail-description {
  margin-bottom: 0;
  color: var(--color-text-soft);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
}

.detail-grid div {
  padding: 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: #142033;
}

.detail-grid dt {
  color: var(--color-text-muted);
  font-size: 11px;
}

.detail-grid dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: #142033;
}

.detail-item > span {
  color: var(--color-text-muted);
}

.subtask-detail-list {
  gap: 6px;
}

.subtask-detail-item {
  margin-left: calc(var(--detail-tree-depth) * 18px);
}

.subtask-detail-list .subtask-detail-list {
  margin-left: 18px;
  padding-left: 12px;
  border-left: 1px solid rgba(143, 163, 191, 0.24);
}

.submission-evidence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
}

.submission-evidence:hover,
.submission-evidence:focus-visible {
  color: #4DE1D0;
}

.comment-item p {
  margin: 2px 0 0;
  color: var(--color-text-soft);
}

.comment-form {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.status-tagging {
  padding: 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: #121B28;
}

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

.status-tagging-grid {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  gap: 12px;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 12, 22, 0.72);
}

.modal-panel {
  display: grid;
  gap: 16px;
  width: min(560px, 100%);
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-container-low);
  box-shadow: var(--shadow-panel);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-soft);
}

.modal-header h2 {
  margin: 0;
}

.activity-item-section {
  padding: 14px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: #121B28;
}

.activity-item-section-header {
  display: grid;
  gap: 2px;
}

.activity-item-section-header p {
  margin: 0;
}

.activity-item-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.activity-item-summary span {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: #142033;
  color: var(--color-text-muted);
  font-size: 12px;
}

.activity-item-summary strong {
  color: var(--color-text);
  font-size: 20px;
  line-height: 24px;
}

.activity-item-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: #142033;
}

.activity-item-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.activity-item-list {
  display: grid;
  gap: 8px;
}

.activity-item-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  background: #142033;
}

.activity-item-header,
.activity-item-meta,
.activity-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.activity-item-header {
  justify-content: space-between;
}

.activity-item-header strong {
  min-width: 0;
}

.activity-item-meta {
  flex-wrap: wrap;
  color: var(--color-text-muted);
}

.activity-item-meta span:not(:last-child)::after {
  content: "|";
  padding-left: 8px;
  color: #4B5E78;
}

.activity-item-dates,
.activity-item-remarks {
  margin: 0;
  color: var(--color-text-soft);
}

.activity-item-status-select {
  min-height: 32px;
  width: auto;
  min-width: 150px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.activity-item-actions {
  justify-content: flex-end;
}

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

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

  .sidebar-footer {
    display: none;
  }

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

  .topbar-left,
  .topbar-actions,
  .user-menu,
  .page-heading,
  .page-actions {
    flex-wrap: wrap;
  }

  .topbar-search {
    width: 100%;
  }

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

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

  .chart-grid,
  .reports-grid {
    grid-template-columns: 1fr;
  }

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

  .donut-chart {
    grid-template-columns: 1fr;
    justify-items: center;
  }

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

  .calendar-weekdays,
  .calendar-grid {
    min-width: 760px;
  }

  .calendar-panel {
    overflow-x: auto;
  }

  .settings-intro {
    grid-template-columns: 1fr;
  }

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

  .involvement-search-field {
    grid-column: 1 / -1;
  }

  .filter-clear {
    justify-self: start;
  }

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

  .activity-item-summary,
  .activity-item-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 640px) {
  .login-view,
  .main-panel {
    padding: 16px;
  }

  .login-panel {
    padding: 24px;
  }

  .panel-header,
  .user-menu {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    margin: -16px -16px 20px;
    padding: 14px 16px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .page-actions,
  .page-actions .btn {
    width: 100%;
  }

  .user-menu span,
  .user-menu strong {
    text-align: left;
  }

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

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bar-row > strong {
    text-align: left;
  }

  .column-chart {
    gap: 8px;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 680px;
  }

  .calendar-day {
    min-height: 92px;
    padding: 8px;
  }

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

  .filter-bar {
    grid-template-columns: 1fr;
  }

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

  .email-preference-grid {
    grid-template-columns: 1fr;
  }

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

  .status-tagging-grid {
    grid-template-columns: 1fr;
  }

  .activity-item-summary,
  .activity-item-form-grid {
    grid-template-columns: 1fr;
  }

  .activity-item-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  body {
    background: #FFFFFF;
    color: #111827;
  }

  .login-view,
  .sidebar,
  .topbar,
  .page-actions,
  .no-print,
  .detail-panel,
  .modal-backdrop,
  .help-panel,
  .notification-panel,
  #warningBanner,
  #dashboardScreen,
  #trackerScreen,
  #calendarScreen,
  #settingsScreen,
  #usersScreen,
  #tasksScreen,
  #activityScreen {
    display: none !important;
  }

  #appView,
  .main-shell,
  .main-panel,
  #reportsScreen {
    display: block !important;
    min-height: auto;
    padding: 0;
    background: #FFFFFF;
  }

  .app-view {
    display: block;
  }

  .page-heading {
    margin-bottom: 16px;
  }

  .page-heading h1::after {
    content: " - Printable report";
    font-weight: 400;
  }

  .metric-grid,
  .reports-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .metric-card,
  .content-panel {
    break-inside: avoid;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #111827;
    box-shadow: none;
  }

  .metric-card::before,
  .metric-card::after {
    display: none;
  }

  .panel-header,
  th {
    background: #F8FAFC;
    color: #111827;
  }

  th,
  td {
    border-color: #DDE7F2;
    color: #111827;
  }

  .chart-body,
  .table-wrap {
    overflow: visible;
  }

  table,
  .report-wide-panel table {
    min-width: 0;
    font-size: 11px;
  }

  .report-wide-panel {
    grid-column: 1 / -1;
  }

  .btn,
  .link-button {
    color: #111827;
  }
}
