:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dce3ee;
  --line-strong: #c9d3e2;
  --text: #172033;
  --muted: #627087;
  --primary: #1f6feb;
  --primary-dark: #1457bd;
  --primary-soft: #e8f1ff;
  --accent: #18a058;
  --accent-soft: #e7f8ef;
  --warning: #b7791f;
  --warning-soft: #fff7df;
  --danger: #d92d20;
  --danger-soft: #ffebe8;
  --purple: #6941c6;
  --purple-soft: #f2edff;
  --shadow: 0 18px 42px rgba(23, 32, 51, 0.09);
  --shadow-soft: 0 10px 26px rgba(23, 32, 51, 0.07);
  --radius: 8px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

button {
  border: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(31, 111, 235, 0.16), transparent 32rem),
    linear-gradient(135deg, #eef5ff 0%, #f8fafc 52%, #edf8f1 100%);
}

.login-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 24px;
  align-items: stretch;
}

.login-brand-panel,
.login-card {
  border: 1px solid rgba(201, 211, 226, 0.82);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.login-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 560px;
  padding: 52px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(16, 44, 92, 0.92), rgba(18, 84, 162, 0.88)),
    url("data:image/svg+xml,%3Csvg width='600' height='600' viewBox='0 0 600 600' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12'%3E%3Cpath d='M76 116h448M76 216h448M76 316h448M76 416h448M116 76v448M216 76v448M316 76v448M416 76v448'/%3E%3Ccircle cx='416' cy='216' r='96'/%3E%3Cpath d='M156 376h112v112H156z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 10px 22px rgba(31, 111, 235, 0.22);
}

.login-brand-panel .brand-mark {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-brand-panel h1 {
  max-width: 600px;
  margin: 28px 0 14px;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.95;
  letter-spacing: 0;
}

.login-brand-panel p {
  max-width: 540px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 18px;
}

.login-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
}

.login-highlights span {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  font-size: 13px;
}

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

.login-card-header h2,
.section-heading h2,
.modal-header h2,
.topbar h1 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

.login-card-header h2 {
  font-size: 32px;
}

.login-card-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stacked-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field label {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  padding: 11px 12px;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), background 160ms var(--ease-out);
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(31, 111, 235, 0.72);
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.12);
}

.form-error,
.form-success {
  min-height: 20px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

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

.form-success {
  color: var(--accent);
}

.btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 150ms var(--ease-out), background 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.btn {
  min-height: 40px;
  padding: 10px 14px;
}

.btn:active,
.icon-btn:active,
.nav-link:active,
.task-row-action:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(31, 111, 235, 0.18);
}

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

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

.btn-secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #b42318;
}

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

.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.icon-btn:hover {
  background: var(--surface-soft);
}

.demo-credentials {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.demo-credentials p {
  margin: 0;
}

.demo-credentials p + p {
  margin-top: 4px;
}

.app-page {
  overflow-x: hidden;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #ffffff;
  padding: 20px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  transition: transform 150ms var(--ease-out), color 160ms var(--ease-out), background 160ms var(--ease-out);
}

.nav-link:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(31, 111, 235, 0.08);
  color: currentColor;
  font-size: 12px;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.sidebar-footer p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.content-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 251, 0.92);
  backdrop-filter: blur(16px);
  padding: 18px 28px;
}

.topbar h1 {
  font-size: 26px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.mobile-menu-btn {
  display: none;
  width: auto;
  padding: 0 12px;
}

.main-content {
  display: grid;
  gap: 24px;
  padding: 28px;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 22px;
}

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

.stat-card,
.performance-card,
.report-card,
.comment-card,
.table-card,
.report-form,
.detail-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.stat-card {
  padding: 18px;
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .stat-card:hover,
  .performance-card:hover,
  .report-card:hover,
  .comment-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.stat-card .stat-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px 190px;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 12px 14px;
}

.bulk-toolbar-copy {
  color: var(--muted);
  font-size: 13px;
}

.bulk-toolbar-copy strong {
  color: var(--text);
}

.table-card {
  overflow: hidden;
}

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

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

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

.data-table th {
  background: var(--surface-soft);
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.data-table td {
  color: var(--text);
}

.checkbox-cell {
  width: 48px;
  text-align: center !important;
}

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

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

.task-title-cell {
  display: grid;
  gap: 3px;
  min-width: 240px;
}

.task-title-cell strong {
  font-size: 14px;
}

.task-title-cell span {
  color: var(--muted);
  font-size: 13px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.task-row-action {
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 900;
  transition: transform 150ms var(--ease-out), background 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.task-row-action:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.task-row-action.danger {
  color: var(--danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge-pending {
  background: #eef2f7;
  color: #475569;
}

.badge-in-progress {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-review {
  background: var(--purple-soft);
  color: var(--purple);
}

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

.badge-delayed,
.badge-urgent {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-low {
  background: #eef2f7;
  color: #475569;
}

.badge-medium {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-high {
  background: var(--warning-soft);
  color: var(--warning);
}

.empty-state {
  display: none;
  padding: 34px 18px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.empty-state.visible {
  display: block;
}

.performance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.performance-card {
  padding: 18px;
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

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

.avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 900;
}

.member-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-name strong {
  display: block;
}

.member-name span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.performance-number {
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
}

.performance-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.comment-feed,
.reports-grid {
  display: grid;
  gap: 12px;
}

.comment-card,
.report-card {
  padding: 18px;
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.comment-card-header,
.report-card-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.comment-card h3,
.report-card h3 {
  margin: 0;
  font-size: 16px;
}

.comment-meta,
.report-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.comment-card p,
.report-card p {
  margin: 0;
}

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

.report-body div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.report-body strong {
  display: block;
  margin-bottom: 5px;
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
}

.report-form {
  padding: 18px;
  margin-bottom: 16px;
}

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

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.48);
  padding: 40px 18px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-panel {
  width: min(820px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.26);
  padding: 22px;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.detail-panel {
  width: min(900px, 100%);
}

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

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 16px;
  margin-top: 18px;
}

.detail-stack {
  display: grid;
  gap: 14px;
}

.detail-block {
  padding: 16px;
}

.detail-block h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.detail-block p {
  margin: 0;
  color: #334155;
}

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

.meta-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.meta-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.meta-tile strong {
  display: block;
  margin-top: 4px;
}

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

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.checklist-item input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--accent);
}

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

.checklist-item.done span {
  color: var(--muted);
  text-decoration: line-through;
}

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

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

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

.thread-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 11px;
}

.thread-message.admin-message {
  border-color: rgba(31, 111, 235, 0.18);
  background: var(--primary-soft);
}

.thread-message strong {
  display: block;
  margin-bottom: 3px;
}

.thread-message span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.thread-message p {
  margin-top: 7px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
  }

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

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

  .login-brand-panel {
    min-height: auto;
    padding: 34px;
  }

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, calc(100vw - 44px));
    transform: translateX(-100%);
    transition: transform 220ms var(--ease-out);
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .topbar {
    padding: 14px 18px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .main-content {
    padding: 18px;
  }

  .toolbar,
  .form-grid,
  .form-grid.two-columns,
  .report-body,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .bulk-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .login-page {
    padding: 14px;
  }

  .login-card,
  .login-brand-panel {
    padding: 24px;
  }

  .login-brand-panel h1 {
    font-size: 38px;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

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

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

  .stats-grid,
  .performance-grid {
    grid-template-columns: 1fr;
  }

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

  .modal-backdrop {
    padding: 14px;
  }

  .modal-panel {
    padding: 18px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
