:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-muted: #f0f4f8;
  --ink: #152033;
  --muted: #637083;
  --line: #d9e1ec;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --gold: #c47f17;
  --red: #b42318;
  --shadow: 0 18px 45px rgba(21, 32, 51, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: #101827;
  color: #eef4fb;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-logo {
  width: min(220px, 100%);
  height: auto;
  display: block;
}

.brand h1,
.topbar h2,
.panel-header h3 {
  margin: 0;
}

.brand h1 {
  color: #eef4fb;
  margin-top: -20px;
  padding-left: 82px;
  font-size: 15px;
  line-height: 1.15;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #8ea0b8;
}

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

.nav-item {
  border: 0;
  border-radius: 8px;
  color: #dce7f3;
  background: transparent;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.is-active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #cbd7e5;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: #ffffff;
}

.sidebar input {
  border-color: rgba(255, 255, 255, 0.16);
  color: #f8fbff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar input::placeholder {
  color: #8ea0b8;
}

.primary-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

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

.secondary-button,
.danger-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 850;
  cursor: pointer;
}

.secondary-button:hover {
  background: #f8fafc;
}

.secondary-button.dark {
  width: 100%;
  color: #eef4fb;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.secondary-button.dark:hover {
  background: rgba(255, 255, 255, 0.14);
}

.danger-button {
  color: #9f1f17;
  border-color: rgba(180, 35, 24, 0.22);
}

.danger-button:hover:not(:disabled) {
  background: #fff5f3;
}

.danger-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 22%, rgba(15, 118, 110, 0.08), transparent 30%),
    var(--bg);
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 26px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 0;
  padding: 12px 0 2px;
  border-radius: 8px;
  background: #101827;
}

.login-logo {
  width: min(260px, 100%);
  height: auto;
  display: block;
}

.login-brand h1 {
  margin: -20px 0 18px;
  padding-left: 146px;
  justify-self: start;
  color: #eef4fb;
  font-size: 16px;
  line-height: 1.15;
}

.login-form label,
.management-form label {
  color: var(--ink);
}

.form-message {
  min-height: 18px;
  margin: 0;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.form-message.is-error {
  color: var(--red);
}

.sidebar-user {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 10px;
}

.sidebar-user-identity .nav-icon {
  color: #8ea0b8;
}

.user-nav {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  gap: 6px;
}

.sidebar-user-email {
  min-width: 0;
  color: #cbd7e5;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.logout-nav-item {
  margin-top: 10px;
  position: relative;
}

.logout-nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h2 {
  font-size: 30px;
}

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

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-pill.is-live {
  border-color: rgba(15, 118, 110, 0.32);
  color: var(--accent-strong);
}

.status-pill.is-error {
  border-color: rgba(180, 35, 24, 0.28);
  color: var(--red);
}

.refresh-button {
  min-height: 38px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--accent-strong);
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.refresh-button:hover {
  border-color: rgba(15, 118, 110, 0.42);
  background: #eef8f6;
}

.dashboard-section + .dashboard-section {
  margin-top: 22px;
}

.app-view {
  display: grid;
  gap: 22px;
}

.dashboard-loader {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.loader-content {
  width: min(440px, 100%);
}

.dashboard-loader strong,
.dashboard-loader span {
  display: block;
}

.dashboard-loader strong {
  font-size: 16px;
}

.dashboard-loader span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.loader-progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  margin-top: 14px;
  padding: 2px;
  border-radius: 999px;
  background: #e8eef5;
}

.loader-progress span {
  width: 0%;
  height: 100%;
  display: block;
  margin-top: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #2f8f83);
  transition: width 220ms ease;
}

.loader-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 8px;
}

.loader-meta span,
.loader-meta strong {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.loader-meta strong {
  color: var(--accent-strong);
}

.loader-orbit {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  align-self: center;
  margin-top: -41px;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid #d8e4ee;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(15, 118, 110, 0.13), transparent 48%),
    #f8fafc;
}

.loader-orbit::before {
  content: "";
  width: 28px;
  height: 28px;
  border: 2px solid rgba(15, 118, 110, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: loader-spin 1.2s linear infinite;
}

.loader-orbit span {
  width: 7px;
  height: 7px;
  position: absolute;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.08);
  animation: loader-pulse 1.15s ease-in-out infinite;
}

.loader-orbit span:nth-child(1) {
  top: 9px;
  left: 22px;
}

.loader-orbit span:nth-child(2) {
  right: 9px;
  bottom: 14px;
  animation-delay: 0.18s;
}

.loader-orbit span:nth-child(3) {
  left: 9px;
  bottom: 14px;
  animation-delay: 0.36s;
}

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

@keyframes loader-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.72);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.management-panel {
  display: grid;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.account-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.account-summary {
  display: grid;
  grid-column: 1 / -1;
}

.account-contact-card {
  display: grid;
  gap: 0;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.account-contact-card div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.account-contact-card div:last-child {
  border-bottom: 0;
}

.account-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.account-summary strong {
  overflow-wrap: anywhere;
}

.account-panel .management-form {
  max-width: none;
  height: 100%;
  align-content: start;
}

.management-form {
  max-width: 680px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.management-form h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.user-create-form {
  max-width: none;
  grid-template-columns: minmax(220px, 1.3fr) repeat(2, minmax(150px, 0.8fr)) minmax(180px, 1fr) 140px auto;
  align-items: end;
}

.user-create-form h4,
.user-create-form .form-message {
  grid-column: 1 / -1;
}

.user-create-form .primary-button {
  min-width: 132px;
}

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

.user-list-head,
.user-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(2, minmax(140px, 0.8fr)) 120px minmax(180px, 1fr) 170px;
  gap: 10px;
  align-items: center;
}

.user-list-head {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.user-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

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

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

.status-flow {
  margin-bottom: 16px;
}

.status-flow-panel {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-header.compact {
  min-height: 62px;
  padding: 14px 18px;
}

.status-flow-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 16px;
}

.status-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
  text-align: left;
  cursor: pointer;
}

.status-group.is-selected {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.status-group:hover {
  border-color: rgba(15, 118, 110, 0.28);
}

.status-group-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.status-group-top strong {
  font-size: 22px;
  line-height: 1;
}

.status-group-track {
  height: 9px;
  margin-top: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.status-group-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.status-group-fill.blue {
  background: #2563a8;
}

.status-group-fill.amber {
  background: var(--gold);
}

.status-group-fill.green {
  background: #14855f;
}

.status-group-fill.neutral {
  background: #9aa6b5;
}

.status-group p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.status-flow-detail {
  border-top: 1px solid var(--line);
  padding: 16px 18px 18px;
}

.status-flow-detail-head {
  display: grid;
  gap: 16px;
  justify-items: start;
  margin-bottom: 12px;
}

.status-flow-detail-head h4 {
  margin: 0;
  font-size: 16px;
}

.status-flow-filter {
  min-width: min(280px, 100%);
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.status-flow-filter input {
  min-height: 36px;
  border-color: var(--line);
  color: var(--ink);
  background: #ffffff;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
}

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

.status-flow-table {
  width: 100%;
  min-width: 1220px;
  border-collapse: collapse;
}

.status-flow-table th,
.status-flow-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: top;
  font-size: 12px;
}

.status-flow-table tbody tr:last-child td {
  border-bottom: 0;
}

.status-flow-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfcfe;
}

.status-sort-button {
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 850;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.status-sort-button:hover {
  color: var(--ink);
}

.status-subject {
  min-width: 260px;
  color: var(--ink);
  font-weight: 720;
}

.status-flow-empty-row {
  color: var(--muted);
  text-align: center;
}

.priority-row-urgent {
  background: #fff8f6;
}

.priority-row-high {
  background: #fffbf2;
}

.priority-row-normal {
  background: #f8fbff;
}

.priority-row-low {
  background: #fbfcfe;
}

.table-id-link {
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.table-id-link:hover {
  text-decoration: underline;
}

.table-view-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  padding: 4px 8px;
  color: var(--accent-strong);
  background: #ffffff;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.table-view-link:hover {
  border-color: rgba(15, 118, 110, 0.42);
  background: #eef8f6;
}

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

.kpi-card,
.phase-card,
.chart-panel,
.table-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi-card {
  min-height: 130px;
  padding: 18px;
}

.kpi-status-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.kpi-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.kpi-status-label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.kpi-status-row strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #9aa6b5;
}

.status-dot.blue {
  background: #2563a8;
}

.status-dot.amber {
  background: var(--gold);
}

.status-dot.green {
  background: #14855f;
}

.status-dot.neutral {
  background: #9aa6b5;
}

.work-item-breakdown {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.work-item-type {
  display: grid;
  gap: 8px;
}

.work-item-type + .work-item-type {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.work-item-type-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.work-item-type-head strong {
  flex: 0 0 auto;
}

.work-item-status-table {
  display: grid;
  gap: 5px;
}

.work-item-status-head,
.work-item-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 78px;
  gap: 8px;
  align-items: center;
}

.work-item-status-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.work-item-status-head span:nth-child(2),
.work-item-status-head span:nth-child(3),
.work-item-status-row strong {
  text-align: right;
}

.work-item-status-row {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.work-item-status-label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.work-item-status-row strong {
  color: var(--ink);
  font-size: 12px;
}

.work-item-empty {
  color: var(--muted);
  font-size: 12px;
}

.time-since-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.time-since-row {
  display: grid;
  grid-template-columns: auto auto auto auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  justify-content: start;
}

.time-since-row label {
  color: var(--ink);
}

.time-since-input {
  width: 132px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  color: var(--ink);
  background: #fbfcfe;
  font: inherit;
}

.time-since-colon {
  color: var(--ink);
  font-weight: 850;
}

.time-since-row strong {
  color: var(--ink);
  font-size: 13px;
}

.time-since-select-row {
  display: grid;
  gap: 6px;
}

.time-since-select-row label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.time-since-select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  background: #fbfcfe;
  font: inherit;
  font-size: 12px;
}

.time-since-select:hover,
.time-since-select:focus,
.time-since-input:hover,
.time-since-input:focus {
  border-color: rgba(15, 118, 110, 0.32);
  outline: none;
}

.achievement-divider {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.achievement-section-title {
  margin-top: 14px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.achievement-section-title span {
  color: var(--muted);
  font-weight: 760;
}

.achievement-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.achievement-section-head .achievement-section-title {
  margin-top: 0;
}

.weekly-details-button {
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--accent-strong);
  background: #ffffff;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.weekly-details-button:hover {
  border-color: rgba(15, 118, 110, 0.42);
  background: #eef8f6;
}

.achievement-table {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.achievement-head,
.achievement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px 86px;
  gap: 8px;
  align-items: center;
}

.achievement-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.achievement-head span:nth-child(2),
.achievement-head span:nth-child(3),
.achievement-row strong {
  text-align: right;
}

.achievement-row {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.achievement-row strong {
  color: var(--ink);
  font-size: 12px;
}

.achievement-row strong.is-zero {
  color: #c2cad5;
  font-weight: 760;
}

.achievement-status-label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.achievement-footnote {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.weekly-details-wrap {
  overflow-x: auto;
}

.weekly-details-table {
  display: grid;
  gap: 6px;
  min-width: 680px;
}

.weekly-details-head,
.weekly-details-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(120px, 0.75fr);
  gap: 8px;
  align-items: start;
}

.weekly-details-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.weekly-details-row {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.weekly-details-row a {
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.weekly-details-row a:hover {
  text-decoration: underline;
}

.weekly-details-row strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.weekly-details-empty {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.current-activity-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

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

.current-activity-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.current-activity-head span {
  min-width: 0;
}

.current-activity-head strong {
  flex: 0 0 auto;
}

.current-phase-list {
  display: grid;
  gap: 7px;
}

.current-phase {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.current-phase > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
  line-height: 1.25;
}

.current-tracker-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.current-row-button,
.current-phase-empty {
  color: #4b5563;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}

.current-row-button {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.current-row-button:hover {
  color: var(--accent-strong);
}

.current-phase-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  border-radius: 999px;
  padding: 4px 8px;
  color: #2b3748;
  border: 1px solid #cbd5e1;
  background: #f4f7fb;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
}

.mini-status-chip strong {
  padding-left: 7px;
  border-left: 1px solid currentColor;
  font-size: 12px;
  line-height: 1;
}

.mini-status-chip.blue {
  color: #174a80;
  border-color: #b7d1ee;
  background: #e7f1fb;
}

.mini-status-chip.amber {
  color: #8a560d;
  border-color: #e9c889;
  background: #fff5dd;
}

.mini-status-chip.green {
  color: #0f6247;
  border-color: #b7dfcd;
  background: #e3f5ec;
}

.mini-status-chip.neutral {
  color: #4b5563;
  border-color: #cbd5e1;
  background: #f4f7fb;
}

.mini-status-chip:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 39, 0.58);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(16, 24, 39, 0.25);
}

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

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

.modal-sort {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.modal-sort-button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.modal-sort-button.is-active {
  color: #ffffff;
  background: #253041;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
}

.modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--ink);
  background: #f8fafc;
}

.modal-body {
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 18px;
}

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

.modal-item {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: #fbfcfe;
}

.modal-item.priority-urgent {
  border-left-color: #b42318;
  background: #fff5f3;
}

.modal-item.priority-high {
  border-left-color: #c47f17;
  background: #fffaf0;
}

.modal-item.priority-normal {
  border-left-color: #2563a8;
  background: #f4f8ff;
}

.modal-item.priority-low {
  border-left-color: #7a8696;
  background: #fbfcfe;
}

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

.modal-item-head strong {
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.25;
}

.modal-item-description,
.modal-item-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.modal-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
}

.modal-item-description {
  margin-right: 4px;
  min-width: min(100%, 260px);
  flex: 1 1 260px;
  padding-top: 3px;
}

.modal-item-link {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  padding: 3px 8px;
  color: var(--accent-strong);
  background: #ffffff;
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

.modal-item-link:hover {
  border-color: rgba(15, 118, 110, 0.42);
  background: #eef8f6;
}

.priority-badge {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 850;
}

.modal-meta-chip {
  border-radius: 999px;
  padding: 3px 8px;
  color: #4b5563;
  background: rgba(238, 242, 247, 0.82);
  font-size: 11px;
  font-weight: 800;
}

.priority-badge.urgent {
  color: #9f1f17;
  background: #ffe5e1;
}

.priority-badge.high {
  color: #8a560d;
  background: #fff1cf;
}

.priority-badge.normal {
  color: #174a80;
  background: #e4effc;
}

.priority-badge.low {
  color: #4b5563;
  background: #eef2f7;
}

.status-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  padding-top: 8px;
}

.status-path-chip {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.status-path-chip.blue {
  color: #155285;
  background: #e4f0fb;
}

.status-path-chip.amber {
  color: #7a4a06;
  background: #fff2c7;
}

.status-path-chip.purple {
  color: #5d3d91;
  background: #eee8ff;
}

.status-path-chip.green {
  color: #0f6247;
  background: #dff5eb;
}

.status-path-chip.neutral {
  color: #4b5563;
  background: #eef2f7;
}

.status-path-arrow {
  color: #7a8696;
  font-size: 12px;
  font-weight: 900;
}

.phase-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  min-height: 260px;
  padding: 18px;
}

.phase-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.period {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
  white-space: nowrap;
}

.phase-card h3 {
  margin: 0;
  font-size: 17px;
}

.time-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.time-box strong {
  color: var(--ink);
  font-size: 14px;
}

.metric-list {
  display: grid;
  gap: 11px;
  align-self: start;
  align-content: start;
}

.metric {
  display: grid;
  grid-template-columns: 112px minmax(44px, 1fr) 122px;
  align-items: center;
  gap: 10px;
}

.metric-name {
  font-size: 12px;
  font-weight: 790;
}

.track,
.split-track {
  height: 11px;
  overflow: hidden;
  background: #e8edf4;
  border-radius: 999px;
}

.fill,
.split-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.fill.green-fill {
  background: #14855f;
}

.split-fill.green-fill {
  background: #14855f;
}

.fill.amber-fill,
.split-fill.amber-fill {
  background: var(--gold);
}

.fill.neutral-fill,
.split-fill.neutral-fill {
  background: #9aa6b5;
}

.metric-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-align: right;
  white-space: nowrap;
}

.phase-empty {
  grid-column: 1 / -1;
  min-height: 56px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  background: #fbfcfe;
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.blue {
  color: #2563a8;
  background: #e4effc;
}

.green {
  color: #14855f;
  background: #dff4eb;
}

.amber {
  color: var(--gold);
  background: #fff1cf;
}

.neutral {
  color: #475569;
  background: #eef2f7;
}

.split-list {
  display: grid;
  gap: 9px;
  margin-top: 13px;
}

.split-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.split-row strong {
  color: var(--ink);
  font-size: 13px;
}

.split-track {
  grid-column: 1 / -1;
  height: 8px;
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.kpi-value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 850;
}

.kpi-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.time-spent-split {
  margin-top: 14px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(380px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.section {
  margin-top: 22px;
}

.section h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.load-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 18px;
}

.load {
  min-height: 78px;
  padding: 9px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.load.done {
  border-color: rgba(20, 133, 95, 0.25);
  background: #dff4eb;
}

.load.upcoming {
  border-color: rgba(196, 127, 23, 0.36);
  background: #fff1cf;
}

.load.overdue {
  border-color: rgba(180, 35, 24, 0.34);
  background: #ffe5e1;
}

.load b {
  font-size: 12px;
}

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

.chart-panel,
.table-panel {
  overflow: hidden;
}

.production-panel,
.timeline-panel {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.panel-header h3 {
  font-size: 18px;
}

.panel-header select,
.panel-header input {
  max-width: 220px;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  min-width: 220px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
}

.segment-button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.segment-button.is-active {
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(21, 32, 51, 0.12);
}

.bar-chart {
  display: grid;
  gap: 14px;
  padding: 20px 18px 24px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 64px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.bar-label {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 14px;
  background: var(--panel-muted);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  min-width: 4px;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.bar-value {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.timeline-board {
  padding: 18px;
  overflow-x: auto;
  overflow-y: hidden;
}

.timeline-axis,
.timeline-row {
  min-width: 980px;
  display: grid;
  grid-template-columns: 360px minmax(620px, 1fr);
  gap: 16px;
}

.timeline-axis {
  align-items: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.timeline-axis-spacer {
  min-height: 48px;
  display: flex;
  align-items: center;
}

.timeline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-controls .segmented-control {
  min-width: 160px;
}

.timeline-controls .segment-button {
  min-height: 30px;
  font-size: 11px;
}

.timeline-axis-labels {
  grid-column: 2;
  position: relative;
  height: 64px;
  border-bottom: 1px solid var(--line);
}

.timeline-axis-label {
  position: absolute;
  bottom: 8px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.timeline-axis-label:first-child {
  transform: translateX(0);
}

.timeline-axis-label:last-child {
  transform: translateX(-100%);
}

.timeline-today-marker {
  position: absolute;
  top: 0;
  bottom: -9999px;
  width: 0;
  border-left: 2px solid var(--red);
  transform: translateX(-1px);
  z-index: 2;
}

.timeline-today-chip {
  position: absolute;
  top: -2px;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: max-content;
  border-radius: 999px;
  padding: 5px 10px;
  color: #ffffff;
  background: var(--red);
  font-size: 11px;
  line-height: 1.1;
  transform: translateX(-50%);
}

.timeline-today-chip strong {
  font-size: 11px;
  font-weight: 850;
}

.timeline-today-chip span {
  font-size: 10px;
  font-weight: 500;
}

.timeline-track-name {
  min-width: 980px;
  margin: 18px 0 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.timeline-row {
  align-items: start;
  min-height: 80px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.timeline-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 820;
}

.timeline-label span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.timeline-lane {
  position: relative;
  height: 28px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-muted);
}

.timeline-bar {
  position: absolute;
  top: 4px;
  bottom: 4px;
  min-width: 42px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9e5f4;
}

.timeline-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
}

.timeline-fill.amber-fill {
  background: var(--gold);
}

.bar-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 11px;
  font-weight: 850;
}

.timeline-metrics {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  align-items: start;
}

.timeline-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  border-radius: 999px;
  padding: 4px 8px;
  color: #4b5563;
  border: 1px solid #cbd5e1;
  background: #f4f7fb;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.timeline-label .timeline-chip {
  display: inline-flex;
}

.timeline-chip:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.timeline-chip span {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
}

.timeline-label .timeline-chip span {
  display: inline;
  margin: 0;
}

.timeline-chip strong {
  flex: 0 0 auto;
  min-width: auto;
  margin: 0;
  padding-left: 7px;
  border-left: 1px solid currentColor;
  color: inherit;
  font-size: 12px;
  line-height: 1;
  text-align: center;
}

.timeline-chip.blue {
  color: #174a80;
  border-color: #b7d1ee;
  background: #e7f1fb;
}

.timeline-chip.amber {
  color: #8a560d;
  border-color: #e9c889;
  background: #fff5dd;
}

.timeline-chip.green {
  color: #0f6247;
  border-color: #b7dfcd;
  background: #e3f5ec;
}

.timeline-chip.neutral {
  color: #4b5563;
  border-color: #cbd5e1;
  background: #f4f7fb;
}

.time-chip {
  color: var(--accent-strong);
  background: rgba(15, 118, 110, 0.1);
}

.timeline-epic-box {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.timeline-epic-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: #eef2f7;
  font-size: 12px;
  font-weight: 850;
}

.timeline-epic-title span {
  min-width: 0;
}

.timeline-epic-title strong {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.timeline-flow-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}

.timeline-flow-label {
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
}

.timeline-flow-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.timeline-flow-empty {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.table-wrap {
  overflow: auto;
  max-height: 520px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #fbfcfe;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

td {
  color: #2b3748;
}

.empty-state {
  color: var(--muted);
  padding: 30px 18px;
}

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

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    min-height: auto;
  }

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

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

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

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

  .account-panel {
    grid-template-columns: 1fr;
  }

  .user-create-form,
  .user-list-head,
  .user-row {
    grid-template-columns: 1fr;
  }

  .user-list-head {
    display: none;
  }

  .user-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

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

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

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

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

  .phase-head {
    flex-direction: column;
  }

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

  .metric-value {
    text-align: left;
  }

  .account-contact-card div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .load-board {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 88px minmax(0, 1fr) 52px;
  }

  .panel-header select,
  .panel-header input {
    max-width: none;
  }

  .segmented-control {
    width: 100%;
  }

  .login-panel {
    padding: 22px;
  }

  .login-brand h1 {
    padding-left: 132px;
    font-size: 15px;
  }

  .account-summary {
    grid-template-columns: 1fr;
  }
}
