:root {
  --blue: #3b82f6;
  --blue-strong: #2563eb;
  --ink: #171717;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-dark: #d6dbe3;
  --panel: #ffffff;
  --soft: #f7f8fa;
  --soft-blue: #eaf2ff;
  --red: #ef4444;
  --orange: #f97316;
  --green: #16a34a;
  --yellow: #f59e0b;
  --violet: #7c3aed;
  --nav: #111827;
  --nav-soft: #1f2937;
  --surface: #f4f7fb;
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
  --radius: 8px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f3f4f6;
  font-size: 15px;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.boot-screen,
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot-screen {
  grid-auto-flow: column;
  gap: 14px;
  justify-content: center;
  color: white;
}

.boot-screen span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 850;
  background: linear-gradient(135deg, var(--blue), var(--blue-strong));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 12px 22px rgba(37, 99, 235, 0.24);
}

.auth-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-card h1 {
  margin: 18px 0 8px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.auth-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.45;
}

.app-stage {
  min-height: 100vh;
  padding: 0;
}

.app-frame {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  background: white;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.sidebar {
  background: #19191d;
  border-right: 1px solid #292a30;
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.sidebar-close,
.sidebar-backdrop {
  display: none;
}

.brand {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand strong {
  font-size: 22px;
  letter-spacing: 0;
}

.sidebar .brand strong {
  color: #ffffff;
}

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

.sidebar .brand span {
  color: #f97316;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mobile-bar {
  display: none;
}

.nav {
  display: grid;
  gap: 16px;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-section {
  display: grid;
  gap: 8px;
}

.nav-submenu {
  display: grid;
  gap: 6px;
  margin: -2px 0 2px 34px;
}

.nav-submenu button {
  min-height: 32px;
  border: 0;
  border-left: 2px solid #373840;
  background: transparent;
  color: #8e94a3;
  padding: 5px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 850;
}

.nav-submenu button:hover,
.nav-submenu button.active {
  border-left-color: #f97316;
  color: #ffffff;
  background: rgba(249, 115, 22, 0.11);
}

.nav-title {
  padding: 0 12px;
  color: #767b87;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-button {
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #36383d;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  text-align: left;
}

.sidebar .nav-button {
  color: #9ca3af;
}

.nav-button:hover,
.nav-button.active {
  background: white;
  border-color: var(--line);
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.06);
}

.sidebar .nav-button:hover,
.sidebar .nav-button.active {
  color: white;
  background: #2b2b31;
  border-color: #34343b;
  box-shadow: none;
}

.sidebar .nav-button.active {
  box-shadow: inset 3px 0 0 #f97316;
}

.nav-icon,
.mini-dot {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 11px;
  font-weight: 800;
  background: #2f6df6;
}

.mini-dot.red { background: var(--red); }
.mini-dot.orange { background: var(--orange); }
.mini-dot.green { background: var(--green); }
.mini-dot.yellow { background: var(--yellow); }
.mini-dot.violet { background: var(--violet); }

.count-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  background: var(--red);
}

.sidebar-user {
  margin-top: auto;
  background: transparent;
  border: 0;
  border-top: 1px solid #30323a;
  border-radius: var(--radius);
  padding: 16px 12px 0;
  display: grid;
  gap: 10px;
}

.sidebar-user .avatar-line strong {
  color: #ffffff;
}

.sidebar-user .avatar-line span {
  color: #8e94a3;
}

.sidebar-user .button {
  color: #9ca3af;
  background: transparent;
  border-color: transparent;
  justify-content: flex-start;
}

.avatar-line {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 850;
  background: linear-gradient(135deg, var(--orange), var(--red));
}

.avatar-line strong,
.avatar-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-line span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--surface);
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e2e6ee;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.topbar-left {
  flex: 1;
}

.topbar-right {
  flex: 0 0 auto;
}

.title-stack.compact h1 {
  font-size: 20px;
}

.title-stack.compact .crumbs {
  font-size: 12px;
}

.top-search {
  width: min(420px, 100%);
  min-height: 42px;
  border: 1px solid #bfc8dc;
  border-radius: var(--radius);
  background: #f1f5ff;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  padding: 0 10px;
}

.top-search span {
  color: #475569;
  font-size: 24px;
  line-height: 1;
}

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

.top-profile {
  display: grid;
  grid-template-columns: minmax(120px, auto) 38px;
  align-items: center;
  gap: 10px;
}

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

.top-profile strong {
  color: #0f172a;
  font-size: 14px;
}

.top-profile span {
  color: #475569;
  font-size: 12px;
}

.title-stack {
  min-width: 0;
}

.title-stack h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.crumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.content {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  padding: 18px 24px 28px;
  align-items: start;
}

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

.column {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.panel {
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.04);
}

.panel-pad {
  padding: 16px;
}

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

.panel-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #fafafa);
}

.filter-pill {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  background: white;
  min-width: 0;
}

.filter-pill strong {
  color: var(--blue-strong);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  white-space: nowrap;
}

.filter-pill span {
  flex: 0 0 auto;
}

.tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  overflow: hidden;
  background: #f7f7f8;
}

.tab {
  min-height: 38px;
  border: 0;
  background: transparent;
  padding: 8px 14px;
  color: #5b6068;
}

.tab.active {
  color: var(--ink);
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  background: white;
  border: 1px solid #dde3ed;
  border-radius: var(--radius);
  padding: 22px;
  min-height: 136px;
  display: grid;
  align-content: start;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

.stat-card.red {
  border-color: #fed7aa;
  background: #fff7ed;
}

.stat-label {
  margin-top: 4px;
  color: #24272f;
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 850;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 850;
  background: #eef5ff;
  color: #2563eb;
}

.stat-icon.green {
  background: #ecfdf5;
  color: #16a34a;
}

.stat-icon.red {
  background: #fff1f2;
  color: #dc2626;
}

.stat-value {
  margin-top: 18px;
  color: #0f172a;
  font-size: 34px;
  line-height: 1;
  font-weight: 850;
}

.stat-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12.5px;
}

.dashboard-shell {
  display: grid;
  gap: 16px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 20px;
  align-items: start;
  padding: 18px 20px;
  border-color: #e0e5ee;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.035);
}

.dashboard-hero-copy h2 {
  margin: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1.2;
}

.dashboard-hero-copy p {
  margin: 5px 0 0;
  color: #6b7280;
  font-size: 13.5px;
}

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

.dashboard-date,
.dashboard-rate {
  min-height: 38px;
  border: 1px solid #dde3ed;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  color: #4b5563;
  background: #f9fafb;
  font-size: 12.5px;
  font-weight: 800;
}

.dashboard-rate {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.dashboard-heading {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-heading h2 {
  margin: 0;
  color: #0f172a;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.dashboard-heading p {
  margin: 5px 0 0;
  color: #4b5563;
}

.dashboard-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-heading-actions span {
  border: 1px solid #c8d3e7;
  border-radius: var(--radius);
  background: #eef3ff;
  color: #1e3a8a;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-filter-panel,
.task-menu-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(170px, 0.8fr) auto;
  align-items: end;
  gap: 12px;
  border-color: #e0e5ee;
  padding: 0;
}

.dashboard-filter-panel {
  grid-column: 1 / -1;
  padding-top: 6px;
}

.dashboard-filter-panel label,
.task-menu-panel label {
  display: grid;
  gap: 6px;
}

.dashboard-filter-panel label span,
.task-menu-panel label span {
  color: #4b5563;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-filter-panel select,
.task-menu-panel select {
  min-height: 40px;
  border-color: #d6dde8;
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
}

.import-task-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.import-task-row label {
  display: grid;
  gap: 6px;
}

.import-task-row label span {
  color: #4b5563;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.import-task-row input[type="file"] {
  padding: 8px;
}

.task-menu-panel {
  grid-template-columns: minmax(260px, 1fr) auto auto;
}

.task-menu-count {
  min-height: 44px;
  border: 1px solid #c8d3e7;
  border-radius: var(--radius);
  background: #f8fbff;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
}

.task-menu-count strong {
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
}

.task-menu-count span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.create-task-collapsed {
  padding: 16px;
}

.create-task-collapsed .button {
  width: fit-content;
  min-width: 160px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.dashboard-main,
.dashboard-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.report-panel,
.recent-reports {
  border-color: #c8d3e7;
}

.report-panel-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 12px;
}

.report-panel-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.15;
}

.report-panel-head p {
  margin: 4px 0 0;
  color: #4b5563;
  font-size: 13px;
}

.report-range {
  border: 1px solid #d6dde8;
  border-radius: 4px;
  background: #f8fafc;
  color: #0f172a;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.overall-progress-panel {
  padding: 20px 22px;
  border-color: #e0e5ee;
}

.overall-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.overall-progress-head h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  line-height: 1.2;
}

.overall-progress-head p {
  margin: 5px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.overall-progress-head div:last-child {
  text-align: right;
}

.overall-progress-head strong {
  display: block;
  color: #111827;
  font-size: 30px;
  line-height: 1;
}

.overall-progress-head span {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-size: 12px;
}

.overall-progress-track {
  height: 14px;
  margin-top: 20px;
  border-radius: 999px;
  background: #e5e7eb;
  display: flex;
  overflow: hidden;
}

.overall-progress-track span {
  display: block;
  width: var(--value);
  min-width: 0;
}

.overall-progress-track .done { background: #16a34a; }
.overall-progress-track .progressing { background: #2563eb; }
.overall-progress-track .pending { background: #f97316; }
.overall-progress-track .blocked { background: #dc2626; }

.overall-progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  color: #4b5563;
  font-size: 13px;
}

.overall-progress-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.overall-progress-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.overall-progress-legend i.green { background: #16a34a; }
.overall-progress-legend i.blue { background: #2563eb; }
.overall-progress-legend i.orange { background: #f97316; }
.overall-progress-legend i.red { background: #dc2626; }

.dashboard-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.dashboard-table {
  min-width: 620px;
}

.dashboard-table th {
  background: #fbfcfe;
  color: #6b7280;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.dashboard-table td {
  color: #24272f;
  font-size: 13.5px;
}

.dept-name {
  display: inline-grid;
  grid-template-columns: 12px auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dept-name span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.dept-name strong {
  font-weight: 850;
}

.table-progress {
  width: min(160px, 100%);
  height: 7px;
  margin: 2px 10px 0 0;
  border-radius: 999px;
  background: #e5e7eb;
  display: inline-block;
  overflow: hidden;
  vertical-align: middle;
}

.table-progress span {
  display: block;
  width: var(--value);
  height: 100%;
  background: var(--track-color);
}

.dashboard-table b {
  color: #4b5563;
  font-size: 12px;
}

.performance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 20px 28px 6px;
}

.performance-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 800;
}

.performance-legend i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.performance-chart {
  min-height: 300px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  align-items: end;
  gap: 24px;
  padding: 22px 44px 18px;
  background:
    linear-gradient(to top, #dbe2ee 1px, transparent 1px) 0 0 / 100% 25%;
}

.performance-bar {
  min-height: 260px;
  display: grid;
  grid-template-rows: 24px 1fr 22px;
  justify-items: center;
  align-items: end;
  gap: 8px;
}

.performance-bar strong {
  color: #4b5563;
  font-size: 12px;
}

.performance-bar span {
  width: 58px;
  height: var(--bar);
  min-height: 12px;
  border-radius: 6px 6px 0 0;
  background: var(--bar-color);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--bar-color) 24%, transparent);
}

.performance-bar em {
  color: #4b5563;
  font-style: normal;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.performance-baseline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  color: #9aa3b2;
  padding: 0 44px 26px;
  font-size: 12px;
  font-weight: 800;
}

.load-panel .report-panel-head {
  padding-bottom: 4px;
}

.load-list {
  display: grid;
  gap: 16px;
  padding: 14px 22px 22px;
}

.load-row {
  display: grid;
  gap: 8px;
  align-items: center;
}

.load-person {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
}

.avatar.mini {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 12px;
}

.load-person strong,
.load-person em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.load-person strong {
  color: #111827;
  font-size: 13.5px;
}

.load-person em,
.load-row small {
  color: #6b7280;
  font-size: 12px;
  font-style: normal;
}

.load-person b {
  color: #0f172a;
  font-size: 13px;
  justify-self: end;
}

.load-track {
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.load-track span {
  display: block;
  height: 100%;
  width: var(--value);
  background: var(--track-color);
}

.load-row small {
  justify-self: end;
}

.review-card {
  min-height: 220px;
  border-radius: var(--radius);
  background: #2749bd;
  color: white;
  padding: 28px;
  display: grid;
  align-content: center;
  gap: 16px;
  box-shadow: 0 14px 28px rgba(39, 73, 189, 0.2);
}

.review-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.review-card p {
  margin: 0;
  color: #c7d2fe;
  line-height: 1.45;
}

.review-card .button {
  width: fit-content;
  border-color: #a9c0ff;
  color: #1e3a8a;
  background: #b9c8ff;
}

.recent-reports .report-panel-head {
  border-bottom: 1px solid #c8d3e7;
}

.report-table {
  min-width: 880px;
}

.report-table th {
  background: #edf3ff;
  color: #4b5563;
  text-transform: uppercase;
  font-size: 12px;
}

.report-table tbody tr:nth-child(even) td {
  background: #edf3ff;
}

.report-member {
  display: inline-grid;
  grid-template-columns: 34px auto;
  align-items: center;
  gap: 10px;
}

.report-member .avatar {
  width: 34px;
  height: 34px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  background: #64748b;
}

.status-dot.blue { background: var(--blue-strong); }
.status-dot.green { background: var(--green); }
.status-dot.orange { background: var(--orange); }
.status-dot.red { background: var(--red); }
.status-dot.violet { background: var(--violet); }

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

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

.form-row {
  display: grid;
  gap: 6px;
}

.form-row.full {
  grid-column: 1 / -1;
}

label {
  color: #4b5563;
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.button {
  min-height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: white;
  color: #2d3137;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  font-weight: 750;
  text-decoration: none;
}

.button:hover {
  border-color: #c1c7d0;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.08);
}

.button.primary {
  border-color: var(--blue-strong);
  color: white;
  background: linear-gradient(180deg, #4f93ff, var(--blue-strong));
}

.button.danger {
  border-color: rgba(239, 68, 68, 0.32);
  color: #b91c1c;
  background: #fff7f7;
}

.button.small {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 13px;
}

.credentials-panel {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.credentials-grid {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px 16px;
  padding: 16px 20px 20px;
}

.credentials-grid span {
  color: #64748b;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.credentials-grid strong {
  color: #0f172a;
  min-width: 0;
  overflow-wrap: anywhere;
}

.access-control-panel {
  border-color: #dbe3ef;
}

.access-control-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.access-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(135px, 0.7fr) minmax(190px, 0.9fr) minmax(130px, 0.65fr) minmax(160px, 0.9fr) auto;
  align-items: end;
  gap: 12px;
  border: 1px solid #e1e7f0;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 12px;
}

.access-user {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  align-self: center;
}

.access-user strong,
.access-user span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-user strong {
  color: #111827;
  font-size: 13.5px;
  font-weight: 850;
}

.access-user span,
.access-note {
  color: #64748b;
  font-size: 12px;
}

.access-row label {
  display: grid;
  gap: 5px;
}

.access-row label span {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.access-row select {
  min-height: 36px;
  border-color: #d6dde8;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 750;
}

.access-note {
  align-self: center;
  line-height: 1.35;
}

.table-wrap {
  min-width: 0;
  width: 100%;
  overflow-x: auto;
}

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

.daily-report-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.daily-report-head p {
  margin: 0;
  color: var(--muted);
}

.daily-report-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(210px, 1.1fr) minmax(160px, 0.75fr) minmax(160px, 0.75fr) auto;
  align-items: end;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
}

.daily-report-filters label {
  display: grid;
  gap: 6px;
}

.daily-report-filters span {
  color: #4b5563;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.daily-report-filters select,
.daily-report-filters input {
  min-height: 42px;
  border-color: #c8d3e7;
  background: white;
}

.daily-report-groups {
  display: grid;
  gap: 18px;
  padding: 18px 20px 20px;
}

.daily-report-group {
  display: grid;
  gap: 12px;
}

.daily-report-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.daily-report-group-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
}

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

.daily-report-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  padding: 16px;
}

.daily-report-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.report-person {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.report-person .avatar {
  width: 42px;
  height: 42px;
}

.report-person strong,
.report-person em {
  display: block;
}

.report-person strong {
  color: #111827;
  font-weight: 850;
}

.report-person em {
  margin-top: 2px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.daily-report-card p {
  margin: 14px 0 0;
  color: #22252b;
  line-height: 1.55;
  white-space: pre-wrap;
}

.work-verification-panel {
  overflow: hidden;
}

.work-verify-list {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
}

.work-verify-card {
  border: 1px solid #dbe3ef;
  border-radius: var(--radius);
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.work-verify-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.work-verify-top strong {
  display: block;
  color: #111827;
  font-size: 16px;
  line-height: 1.25;
}

.work-verify-top p {
  margin: 6px 0 0;
  color: #475569;
  line-height: 1.45;
  white-space: pre-wrap;
}

.work-verify-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.work-verify-meta span {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #111827;
  font-weight: 750;
}

.work-verify-meta b {
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
}

.work-verify-meta i {
  justify-self: start;
  font-style: normal;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

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

th {
  color: #6b7280;
  background: #fafafa;
  font-size: 13px;
  font-weight: 750;
}

td {
  font-size: 14px;
}

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

.task-title {
  font-weight: 760;
}

.task-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  max-width: 360px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 8px;
  color: #4b5563;
  background: #f9fafb;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.badge.blue {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.badge.red {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.badge.orange {
  color: #c2410c;
  border-color: #fed7aa;
  background: #fff7ed;
}

.badge.green {
  color: #15803d;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.badge.yellow {
  color: #92400e;
  border-color: #fde68a;
  background: #fffbeb;
}

.badge.violet {
  color: #6d28d9;
  border-color: #ddd6fe;
  background: #f5f3ff;
}

.progress {
  height: 8px;
  width: 120px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f5;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.right-rail {
  display: grid;
  gap: 18px;
}

.donut-card {
  padding: 20px;
}

.donut-card h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.donut {
  width: 220px;
  height: 220px;
  margin: 4px auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, white 0 49%, transparent 50%),
    conic-gradient(var(--blue) 0 var(--done), var(--red) var(--done) var(--review), var(--orange) var(--review) var(--progress), #e5e7eb var(--progress) 100%);
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut-inner {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed #d4dae4;
  border-radius: 50%;
  background: white;
}

.donut-inner strong {
  display: block;
  font-size: 32px;
  line-height: 1;
}

.donut-inner span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.legend {
  display: grid;
  gap: 12px;
}

.legend-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.activity-list,
.task-cards {
  display: grid;
  gap: 10px;
}

.task-board-panel {
  overflow: hidden;
}

.task-board-header {
  align-items: flex-start;
}

.task-summary-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  padding: 16px;
}

.category-card {
  min-width: 0;
  min-height: 240px;
  border: 1px solid #dde5ef;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, white), white 46%),
    white;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
}

.category-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, #dbe3ef);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.simple-task-card {
  min-height: 70px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
}

.simple-task-card::before {
  inset: 0 auto 0 0;
  width: 5px;
  height: auto;
}

.simple-task-name {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #111827;
  padding: 0;
  text-align: left;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
}

.simple-task-name:hover {
  color: var(--accent);
}

.simple-task-actions {
  justify-content: flex-end;
}

.simple-task-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.simple-task-actions .button.small {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.status-control {
  display: grid;
  gap: 4px;
}

.status-control span {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.status-control select {
  min-width: 142px;
  min-height: 34px;
  border-color: #c8d3e7;
  background: #f8fbff;
  font-size: 13px;
  font-weight: 850;
}

.category-top {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.category-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: white;
  background: var(--accent);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 28%, transparent);
  font-weight: 900;
  font-size: 18px;
}

.category-top h3 {
  margin: 1px 0 4px;
  color: #111827;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.category-top p,
.category-desc,
.category-footer {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
}

.category-top p,
.category-desc {
  margin: 0;
}

.category-desc {
  min-height: 58px;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.category-chips span {
  min-height: 25px;
  border: 1px solid #dbe7f6;
  border-radius: 7px;
  background: #f8fbff;
  color: #3f5879;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 760;
}

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

.category-footer > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.category-button {
  min-height: 38px;
  border: 0;
  border-radius: var(--radius);
  color: white;
  background: #111827;
  padding: 8px 13px;
  font-weight: 800;
  white-space: nowrap;
}

.category-button.secondary {
  border: 1px solid #d5deeb;
  color: #111827;
  background: white;
}

.category-button:hover {
  background: var(--accent);
}

.category-button.secondary:hover {
  border-color: var(--accent);
  color: white;
}

.group-detail {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.simple-work-form {
  padding: 18px;
}

.simple-work-form textarea {
  min-height: 180px;
}

.record-modal-header {
  align-items: flex-start;
}

.record-modal-header h2 {
  font-size: 28px;
}

.record-modal-header p {
  font-size: 16px;
}

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

.record-detail {
  display: grid;
  gap: 22px;
  padding: 22px;
}

.record-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr);
  gap: 14px;
  align-items: end;
}

.record-filters label {
  display: grid;
  gap: 6px;
}

.record-filters label span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 850;
}

.record-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.record-stat {
  min-height: 102px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  text-align: center;
  background: #eff6ff;
}

.record-stat strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.record-stat span {
  color: #4b5563;
  font-weight: 750;
}

.record-stat.pending {
  border-color: #fde68a;
  background: #fffbeb;
  color: #a16207;
}

.record-stat.in-progress {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.record-stat.done {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.record-table {
  min-width: 960px;
}

.task-actions.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.group-description {
  border: 1px solid #dbe7f6;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fbff, white);
  padding: 14px;
}

.group-description-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.group-description strong {
  color: #334155;
}

.group-description p {
  margin: 0;
  color: #64748b;
  line-height: 1.5;
}

.group-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.8fr) minmax(170px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 12px;
}

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

.group-filter-bar label span {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.work-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.work-table {
  min-width: 1180px;
}

.work-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475569;
}

.work-table td {
  background: white;
}

.work-table tbody tr:hover td {
  background: #f8fbff;
}

.work-cell {
  width: 28%;
}

.work-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
}

.work-desc {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
  max-width: 360px;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.work-tags span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbe7f6;
  border-radius: 7px;
  background: #f8fbff;
  color: #35609a;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 750;
}

.owner-cell,
.date-stack,
.update-cell,
.status-stack,
.progress-stack {
  display: grid;
  gap: 6px;
}

.owner-cell strong {
  font-size: 14px;
  line-height: 1.2;
}

.owner-cell span,
.date-stack span,
.update-cell span,
.progress-stack span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.date-stack span {
  display: grid;
  gap: 2px;
}

.date-stack strong {
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.update-cell {
  max-width: 260px;
}

.update-cell strong {
  color: #334155;
  font-size: 13px;
}

.update-cell p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}

.update-cell a {
  width: fit-content;
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.status-stack {
  align-content: start;
}

.progress-stack {
  min-width: 140px;
}

.progress-stack .progress {
  width: 130px;
}

.progress-stack strong {
  color: #334155;
  font-size: 13px;
}

.task-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.task-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.035), rgba(255, 255, 255, 0) 58%),
    white;
  padding: 14px;
}

.task-item:hover {
  border-color: #c9d6ea;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
}

.task-item-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.task-item-top {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.task-item h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0;
}

.task-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.task-meta span {
  max-width: 190px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  color: #566071;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.task-progress-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) auto;
  align-items: center;
  gap: 10px;
}

.task-progress-row strong {
  color: #475569;
  font-size: 12px;
}

.task-progress {
  width: 100%;
}

.task-actions {
  display: grid;
  align-content: center;
  gap: 7px;
  min-width: 86px;
}

.activity-item,
.task-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 12px;
}

.activity-item strong,
.task-card strong {
  display: block;
  margin-bottom: 4px;
}

.activity-item p,
.task-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.task-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

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

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 40px));
  border-radius: var(--radius);
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-weight: 700;
}

.toast.error {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}

.modal {
  width: min(680px, 100%);
  max-height: min(780px, calc(100vh - 40px));
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal.wide {
  width: min(1180px, 100%);
}

.modal .panel-header {
  position: sticky;
  top: 0;
  background: white;
  z-index: 2;
}

.hidden {
  display: none !important;
}

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

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

@media (max-width: 900px) {
  :root {
    --shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
  }

  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    background: #f4f6f8;
    font-size: 14px;
  }

  .app-stage {
    padding: 0;
  }

  .app-frame {
    min-height: 100vh;
    border-radius: 0;
    grid-template-columns: 1fr;
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 12px 14px;
    border-bottom: 1px solid #dbe2ee;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 24;
  }

  .mobile-bar .brand {
    grid-template-columns: 38px 1fr;
    padding: 0;
  }

  .mobile-bar .brand-mark {
    width: 38px;
    height: 38px;
  }

  .mobile-bar .brand strong {
    font-size: 18px;
  }

  .mobile-bar .brand strong {
    color: var(--ink);
  }

  .mobile-bar .brand span {
    color: var(--muted);
  }

  .sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, 92vw);
    z-index: 35;
    max-height: 100dvh;
    overflow-y: auto;
    box-shadow: 24px 0 60px rgba(15, 23, 42, 0.42);
    padding: 18px 14px;
  }

  .sidebar.open {
    display: flex;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 34;
    border: 0;
    background: rgba(15, 23, 42, 0.45);
    padding: 0;
  }

  .sidebar-close {
    display: inline-flex;
    color: #ffffff;
    border-color: #34343b;
    background: #2b2b31;
  }

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

  .topbar-left,
  .topbar-right {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .top-search {
    width: 100%;
    min-height: 38px;
    grid-template-columns: 30px 1fr;
  }

  .top-search span {
    font-size: 20px;
  }

  .top-search input {
    min-height: 34px;
    font-size: 13px;
  }

  .top-profile {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 36px;
  }

  .content {
    padding: 14px 12px 22px;
    gap: 14px;
  }

  .filter-bar,
  .dashboard-filter-panel,
  .task-menu-panel,
  .daily-report-filters,
  .access-row,
  .import-task-row,
  .input-action,
  .credentials-grid,
  .record-filters,
  .record-stat-grid,
  .work-verify-meta,
  .form-grid,
  .form-grid.three,
  .dashboard-grid,
  .dashboard-side {
    grid-template-columns: 1fr;
  }

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

  .stat-card {
    min-height: 116px;
    padding: 14px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .stat-value {
    margin-top: 12px;
    font-size: 28px;
  }

  .stat-label,
  .stat-note {
    font-size: 11.5px;
  }

  .dashboard-shell {
    gap: 12px;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 12px;
  }

  .dashboard-hero-copy h2 {
    font-size: 18px;
  }

  .dashboard-hero-copy p {
    font-size: 12.5px;
  }

  .dashboard-hero-actions {
    justify-content: flex-start;
  }

  .dashboard-hero-actions .button,
  .dashboard-date,
  .dashboard-rate {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 12px;
  }

  .dashboard-filter-panel {
    gap: 10px;
  }

  .dashboard-filter-panel select,
  .task-menu-panel select {
    min-height: 38px;
    font-size: 12.5px;
  }

  .overall-progress-panel,
  .report-panel-head {
    padding: 14px;
  }

  .overall-progress-head {
    flex-direction: column;
  }

  .overall-progress-head div:last-child {
    text-align: left;
  }

  .overall-progress-head strong {
    font-size: 26px;
  }

  .overall-progress-legend {
    gap: 8px 12px;
    font-size: 12px;
  }

  .dashboard-table {
    min-width: 560px;
  }

  .load-list {
    padding: 10px 14px 14px;
  }

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

  .daily-report-head,
  .daily-report-card-top,
  .work-verify-top {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-report-head .task-actions,
  .daily-report-card-top .task-actions {
    justify-content: flex-start;
  }

  .performance-chart {
    gap: 14px;
    padding: 18px 18px 14px;
  }

  .performance-bar span {
    width: 42px;
  }

  .performance-baseline {
    padding: 0 18px 22px;
  }

  .task-summary-pills {
    width: 100%;
    justify-content: flex-start;
  }

  .category-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .category-card {
    min-height: 0;
    padding: 14px;
  }

  .simple-task-card,
  .simple-task-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .simple-task-card {
    min-height: 0;
    gap: 10px;
    padding: 13px 14px 13px 16px;
  }

  .simple-task-name {
    font-size: 14px;
    line-height: 1.25;
  }

  .simple-task-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .simple-task-actions .button.small {
    width: 100%;
  }

  .status-control select {
    width: 100%;
  }

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

  .record-detail,
  .group-detail {
    padding: 12px;
    gap: 14px;
  }

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

  .record-modal-header h2 {
    font-size: 22px;
  }

  .record-modal-header p {
    font-size: 13px;
  }

  .record-header-actions,
  .task-actions.inline {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }

  .record-stat {
    min-height: 78px;
  }

  .record-stat strong {
    font-size: 24px;
  }

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

  .task-item,
  .task-item-top {
    grid-template-columns: 1fr;
  }

  .task-badges {
    justify-content: flex-start;
  }

  .task-actions {
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    min-width: 0;
  }

  .title-stack h1 {
    font-size: 20px;
  }

  .crumbs {
    font-size: 11.5px;
    margin-top: 4px;
  }

  .panel-header {
    min-height: 48px;
    padding: 12px 14px;
  }

  .panel-header h2 {
    font-size: 16px;
  }

  .panel-header p {
    font-size: 12px;
  }

  .panel-pad {
    padding: 12px;
  }

  .access-control-list {
    padding: 10px;
  }

  .access-row {
    gap: 10px;
    padding: 10px;
  }

  .access-note {
    padding: 8px 10px;
    border: 1px solid #e1e7f0;
    border-radius: var(--radius);
    background: #f8fafc;
  }

  .table-wrap,
  .dashboard-table-wrap,
  .work-table-wrap {
    max-width: calc(100vw - 24px);
    border-radius: var(--radius);
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    padding: 10px 11px;
    font-size: 12.5px;
  }

  .button {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 13px;
  }

  .button.small {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .modal-backdrop {
    padding: 8px;
    align-items: stretch;
  }

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

@media (max-width: 560px) {
  .mobile-bar {
    padding: 10px 12px;
  }

  .content {
    padding: 12px 10px 18px;
  }

  .auth-card {
    padding: 20px;
  }

  .topbar {
    padding: 12px 10px;
  }

  .topbar-right {
    gap: 10px;
  }

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

  .top-actions {
    width: 100%;
    justify-content: stretch;
  }

  .top-actions .button {
    flex: 1;
  }

  .top-profile {
    display: none;
  }

  .dashboard-hero,
  .overall-progress-panel,
  .stat-card,
  .panel {
    border-radius: 8px;
  }

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

  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 25px;
  }

  .stat-note {
    line-height: 1.25;
  }

  .task-menu-panel {
    gap: 9px;
    padding: 12px;
  }

  .task-menu-count {
    width: 100%;
    justify-content: center;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    white-space: nowrap;
  }

  .category-footer {
    grid-template-columns: 1fr;
  }

  .category-button {
    width: 100%;
  }

  .category-actions {
    justify-content: stretch;
  }

  .category-actions .category-button {
    flex: 1;
  }

  .group-description-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .daily-report-head,
  .daily-report-filters,
  .daily-report-groups {
    padding: 12px;
  }

  .daily-report-card {
    padding: 12px;
  }

  .daily-report-card-top {
    gap: 10px;
  }

  .report-person {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .report-person .avatar {
    width: 36px;
    height: 36px;
  }

  .toast {
    right: 10px;
    bottom: 10px;
    max-width: calc(100vw - 20px);
  }
}

@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .top-actions {
    flex-direction: column;
  }

  .simple-task-actions,
  .record-header-actions,
  .task-actions.inline {
    grid-template-columns: 1fr;
  }
}
