@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --text: #06142d;
  --muted: #5f6b80;
  --line: #d7e0ed;
  --line-strong: #b9c7da;
  --primary: #0969e8;
  --primary-dark: #064fb4;
  --primary-light: #eaf3ff;
  --accent: #00a8ff;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 16px 44px rgba(6, 20, 45, 0.08);
  --shadow-soft: 0 8px 22px rgba(6, 20, 45, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #ffffff 0, #f7faff 165px, var(--bg) 420px);
  color: var(--text);
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 4px 0 8px;
}

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

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

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

h1 {
  margin-bottom: 0;
  color: #020817;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h2 {
  margin-bottom: 4px;
  color: #020817;
  font-size: 21px;
  font-weight: 700;
}

.storage-pill {
  max-width: 560px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  box-shadow: var(--shadow-soft);
  overflow-wrap: anywhere;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 28px;
}

.tabs {
  display: flex;
  gap: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab-button {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #536174;
  padding: 13px 2px 15px;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.16s ease;
}

.tab-button.is-active {
  background: transparent;
  color: #020817;
  box-shadow: none;
}

.tab-button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  content: "";
}

.tab-button.is-active::after {
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.work-subtabs {
  display: flex;
  gap: 12px;
  margin: -6px 0 22px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.work-subtab {
  border: 0;
  border-radius: 12px;
  background: #eef5ff;
  color: #172033;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.work-subtab.is-active {
  background: linear-gradient(135deg, var(--primary), #178bff);
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.16);
}

.tab-panel {
  display: none;
}

.is-hidden {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.workspace {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 22px;
  align-items: start;
}

#tab-settings .workspace {
  grid-template-columns: minmax(360px, 0.85fr) minmax(340px, 1fr);
}

#settingsForm {
  position: static;
}

.card-form,
.task-panel,
.table-panel,
.dashboard-panel,
.mini-panel,
.workflow-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card-form {
  display: grid;
  gap: 14px;
  padding: 20px;
  position: sticky;
  top: 16px;
}

.task-panel,
.table-panel,
.dashboard-panel,
.workflow-panel,
.gantt-panel {
  min-height: 560px;
  padding: 20px;
}

.form-head,
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #172033;
  font-size: 14px;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(6, 20, 45, 0.02);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(9, 105, 232, 0.12);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-list {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.checkbox-item {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 9px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.checkbox-item input {
  width: auto;
  margin-top: 2px;
}

.primary-button,
.ghost-button,
.filter,
.task-action,
.file-upload span {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), #178bff);
  color: #fff;
  box-shadow: 0 10px 20px rgba(9, 105, 232, 0.2);
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.primary-button.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-button.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
  animation: buttonSpin 0.75s linear infinite;
}

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

.ghost-button,
.filter,
.task-action,
.file-upload span {
  background: #f1f6fd;
  color: #172033;
}

.ghost-button:hover,
.filter:hover,
.task-action:hover,
.file-upload span:hover {
  background: #e4effc;
}

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

#assignSummary,
#manageSummary,
#peopleSummary,
#projectSummary,
#materialSummary,
#expenseSummary {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.expense-total {
  display: inline-block;
  margin-top: 8px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
}

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

.stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.stat-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 700;
}

.stat-card strong {
  display: block;
  color: var(--text);
  font-size: 38px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 14px;
}

.material-layout {
  display: grid;
  gap: 16px;
}

.material-subtabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.material-subtab {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #536174;
  padding: 12px 2px 14px;
  font-size: 16px;
  font-weight: 700;
}

.material-subtab.is-active {
  background: transparent;
  color: #020817;
}

.material-subtab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  content: "";
}

.material-subtab.is-active::after {
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.material-view {
  display: none;
}

.material-view.is-active,
.project-view.is-active,
.progress-view.is-active,
.people-view.is-active,
.settings-view.is-active {
  display: grid;
  gap: 16px;
}

.project-view,
.progress-view,
.people-view,
.settings-view {
  display: none;
}

.project-subtabs,
.progress-subtabs,
.people-subtabs,
.settings-subtabs {
  display: flex;
  gap: 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.project-subtab,
.progress-subtab,
.people-subtab,
.settings-subtab {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #536174;
  padding: 12px 2px 14px;
  font-size: 16px;
  font-weight: 700;
}

.project-subtab.is-active,
.progress-subtab.is-active,
.people-subtab.is-active,
.settings-subtab.is-active {
  background: transparent;
  color: #020817;
  box-shadow: none;
}

.project-subtab::after,
.progress-subtab::after,
.people-subtab::after,
.settings-subtab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  content: "";
}

.project-subtab.is-active::after,
.progress-subtab.is-active::after,
.people-subtab.is-active::after,
.settings-subtab.is-active::after {
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.project-panel {
  display: grid;
  gap: 16px;
}

#tab-project .project-panel {
  gap: 18px;
}

#tab-project .workspace {
  align-items: start;
}

#projectViewPackages .task-panel {
  overflow: hidden;
  border-color: #dbeafe;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.72), rgba(255, 255, 255, 0.96) 170px),
    #fff;
}

#projectViewPackages .panel-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px 16px;
}

#projectViewPackages .project-filters {
  grid-column: 1 / -1;
  justify-content: flex-start;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.people-panel,
.settings-panel {
  display: grid;
  gap: 16px;
}

.material-content {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.material-dashboard {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.gantt-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.gantt-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-dot.planned,
.gantt-bar.planned {
  background: var(--primary);
}

.legend-dot.done,
.gantt-bar.done {
  background: var(--success);
}

.legend-dot.overdue,
.gantt-bar.overdue {
  background: var(--danger);
}

.gantt-board {
  display: grid;
  gap: 12px;
  overflow-x: auto;
}

.route-map-panel {
  display: grid;
  gap: 16px;
}

.route-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.route-status {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.route-status.done,
.route-segment.done,
.route-progress-card.done::before {
  background: #16a34a;
  stroke: #16a34a;
}

.route-status.active,
.route-segment.active,
.route-progress-card.active::before {
  background: #2563eb;
  stroke: #2563eb;
}

.route-status.delayed,
.route-segment.delayed,
.route-progress-card.delayed::before {
  background: #f97316;
  stroke: #f97316;
}

.route-status.blocked,
.route-segment.blocked,
.route-progress-card.blocked::before {
  background: #dc2626;
  stroke: #dc2626;
}

.route-status.planned,
.route-segment.planned,
.route-progress-card.planned::before {
  background: #94a3b8;
  stroke: #94a3b8;
}

.route-map-board {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgb(37 99 235 / 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgb(37 99 235 / 0.08) 1px, transparent 1px),
    radial-gradient(circle at 15% 28%, rgb(34 197 94 / 0.2), transparent 18%),
    radial-gradient(circle at 68% 44%, rgb(14 165 233 / 0.18), transparent 16%),
    linear-gradient(135deg, #f8fafc 0%, #eef6e9 48%, #e0f2fe 100%);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

.route-map-board::before,
.route-map-board::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  pointer-events: none;
}

.route-map-board::before {
  right: -80px;
  bottom: -130px;
  width: 420px;
  height: 230px;
  background: rgb(14 165 233 / 0.22);
  transform: rotate(-12deg);
}

.route-map-board::after {
  left: 8%;
  top: 20%;
  width: 78%;
  border-top: 2px dashed rgb(15 23 42 / 0.18);
  transform: rotate(12deg);
}

.route-zone {
  position: absolute;
  z-index: 2;
  border: 1px solid rgb(37 99 235 / 0.2);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.84);
  box-shadow: 0 8px 18px rgb(15 23 42 / 0.08);
  color: #1e3a8a;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.zone-start {
  top: 26px;
  left: 34px;
}

.zone-mid {
  top: 78px;
  left: 46%;
}

.zone-end {
  right: 36px;
  bottom: 34px;
}

.route-map-svg {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
}

.route-base,
.route-segment {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-base {
  stroke: rgb(15 23 42 / 0.28);
  stroke-width: 18;
}

.route-segment {
  stroke-width: 10;
}

.route-marker circle {
  fill: #fff;
  stroke: #1e3a8a;
  stroke-width: 4;
}

.route-marker text {
  fill: #0f172a;
  font-size: 20px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgb(255 255 255 / 0.88);
  stroke-width: 5px;
  text-anchor: middle;
}

.route-marker.small text {
  font-size: 16px;
}

.route-marker.warning circle {
  stroke: #dc2626;
}

.route-marker.warning text {
  fill: #b91c1c;
}

.route-marker.end circle {
  stroke: #16a34a;
}

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

.route-progress-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.route-progress-card::before {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  content: "";
}

.route-progress-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.route-progress-card strong {
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
}

.route-progress-card p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.route-input-layout {
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(980px, 1fr);
  gap: 18px;
  align-items: start;
}

#progressViewRouteMap .route-input-layout {
  grid-template-columns: 1fr;
}

#progressViewRouteMap .route-segment-form {
  position: static;
  max-width: none;
}

#progressViewRouteMap .route-segment-form > label,
#progressViewRouteMap .route-segment-form > .field-grid,
#progressViewRouteMap .route-segment-form > .route-form-section {
  max-width: 1280px;
}

.route-segment-form {
  position: sticky;
  top: 16px;
}

.route-form-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.route-form-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

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

.route-output-panel {
  display: grid;
  gap: 18px;
}

.route-map-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  min-width: 1160px;
}

.route-map-title,
.route-map-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.route-map-title strong {
  border-radius: 8px;
  background: #06142d;
  color: #fff;
  padding: 10px 28px;
  font-size: 24px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.route-map-title span {
  border: 1px solid currentColor;
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--success);
  font-weight: 900;
  text-transform: uppercase;
}

.route-map-title span:last-child {
  color: var(--danger);
}

.route-linear-map {
  overflow-x: auto;
  padding: 26px 0 14px;
}

.route-track {
  display: flex;
  min-width: 1120px;
  align-items: stretch;
}

.route-track-segment {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 155px;
  padding: 0 10px 8px;
  text-align: center;
}

.route-distance {
  color: #06142d;
  font-weight: 900;
}

.route-line {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: #dbe5f3;
  overflow: hidden;
}

.route-line i {
  position: absolute;
  inset-block: 0;
  left: 0;
  border-radius: inherit;
  background: var(--primary);
}

.route-track-segment.done .route-line i {
  background: var(--success);
}

.route-track-segment.blocked .route-line i {
  background: var(--danger);
}

.route-track-segment.planned .route-line i {
  background: #94a3b8;
}

.route-track-segment strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  min-height: 38px;
}

.route-track-segment em,
.route-track-segment small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.route-pin {
  position: absolute;
  top: 30px;
  z-index: 2;
  border-radius: 999px;
  background: #fff;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}

.route-pin.start {
  left: 4px;
  color: var(--success);
}

.route-pin.end {
  right: 4px;
  color: var(--danger);
}

.route-map-footer {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-weight: 800;
}

.route-segment-table td strong,
.route-segment-table td span {
  display: block;
}

.route-segment-table {
  min-width: 1540px;
}

.route-segment-table th,
.route-segment-table td {
  vertical-align: top;
}

.route-row-done {
  background: #ecfdf3;
}

.route-row-blocked {
  background: #fff1f2;
}

.route-row-active {
  background: #eff6ff;
}

.route-row-planned {
  background: #f8fafc;
}

.gantt-scale {
  display: grid;
  grid-template-columns: 250px minmax(780px, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.gantt-scale-label {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
}

.gantt-axis {
  position: relative;
  height: 52px;
  border-bottom: 1px solid var(--line);
}

.gantt-months,
.gantt-ticks {
  position: absolute;
  inset-inline: 0;
}

.gantt-months {
  top: 0;
  height: 24px;
}

.gantt-ticks {
  bottom: 0;
  height: 24px;
}

.gantt-month {
  position: absolute;
  top: 0;
  height: 22px;
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  white-space: nowrap;
}

.gantt-ticks span {
  position: absolute;
  bottom: 4px;
  transform: translateX(-50%);
  white-space: nowrap;
  color: #64748b;
}

.gantt-rows {
  display: grid;
  gap: 10px;
}

.gantt-row {
  display: grid;
  grid-template-columns: 250px minmax(780px, 1fr);
  gap: 12px;
  align-items: center;
}

.gantt-row-alert {
  margin: -4px;
  padding: 4px;
  border-radius: 8px;
  background: #fef2f2;
  outline: 1px solid #fecaca;
}

.gantt-task {
  display: grid;
  gap: 4px;
  min-width: 0;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  padding-right: 8px;
}

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

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

.gantt-track {
  position: relative;
  height: 34px;
  border-radius: 8px;
  background: #eef2f7;
  overflow: hidden;
}

.gantt-bar {
  position: absolute;
  top: 5px;
  height: 24px;
  min-width: 56px;
  border-radius: 8px;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

tr.is-overdue-row {
  background: #fef2f2;
}

tr.is-overdue-row td {
  border-top-color: #fecaca;
  border-bottom-color: #fecaca;
}

.material-index-table {
  min-width: 1680px;
}

.mini-panel {
  padding: 16px;
  box-shadow: none;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
  margin: 16px 0 10px;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
  transition: width 0.2s ease;
}

.progress-track.small {
  height: 8px;
  margin: 6px 0 0;
}

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

.material-filters select {
  width: auto;
  min-width: 150px;
  padding: 8px 10px;
  font-size: 13px;
}

.project-filters {
  align-items: center;
}

.project-excel-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.file-import-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.project-filters input,
.project-filters select {
  width: auto;
  min-width: 220px;
  padding: 10px 12px;
  font-size: 14px;
}

.expense-filters {
  align-items: center;
}

.expense-filters input,
.expense-filters select {
  width: auto;
  min-width: 190px;
  padding: 10px 12px;
  font-size: 14px;
}

.expense-filters input[type="search"] {
  min-width: 280px;
}

.partner-filters {
  align-items: center;
}

.partner-filters input,
.partner-filters select {
  width: auto;
  min-width: 220px;
  padding: 10px 12px;
  font-size: 14px;
}

.partner-filters input[type="search"] {
  min-width: 360px;
}

.table-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.table-filters input,
.table-filters select {
  width: auto;
  min-width: 210px;
  padding: 10px 12px;
  font-size: 14px;
}

.library-panel table {
  min-width: 1320px;
}

.partner-table {
  min-width: 1280px;
}

.expense-table {
  min-width: 1360px;
}

.table-inline-input {
  min-width: 140px;
  max-width: 180px;
  padding: 9px 10px;
  font-weight: 700;
}

.paid-amount {
  color: var(--success);
  white-space: nowrap;
}

.payment-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.payment-toggle {
  border: 0;
  border-radius: 12px;
  background: #172033;
  color: #fff;
  padding: 11px 14px;
  font-weight: 800;
  white-space: nowrap;
}

.payment-toggle:hover {
  background: #020817;
}

.payment-toggle.is-paid {
  background: #16a34a;
  color: #fff;
}

.payment-toggle.is-paid:hover {
  background: #15803d;
}

.payment-toggle:disabled {
  cursor: default;
  opacity: 1;
}

.table-scroll tbody tr:not(.manage-detail-row) td > strong:first-child,
.table-scroll tbody tr:not(.manage-detail-row) td > span:not(.badge):not(.status-pill):not(.status-new):not(.overdue-text):not(.payment-pill) {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.payment-pill.pending {
  background: #f1f6fd;
  color: var(--muted);
}

.task-action.save {
  background: #eaf3ff;
  color: var(--primary);
}

.task-action.save:hover {
  background: #dbeafe;
}

tr.locked-row {
  background: #eff6ff;
}

tr.locked-row td {
  border-top-color: #bfdbfe;
  border-bottom-color: #bfdbfe;
}

.project-locked-row {
  position: relative;
}

.project-locked-row td {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #0f2f5f;
}

.project-locked-row td:first-child {
  box-shadow: inset 4px 0 0 #2563eb;
}

.project-locked-row:hover td {
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
}

.project-locked-row .project-chip,
.project-locked-row .project-step-select,
.project-locked-row .file-item {
  border-color: rgba(37, 99, 235, 0.24);
  background-color: rgba(255, 255, 255, 0.78);
}

.project-lock-pill,
.project-lock-note,
.project-row-lock-mark {
  display: inline-flex !important;
  align-items: center;
  width: fit-content;
  margin-top: 6px !important;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.project-lock-pill {
  padding: 6px 9px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  background: #dbeafe;
  color: #1d4ed8 !important;
}

.project-lock-note {
  padding: 4px 8px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: rgba(255, 255, 255, 0.72);
  color: #1e40af !important;
}

.project-row-lock-mark {
  padding: 4px 7px;
  background: #1d4ed8;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.project-lock-action {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.project-lock-action:hover {
  background: #dbeafe;
}

.project-unlock-action {
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.project-unlock-action:hover {
  background: #bbf7d0;
}

.project-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.project-meta span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  color: #0f172a;
  font-weight: 700;
}

.project-meta strong {
  color: #2563eb;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.project-table {
  min-width: 1900px;
  table-layout: fixed;
  font-size: 13.5px;
}

#projectViewPackages .table-scroll {
  max-height: calc(100vh - 240px);
  min-height: 560px;
  overflow: auto;
  border-color: #dbeafe;
  background: #f8fbff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.project-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #f8fbff, #eef6ff);
  color: #1f3b68;
  white-space: nowrap;
}

.project-table th,
.project-table td {
  vertical-align: top;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.project-table tbody tr td {
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.project-table tbody tr:not(.project-locked-row):hover td {
  background: #f8fbff;
}

.project-table th:nth-child(1),
.project-table td:nth-child(1) {
  width: 72px;
}

.project-table th:nth-child(2),
.project-table td:nth-child(2) {
  width: 330px;
}

.project-table th:nth-child(3),
.project-table td:nth-child(3) {
  width: 145px;
}

.project-table th:nth-child(4),
.project-table td:nth-child(4) {
  width: 108px;
}

.project-table th:nth-child(5),
.project-table td:nth-child(5),
.project-table th:nth-child(6),
.project-table td:nth-child(6),
.project-table th:nth-child(7),
.project-table td:nth-child(7) {
  width: 135px;
}

.project-table th:nth-child(8),
.project-table td:nth-child(8) {
  width: 115px;
}

.project-table th:nth-child(9),
.project-table td:nth-child(9) {
  width: 250px;
}

.project-table th:nth-child(10),
.project-table td:nth-child(10) {
  width: 150px;
}

.project-table th:nth-child(11),
.project-table td:nth-child(11),
.project-table th:nth-child(12),
.project-table td:nth-child(12) {
  width: 96px;
}

.project-table td:nth-child(6),
.project-table td:nth-child(10) {
  white-space: normal;
}

.project-table th:nth-child(13),
.project-table td:nth-child(13) {
  width: 150px;
}

.project-table th:nth-child(14),
.project-table td:nth-child(14) {
  width: 104px;
}

.project-name-cell strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  max-width: 100%;
}

.project-code-cell strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.project-name-cell {
  min-width: 0;
}

.project-step-select {
  width: 86px;
  min-width: 86px;
  border: 0;
  border-radius: 999px;
  padding: 8px 28px 8px 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  outline: 2px solid transparent;
  appearance: auto;
}

.project-step-select:focus {
  outline-color: #93c5fd;
}

.project-step-select:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.project-step-select.step-prefs {
  background: #dbeafe;
  color: #1d4ed8;
}

.project-step-select.step-fs {
  background: #dcfce7;
  color: #15803d;
}

.project-step-select.step-tkkt {
  background: #fef3c7;
  color: #a16207;
}

.project-step-select.step-tkbvtc {
  background: #fee2e2;
  color: #b91c1c;
}

.project-step-select.step-gpmb {
  background: #ede9fe;
  color: #6d28d9;
}

.project-step-select.step-empty {
  background: #f1f5f9;
  color: #64748b;
}

.project-table td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.project-chip {
  display: inline-flex !important;
  margin: 0 !important;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb !important;
  font-weight: 800;
}

.project-table .row-actions {
  gap: 6px;
}

.project-table .row-actions .task-action {
  min-height: 30px;
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 12px;
}

.filter {
  padding: 8px 10px;
  font-size: 13px;
}

.filter.is-active {
  background: linear-gradient(135deg, var(--primary), #178bff);
  color: #fff;
}

.filter.type-recurring {
  background: #fef3c7;
  color: #92400e;
}

.filter.type-recurring.is-active {
  background: #d97706;
  color: #fff;
}

.filter.type-normal {
  background: #dcfce7;
  color: #166534;
}

.filter.type-normal.is-active {
  background: #16a34a;
  color: #fff;
}

.filter.is-overdue {
  background: #fee2e2;
  color: #991b1b;
}

.filter.is-overdue.is-active {
  background: #dc2626;
  color: #fff;
}

.task-list,
.people-list,
.project-list,
.compact-list {
  display: grid;
  gap: 12px;
}

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

.assigned-task-table {
  width: 100%;
  min-width: 1420px;
  border-collapse: collapse;
  table-layout: fixed;
}

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

.assigned-task-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

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

.assigned-task-table tr.is-completed td {
  background: #f0fdf4;
}

.assigned-task-table tr.assigned-detail-row td {
  background: #f8fafc;
  padding-top: 0;
}

.assigned-task-table tr.assigned-detail-row.is-hidden {
  display: none;
}

.assigned-task-table .date-cell {
  width: 96px;
  color: var(--muted);
  font-weight: 700;
}

.assigned-task-name {
  width: 310px;
}

.assigned-task-name strong,
.assigned-task-source strong,
.assigned-task-name span,
.assigned-task-source span {
  display: block;
  overflow-wrap: anywhere;
}

.assigned-task-name strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.assigned-task-name span,
.assigned-task-source span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.assigned-task-detail {
  display: grid;
  gap: 6px;
  max-width: 980px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.assigned-task-detail p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.assigned-task-detail strong {
  color: var(--text);
}

.assigned-actions {
  min-width: 220px;
}

.manage-task-name strong,
.manage-task-source strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.manage-task-name span,
.manage-task-source span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.manage-detail-row.is-hidden {
  display: none;
}

.manage-detail-row td {
  background: #f8fafc;
  padding: 14px;
}

.manage-task-detail {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.9fr) minmax(240px, 1fr) minmax(190px, 0.8fr) minmax(220px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.manage-task-detail section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.manage-task-detail section > strong {
  color: var(--text);
  font-size: 13px;
}

.manage-task-detail p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-card,
.person-card,
.project-card,
.compact-list article {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: var(--shadow-soft);
}

.task-card.done {
  border-color: #86efac;
  border-left: 5px solid #16a34a;
  background: #f0fdf4;
}

.task-main {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.task-title {
  margin-bottom: 7px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.task-description {
  margin-bottom: 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.badges,
.task-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge,
.status-pill {
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.priority-high {
  background: #fee2e2;
  color: #991b1b;
}

.badge.priority-low {
  background: #dcfce7;
  color: #166534;
}

.badge.task-type-recurring {
  background: #fef3c7;
  color: #92400e;
}

.badge.task-type-normal {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.workflow-badge {
  background: #f1f5f9;
  color: #334155;
}

.status-pill.completed {
  background: #16a34a;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.16);
}

.status-pill.not_completed {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.processing {
  background: #eef2ff;
  color: #3730a3;
}

.status-pill.pending {
  background: #fff7ed;
  color: #c2410c;
}

.status-pill.revision {
  background: #fee2e2;
  color: #b91c1c;
}

.status-pill.approved {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-new {
  display: inline-flex;
  margin-top: 7px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.task-action.delete {
  background: #fee2e2;
  color: var(--danger);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

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

.material-table {
  min-width: 1320px;
}

.material-entry-table {
  min-width: 980px;
}

.material-row-ok td {
  background: #f0fdf4;
}

.material-row-warning td {
  background: #fffbeb;
}

.material-row-shortage td {
  background: #fef2f2;
}

.material-status-ok,
.material-progress-ok {
  background: #16a34a;
  color: #fff;
}

.material-status-warning,
.material-progress-warning {
  background: #d97706;
  color: #fff;
}

.material-status-shortage,
.material-progress-shortage {
  background: #dc2626;
  color: #fff;
}

.source-surplus {
  color: #15803d;
  font-weight: 800;
}

.source-shortage {
  color: #dc2626;
  font-weight: 800;
}

.assessment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 220px;
}

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

th {
  background: #f6f9fd;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

tbody tr:hover td {
  background: #f8fbff;
}

tr.is-completed td {
  background: #f0fdf4;
}

.email-snippet {
  display: -webkit-box;
  max-width: 420px;
  overflow: hidden;
  color: #475569;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.email-sender {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-snippet.is-expanded {
  display: block;
  max-width: 620px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
}

.inline-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-weight: 800;
  padding: 6px 0 0;
}

tr.is-completed td:first-child {
  border-left: 4px solid #16a34a;
}

td strong,
td span {
  display: block;
}

td span,
.muted,
.file-list {
  color: var(--muted);
  font-size: 13px;
}

.overdue-text {
  display: inline-block;
  margin-top: 4px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 800;
}

.file-upload {
  display: inline-block;
  margin-bottom: 8px;
}

.file-upload input {
  display: none;
}

.result-note {
  min-width: 220px;
  min-height: 78px;
  margin-bottom: 8px;
  resize: vertical;
}

.workflow-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 320px;
}

.workflow-action-bar .choice {
  background: #eef5ff;
  color: #172033;
}

.workflow-action-bar .choice.is-selected {
  background: #06142d;
  color: #fff;
}

.workflow-action-bar .save {
  background: linear-gradient(135deg, var(--primary), #178bff);
  color: #fff;
}

.workflow-action-bar .revoke {
  background: #fff7ed;
  color: #c2410c;
}

.workflow-action-bar .revoke:hover {
  background: #fed7aa;
}

.task-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.task-action:disabled:hover {
  transform: none;
}

#taskTableBody td {
  padding-top: 10px;
  padding-bottom: 10px;
}

#taskTableBody td:first-child {
  min-width: 220px;
  max-width: 280px;
}

#taskTableBody td:first-child strong {
  line-height: 1.25;
}

#taskTableBody .result-note {
  min-height: 58px;
  max-height: 92px;
  margin-bottom: 6px;
}

#taskTableBody .workflow-action-bar {
  min-width: 250px;
  gap: 6px;
  align-items: flex-start;
}

#taskTableBody .workflow-action-bar .task-action,
#taskTableBody .file-upload span {
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
}

#taskTableBody .file-upload {
  margin-bottom: 5px;
}

.file-list a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.project-contract-file {
  display: inline-flex !important;
  margin: 0 6px 6px 0 !important;
}

.project-contract-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  padding: 5px 9px;
  color: #1d4ed8 !important;
  font-size: 12px;
  font-weight: 900 !important;
  white-space: nowrap;
}

.project-contract-link:hover {
  background: #dbeafe;
}

.project-contract-icon {
  display: inline-block !important;
  width: 13px;
  height: 15px;
  margin: 0 !important;
  border: 2px solid currentColor;
  border-radius: 2px;
  position: relative;
}

.project-contract-icon::after {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 5px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: #eff6ff;
  content: "";
}

.project-contract-file .file-remove {
  padding: 3px 7px;
}

.file-item-warning {
  align-items: flex-start;
  border-left: 3px solid #f59e0b;
  color: #92400e;
  font-size: 12px;
  line-height: 1.35;
  padding-left: 7px;
}

.file-item-warning a {
  white-space: nowrap;
}

.file-remove {
  border: 0;
  border-radius: 999px;
  background: #fee2e2;
  color: #dc2626;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
}

.file-remove:hover {
  background: #fecaca;
}

.user-person-hint {
  display: block;
  margin-top: 6px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.person-card {
  grid-template-columns: 76px 1fr auto;
  align-items: center;
}

.project-card {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.project-card h3 {
  margin-bottom: 8px;
}

.project-card p,
.compact-list p {
  margin-bottom: 6px;
  color: var(--muted);
}

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

.settings-block {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.settings-block .primary-button {
  justify-self: stretch;
}

.settings-block + .settings-block {
  margin-top: 2px;
}

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

.settings-block .form-head,
.settings-table-section .form-head {
  margin-bottom: 0;
}

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

.settings-actions .ghost-button,
.settings-actions .primary-button {
  padding: 8px 10px;
}

.settings-table-section h3 {
  margin-bottom: 3px;
  font-size: 16px;
}

.settings-edit-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.settings-edit-table table {
  min-width: 620px;
}

.settings-edit-table th,
.settings-edit-table td {
  padding: 6px;
}

.settings-edit-table input {
  min-width: 92px;
  padding: 8px 9px;
}

.settings-info p {
  margin-bottom: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.settings-info strong {
  color: var(--text);
}

.settings-saved-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.settings-saved-list span {
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.workflow-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(260px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.workflow-column {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.workflow-column header {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.workflow-column header strong {
  color: var(--primary);
}

.workflow-column header span {
  min-height: 42px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.workflow-column header em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

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

.workflow-card,
.workflow-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.workflow-card h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.workflow-card p {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
}

.workflow-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.workflow-progress {
  margin-top: 8px;
}

.workflow-progress span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.workflow-warning {
  margin-top: 8px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 800;
}

.workflow-source {
  margin-top: 8px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.workflow-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.workflow-empty {
  color: var(--muted);
  font-size: 13px;
}

.compact-list article strong,
.compact-list article span {
  display: block;
}

.compact-list article span {
  color: var(--muted);
  font-size: 13px;
}

.person-photo {
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 8px;
  background: #eef2f7;
}

.person-photo img,
.avatar-placeholder {
  width: 100%;
  height: 100%;
}

.person-photo img {
  object-fit: cover;
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 26px;
  font-weight: 800;
}

.person-info h3 {
  margin-bottom: 6px;
}

.person-info p {
  margin-bottom: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.empty-state {
  display: none;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 42px 18px;
  text-align: center;
  color: var(--muted);
  background: #fbfdff;
}

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

@media (max-width: 900px) {
  .topbar,
  .topbar-actions,
  .workspace,
  .material-content,
  .route-input-layout,
  .task-main,
  .panel-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .card-form {
    position: static;
  }

  .filters {
    justify-content: flex-start;
  }

  .person-card {
    grid-template-columns: 64px 1fr;
  }

  .person-card .task-actions,
  .project-card .task-actions {
    grid-column: 1 / -1;
  }

  .stat-grid,
  .dashboard-grid,
  .project-card,
  .route-progress-grid {
    grid-template-columns: 1fr;
  }

  .route-map-board {
    min-height: 360px;
    overflow-x: auto;
  }

  .route-map-svg {
    min-width: 760px;
  }

  .route-segment-form {
    position: static;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1220px);
    padding: 16px 0;
  }

  h1 {
    font-size: 28px;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab-button {
    white-space: nowrap;
  }

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

/* Long Thanh - Ho Tram redesigned shell */
:root {
  --app-bg: #f4f7fd;
  --sidebar: #073b7b;
  --sidebar-deep: #062f67;
  --sidebar-active: rgba(255, 255, 255, 0.14);
  --ink: #14213d;
  --ink-soft: #667390;
  --card: #ffffff;
  --blue: #5b78ff;
  --blue-strong: #4166ee;
  --green: #04a87f;
  --mint: #e7fbf3;
  --red: #ff5e56;
  --orange-soft: #fff0ea;
  --stroke: #e7edf7;
  --table-head: #f8fbff;
  --new-shadow: 0 18px 46px rgba(43, 63, 111, 0.08);
  --card-shadow: 0 10px 28px rgba(55, 79, 128, 0.07);
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 70% -10%, rgba(91, 120, 255, 0.12), transparent 36%),
    linear-gradient(135deg, #f9fbff 0%, var(--app-bg) 44%, #eef4ff 100%);
  color: var(--ink);
  font-size: 14px;
}

.app-shell {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  gap: 0;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  margin: 14px 0 14px 14px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(19, 89, 174, 0.96), rgba(3, 55, 124, 0.98) 46%, #043d91 100%);
  box-shadow: 16px 18px 40px rgba(5, 44, 103, 0.22);
}

.app-main {
  min-width: 0;
  padding: 40px 34px 34px;
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 28px 26px 24px;
  color: #fff;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0ba5ff, #356cff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32), 0 10px 26px rgba(7, 20, 49, 0.18);
  font-weight: 900;
}

.brand-block strong,
.brand-block span {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.tabs {
  position: fixed;
  z-index: 30;
  top: 118px;
  left: 34px;
  display: grid;
  width: 236px;
  gap: 8px;
  margin: 0;
  border: 0;
  overflow: visible;
}

.tab-button,
.work-subtab {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  white-space: normal;
}

.tab-button::before,
.work-subtab::before {
  display: grid;
  flex: 0 0 22px;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: inherit;
  font-size: 13px;
  content: "□";
}

.tab-button[data-tab="stats"]::before { content: "⌂"; }
.tab-button[data-tab="work"]::before { content: "▣"; }
.tab-button[data-tab="materials"]::before { content: "⌘"; }
.tab-button[data-tab="progress"]::before { content: "◌"; }
.tab-button[data-tab="people"]::before { content: "♙"; }
.tab-button[data-tab="partners"]::before { content: "◇"; }
.tab-button[data-tab="project"]::before { content: "▤"; }
.tab-button[data-tab="settings"]::before { content: "⚙"; }

.tab-button.is-active,
.work-subtab.is-active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tab-button.is-active::before,
.work-subtab.is-active::before {
  background: rgba(255, 255, 255, 0.2);
}

.tab-button::after,
.work-subtab::after,
.material-subtab::after,
.project-subtab::after,
.progress-subtab::after,
.people-subtab::after,
.settings-subtab::after {
  display: none;
}

.work-subtabs {
  position: fixed;
  z-index: 31;
  top: 220px;
  left: 54px;
  display: grid;
  width: 216px;
  gap: 7px;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.work-subtab {
  min-height: 42px;
  padding-left: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
}

.work-subtab::before {
  width: 18px;
  height: 18px;
  font-size: 11px;
  content: "▢";
}

.topbar {
  align-items: center;
  margin: 0 0 26px;
  padding: 0;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--blue);
  letter-spacing: 0.02em;
  text-transform: none;
}

h1 {
  color: var(--ink);
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: 0;
}

h2 {
  color: var(--ink);
  font-size: 20px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.top-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 330px;
  height: 46px;
  color: #94a1b8;
  font-size: 14px;
  font-weight: 700;
}

.top-search span {
  position: absolute;
  left: 16px;
  z-index: 1;
}

.top-search input {
  height: 100%;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  padding: 0 44px;
  box-shadow: 0 10px 24px rgba(36, 56, 97, 0.05);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--stroke);
  border-radius: 50%;
  background: #fff;
  color: #7b89a6;
  box-shadow: var(--card-shadow);
}

.notification-button {
  position: relative;
}

.notification-button::after {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ff4159;
  content: "";
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 164px;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd69c, #5978ff);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--card-shadow);
}

.user-chip strong,
.user-chip span {
  display: block;
  line-height: 1.25;
}

.user-chip strong {
  color: #263654;
  font-size: 14px;
}

.user-chip span {
  color: #8b97ad;
  font-size: 12px;
  font-weight: 700;
}

.storage-pill {
  max-width: 260px;
  border-color: var(--stroke);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  padding: 9px 13px;
  box-shadow: none;
}

.primary-button,
.ghost-button,
.filter,
.task-action,
.file-upload span,
.payment-toggle {
  border-radius: 8px;
  font-size: 13px;
}

.primary-button {
  background: linear-gradient(135deg, #6b86ff, #4e6df1);
  box-shadow: 0 14px 28px rgba(79, 109, 241, 0.22);
}

.quick-create-button {
  min-height: 46px;
  padding-inline: 20px;
}

.ghost-button,
.filter,
.task-action,
.file-upload span {
  background: #f5f8fe;
  color: #54627a;
}

.card-form,
.task-panel,
.table-panel,
.dashboard-panel,
.mini-panel,
.workflow-panel,
.gantt-panel,
.material-dashboard,
.settings-block,
.route-map-card {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--new-shadow);
}

.card-form {
  gap: 15px;
  padding: 22px;
}

.task-panel,
.table-panel,
.dashboard-panel,
.workflow-panel,
.gantt-panel {
  padding: 24px;
}

.panel-head,
.form-head {
  align-items: center;
  margin-bottom: 18px;
}

.panel-head p,
.form-head p,
#assignSummary,
#manageSummary,
#peopleSummary,
#projectSummary,
#materialSummary,
#expenseSummary,
.field-hint,
.message {
  color: var(--ink-soft);
}

input,
select,
textarea {
  border-color: var(--stroke);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
  padding: 11px 13px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #8fa2ff;
  box-shadow: 0 0 0 4px rgba(91, 120, 255, 0.12);
}

.stat-grid {
  gap: 18px;
  margin-bottom: 20px;
}

.stat-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  min-height: 128px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fff;
  padding: 22px 24px;
  box-shadow: var(--card-shadow);
}

.stat-card::before {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: #edf3ff;
  color: var(--blue);
  font-size: 22px;
  content: "▣";
}

.stat-card:nth-child(2)::before {
  background: var(--mint);
  color: var(--green);
  content: "✓";
}

.stat-card:nth-child(3)::before {
  background: #eef1ff;
  color: var(--blue);
  content: "↻";
}

.stat-card:nth-child(4)::before {
  background: var(--orange-soft);
  color: var(--red);
  content: "!";
}

.stat-card span {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.stat-card strong {
  grid-column: 2;
  grid-row: 1;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.table-scroll,
.assigned-task-table-wrap,
.settings-edit-table {
  border-color: var(--stroke);
  border-radius: 12px;
  background: #fff;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  border-bottom: 1px solid var(--stroke);
  background: var(--table-head);
  color: #8290aa;
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

td {
  border-bottom: 1px solid var(--stroke);
  color: #2c3c59;
  font-size: 13px;
}

tbody tr:hover td {
  background: #fbfdff;
}

.badge,
.status-pill,
.payment-pill,
.project-chip {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.completed,
.material-status-ok,
.material-progress-ok,
.payment-toggle.is-paid {
  background: var(--green);
}

.status-pill.not_completed {
  background: #eaf2ff;
  color: #5173f2;
}

.overdue-text,
.status-new {
  color: var(--red);
}

.empty-state {
  border-color: #dbe4f5;
  border-radius: 12px;
  background: #fbfdff;
}

.material-subtabs,
.project-subtabs,
.progress-subtabs,
.people-subtabs,
.settings-subtabs {
  gap: 10px;
  border: 0;
  overflow-x: auto;
}

.material-subtab,
.project-subtab,
.progress-subtab,
.people-subtab,
.settings-subtab {
  border-radius: 8px;
  background: #eef4ff;
  color: #64738f;
  padding: 11px 14px;
  font-size: 13px;
}

.material-subtab.is-active,
.project-subtab.is-active,
.progress-subtab.is-active,
.people-subtab.is-active,
.settings-subtab.is-active {
  background: #fff;
  color: var(--blue-strong);
  box-shadow: inset 0 0 0 1px #dfe7ff;
}

.login-page {
  background:
    linear-gradient(135deg, rgba(5, 58, 128, 0.94), rgba(50, 93, 220, 0.86)),
    var(--app-bg);
}

.login-card {
  border-color: rgba(255, 255, 255, 0.42);
  border-radius: 12px;
  box-shadow: 0 26px 80px rgba(5, 26, 68, 0.28);
}

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

  .app-sidebar {
    position: static;
    height: auto;
    margin: 10px;
    padding-bottom: 10px;
  }

  .tabs,
  .work-subtabs {
    position: static;
    display: flex;
    width: auto;
    margin: 0 18px 10px;
    overflow-x: auto;
  }

  .work-subtabs {
    padding-bottom: 4px;
  }

  .tab-button,
  .work-subtab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .app-main {
    padding: 20px;
  }
}

@media (max-width: 760px) {
  .topbar-actions,
  .top-search,
  .user-chip,
  .storage-pill {
    width: 100%;
    min-width: 0;
  }

  .stat-card,
  .workspace,
  #tab-settings .workspace {
    grid-template-columns: 1fr;
  }

  .stat-card strong,
  .stat-card span {
    grid-column: auto;
    grid-row: auto;
  }
}

/* Sidebar flow fix: keep work subtabs nested under Cong viec */
.tabs {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
}

.tabs .work-subtabs,
.work-subtabs {
  position: static;
  z-index: auto;
  display: grid;
  width: auto;
  gap: 6px;
  margin: -2px 0 8px 32px;
  padding: 0;
  overflow: visible;
}

.tabs .work-subtab,
.work-subtab {
  min-height: 34px;
  border-radius: 7px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1.2;
}

.tabs .work-subtab::before,
.work-subtab::before {
  flex-basis: 16px;
  width: 16px;
  height: 16px;
  font-size: 10px;
}

.tabs .work-subtab.is-active {
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 1180px) {
  .tabs .work-subtabs,
  .work-subtabs {
    flex: 0 0 100%;
    display: flex;
    width: 100%;
    margin: -2px 18px 8px;
    overflow-x: auto;
  }
}

/* SaaS dashboard refinement: Notion / Linear / Vercel inspired */
:root {
  --app-bg: #f6f7fb;
  --sidebar: #ffffff;
  --sidebar-active: #eef2ff;
  --ink: #111827;
  --ink-soft: #6b7280;
  --blue: #4f46e5;
  --blue-strong: #4338ca;
  --stroke: #e5e7eb;
  --table-head: #fafafa;
  --new-shadow: 0 18px 45px rgba(17, 24, 39, 0.06);
  --card-shadow: 0 10px 28px rgba(17, 24, 39, 0.05);
}

body {
  background:
    radial-gradient(circle at 74% 0%, rgba(79, 70, 229, 0.08), transparent 34%),
    linear-gradient(180deg, #fbfbfd 0%, var(--app-bg) 100%);
}

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

.app-sidebar {
  margin: 12px 0 12px 12px;
  border: 1px solid rgba(229, 231, 235, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(18px);
}

.app-sidebar::after {
  position: absolute;
  right: 22px;
  bottom: 20px;
  left: 22px;
  height: 1px;
  background: var(--stroke);
  content: "";
}

.app-main {
  padding: 38px 38px 34px;
}

.brand-block {
  padding: 24px 22px 22px;
  color: var(--ink);
}

.brand-mark {
  width: 58px;
  height: 58px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: linear-gradient(135deg, #111827, #4f46e5);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 14px 28px rgba(79, 70, 229, 0.18);
}

.brand-block strong,
.brand-block span {
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0;
}

.brand-block span {
  color: #374151;
}

.tabs {
  left: 26px;
  top: 116px;
  width: 258px;
  gap: 6px;
  max-height: calc(100vh - 142px);
  padding: 0 4px 36px 0;
}

.tab-button,
.work-subtab {
  min-height: 50px;
  border-radius: 10px;
  color: #5f6676;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 750;
}

.tab-button:hover,
.work-subtab:hover {
  background: var(--nav-bg, #f3f4f6);
  color: #111827;
}

.tab-button::after,
.work-subtab::after {
  display: block;
  position: absolute;
  left: 12px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--nav-bg, #f3f4f6);
  content: "";
  opacity: 0.95;
}

.tab-button,
.work-subtab {
  position: relative;
}

.tab-button::before,
.work-subtab::before {
  position: relative;
  z-index: 1;
}

.tab-button::before,
.work-subtab::before {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background-color: var(--nav-color, #64748b);
  content: "";
  -webkit-mask: var(--nav-icon) center / 23px 23px no-repeat;
  mask: var(--nav-icon) center / 23px 23px no-repeat;
}

.tab-button[data-tab="stats"] { --nav-color: #2563eb; --nav-bg: #eff6ff; --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13h8V3H3z'/%3E%3Cpath d='M13 21h8V11h-8z'/%3E%3Cpath d='M13 3h8v4h-8z'/%3E%3Cpath d='M3 17h8v4H3z'/%3E%3C/svg%3E"); }
.tab-button[data-tab="work"] { --nav-color: #10b981; --nav-bg: #ecfdf5; --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11l3 3L22 4'/%3E%3Cpath d='M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11'/%3E%3C/svg%3E"); }
.tab-button[data-tab="materials"] { --nav-color: #f97316; --nav-bg: #fff7ed; --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z'/%3E%3Cpath d='M3.3 7L12 12l8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E"); }
.tab-button[data-tab="progress"] { --nav-color: #06b6d4; --nav-bg: #ecfeff; --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 15l4-4 4 3 5-7'/%3E%3C/svg%3E"); }
.tab-button[data-tab="people"] { --nav-color: #8b5cf6; --nav-bg: #f5f3ff; --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.tab-button[data-tab="partners"] { --nav-color: #64748b; --nav-bg: #f8fafc; --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 16l3-8 3 8c-.87.65-1.87 1-3 1s-2.13-.35-3-1z'/%3E%3Cpath d='M2 16l3-8 3 8c-.87.65-1.87 1-3 1s-2.13-.35-3-1z'/%3E%3Cpath d='M7 21h10'/%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2'/%3E%3C/svg%3E"); }
.tab-button[data-tab="project"] { --nav-color: #4f46e5; --nav-bg: #eef2ff; --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18'/%3E%3Cpath d='M5 21V7l8-4v18'/%3E%3Cpath d='M19 21V11l-6-4'/%3E%3Cpath d='M9 9v.01'/%3E%3Cpath d='M9 13v.01'/%3E%3Cpath d='M9 17v.01'/%3E%3C/svg%3E"); }
.tab-button[data-tab="settings"] { --nav-color: #14b8a6; --nav-bg: #f0fdfa; --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06A1.65 1.65 0 0 0 15 19.4a1.65 1.65 0 0 0-1 .6 1.65 1.65 0 0 0-.33 1.06V22a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 8 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.6 15a1.65 1.65 0 0 0-.6-1 1.65 1.65 0 0 0-1.06-.33H2a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 8a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.6a1.65 1.65 0 0 0 1-.6A1.65 1.65 0 0 0 10.33 3V2a2 2 0 1 1 4 0v.09A1.65 1.65 0 0 0 16 4.6a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9c.36.13.7.33 1 .6.3.27.68.4 1.06.4H22a2 2 0 1 1 0 4h-.09A1.65 1.65 0 0 0 19.4 15z'/%3E%3C/svg%3E"); }
.work-subtab { --nav-color: #3b82f6; --nav-bg: #eff6ff; --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h13'/%3E%3Cpath d='M8 12h13'/%3E%3Cpath d='M8 18h13'/%3E%3Cpath d='M3 6h.01'/%3E%3Cpath d='M3 12h.01'/%3E%3Cpath d='M3 18h.01'/%3E%3C/svg%3E"); }

.tab-button.is-active,
.work-subtab.is-active {
  background: var(--nav-bg, var(--sidebar-active));
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.07);
}

.tab-button.is-active::before,
.work-subtab.is-active::before {
  background: var(--nav-color, var(--blue-strong));
}

.tabs .work-subtabs,
.work-subtabs {
  margin: 0 0 8px 42px;
  gap: 4px;
}

.tabs .work-subtab,
.work-subtab {
  min-height: 38px;
  border-radius: 9px;
  padding: 0 10px;
  color: #737b8d;
  font-size: 13px;
}

.tabs .work-subtab::before,
.work-subtab::before {
  flex-basis: 24px;
  width: 24px;
  height: 24px;
  -webkit-mask-size: 18px 18px;
  mask-size: 18px 18px;
}

.top-search input,
.storage-pill,
.icon-button,
.user-avatar,
.card-form,
.task-panel,
.table-panel,
.dashboard-panel,
.mini-panel,
.workflow-panel,
.gantt-panel,
.material-dashboard,
.settings-block,
.route-map-card {
  box-shadow: 0 12px 34px rgba(17, 24, 39, 0.05);
}

.card-form,
.task-panel,
.table-panel,
.dashboard-panel,
.mini-panel,
.workflow-panel,
.gantt-panel,
.material-dashboard,
.settings-block,
.route-map-card {
  border-color: #e6e8ee;
}

.primary-button {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.22);
}

.primary-button:hover {
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
}

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

@media (max-width: 1180px) {
  .app-sidebar {
    margin: 10px;
  }

  .tabs {
    width: auto;
    padding: 0 8px 8px;
  }

  .tabs .work-subtabs,
  .work-subtabs {
    margin: 0 12px 8px;
  }
}

/* Readability pass: stronger black text */
:root {
  --ink: #05070d;
  --ink-soft: #1f2937;
}

body,
input,
select,
textarea,
button {
  color: var(--ink);
}

h1,
h2,
h3,
label,
td strong,
.task-title,
.panel-head h2,
.form-head h2,
.brand-block strong,
.brand-block span,
.user-chip strong {
  color: #05070d;
  font-weight: 800;
}

.tab-button,
.work-subtab,
.material-subtab,
.project-subtab,
.progress-subtab,
.people-subtab,
.settings-subtab {
  color: #111827;
  font-weight: 800;
}

.tab-button:hover,
.work-subtab:hover {
  color: #05070d;
}

.tab-button.is-active,
.work-subtab.is-active,
.material-subtab.is-active,
.project-subtab.is-active,
.progress-subtab.is-active,
.people-subtab.is-active,
.settings-subtab.is-active {
  color: #05070d;
}

th {
  color: #111827;
  font-weight: 850;
}

td {
  color: #111827;
  font-weight: 600;
}

td span,
.muted,
.file-list,
.panel-head p,
.form-head p,
.field-hint,
.message,
.user-chip span,
.storage-pill,
#assignSummary,
#manageSummary,
#peopleSummary,
#projectSummary,
#materialSummary,
#expenseSummary {
  color: #374151;
  font-weight: 650;
}

input::placeholder,
textarea::placeholder {
  color: #4b5563;
  opacity: 1;
}

#storagePath {
  display: none !important;
}

.notification-button {
  display: none !important;
}

.overall-main-row td:first-child strong,
.overall-main-gantt .gantt-task strong {
  font-weight: 900;
}

.overall-subitem-row td:first-child {
  padding-left: 34px;
}

.overall-subitem-row td:first-child strong::before,
.overall-subitem-gantt .gantt-task strong::before {
  color: #6b7280;
  content: "↳ ";
}

.overall-subitem-row td:first-child span,
.overall-main-row td:first-child span {
  display: block;
  margin-top: 4px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 750;
}

.overall-subitem-gantt .gantt-task {
  padding-left: 28px;
}

.overall-subitem-gantt .gantt-bar {
  opacity: 0.88;
}

/* Cleaner separated status/type cells */
.assigned-task-table th:nth-child(7),
.assigned-task-table th:nth-child(8),
.assigned-task-table td:nth-child(7),
.assigned-task-table td:nth-child(8) {
  text-align: center;
  white-space: nowrap;
}

.assigned-task-table td:nth-child(7),
.assigned-task-table td:nth-child(8) {
  min-width: 128px;
  padding-inline: 10px;
  vertical-align: middle;
}

.assigned-task-table th:nth-child(6),
.assigned-task-table td:nth-child(6) {
  min-width: 132px;
  width: 132px;
  text-align: center;
}

.assigned-task-table th:nth-child(9),
.assigned-task-table td.assigned-actions {
  min-width: 116px;
  width: 116px;
  background: inherit;
  vertical-align: middle;
  text-align: center;
}

.assigned-task-table td:nth-child(7),
.assigned-task-table td:nth-child(8),
.assigned-task-table td.assigned-actions {
  height: 1px;
}

.assigned-task-table td:nth-child(7) > .status-pill,
.assigned-task-table td:nth-child(8) > .badge,
.assigned-task-table td.assigned-actions > .assigned-action-bar {
  margin: auto;
}

.assigned-task-table .status-pill,
.assigned-task-table .badge,
#taskTableBody .status-pill,
#taskTableBody .badge.task-type-normal,
#taskTableBody .badge.task-type-recurring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 30px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.45);
}

.assigned-task-table .assigned-action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.assigned-task-table .assigned-action-bar .task-action {
  min-width: 82px;
  min-height: 32px;
  padding: 8px 12px;
  border: 1px solid #e8edf5;
  background: #f7f9fd;
  color: #334155;
  text-align: center;
  white-space: nowrap;
}

.assigned-task-table .assigned-action-bar .delete {
  min-width: 70px;
  border-color: #fecaca;
  background: #fee2e2;
  color: #dc2626;
}

.assigned-task-detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.assigned-detail-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

.assigned-detail-actions .task-action {
  min-width: 92px;
  min-height: 34px;
  border: 1px solid #e8edf5;
  background: #f7f9fd;
  color: #334155;
}

.assigned-detail-actions .delete {
  min-width: 76px;
  border-color: #fecaca;
  background: #fee2e2;
  color: #dc2626;
}

.assigned-task-table tr.is-completed td.assigned-actions {
  background: #ecfdf3;
}

.assigned-task-table .status-pill.completed,
#taskTableBody .status-pill.completed {
  background: #10b981;
  color: #fff;
}

.assigned-task-table .status-pill.processing,
.assigned-task-table .status-pill.not_completed,
#taskTableBody .status-pill.processing,
#taskTableBody .status-pill.not_completed {
  background: #eef2ff;
  color: #4338ca;
}

.assigned-task-table .status-pill.pending,
#taskTableBody .status-pill.pending {
  background: #fff7ed;
  color: #c2410c;
}

.assigned-task-table .status-pill.revision,
#taskTableBody .status-pill.revision {
  background: #fee2e2;
  color: #b91c1c;
}

.assigned-task-table .status-pill.approved,
#taskTableBody .status-pill.approved {
  background: #dbeafe;
  color: #1d4ed8;
}

.assigned-task-table .badge.task-type-normal,
#taskTableBody .badge.task-type-normal {
  background: #e0ebff;
  color: #1d4ed8;
}

.assigned-task-table .badge.task-type-recurring,
#taskTableBody .badge.task-type-recurring {
  background: #fef3c7;
  color: #92400e;
}

/* Default desktop scale and email table scrolling */
@media (min-width: 761px) {
  html {
    zoom: 0.8;
  }
}

#tab-email .table-panel {
  min-height: calc(100vh - 180px);
}

.email-table-scroll {
  max-height: calc(100vh - 260px);
  min-height: 520px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.email-table {
  min-width: 1320px;
}

.email-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
}

.email-table th:nth-child(1),
.email-table td:nth-child(1) {
  width: 130px;
}

.email-table th:nth-child(2),
.email-table td:nth-child(2) {
  width: 180px;
}

.email-table th:nth-child(3),
.email-table td:nth-child(3) {
  width: 230px;
}

.email-table th:nth-child(4),
.email-table td:nth-child(4) {
  width: 460px;
}

.email-table th:nth-child(5),
.email-table td:nth-child(5) {
  width: 280px;
}

.email-table th:nth-child(6),
.email-table td:nth-child(6) {
  width: 130px;
}

.email-table th:nth-child(7),
.email-table td:nth-child(7) {
  width: 190px;
}

@media (max-width: 760px) {
  .email-table-scroll {
    max-height: 64vh;
    min-height: 360px;
  }
}

/* Mobile application shell */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    background: linear-gradient(180deg, #fbfcff 0%, #f4f7fb 100%);
    font-size: 14px;
  }

  .app-shell {
    display: block;
    width: 100%;
    min-height: 100vh;
    padding: 0;
  }

  .app-sidebar {
    position: relative;
    top: auto;
    z-index: 1;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 10px 10px 0;
    border-radius: 14px;
    box-shadow: var(--card-shadow);
  }

  .app-sidebar::after {
    display: none;
  }

  .brand-block {
    gap: 12px;
    padding: 14px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 16px;
  }

  .brand-block strong,
  .brand-block span {
    font-size: 13px;
    line-height: 1.2;
  }

  .app-main {
    width: 100%;
    min-width: 0;
    padding: 14px 10px 24px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
    padding: 0;
  }

  .topbar h1 {
    font-size: 30px;
    line-height: 1.08;
    letter-spacing: 0;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 11px;
    letter-spacing: 0.06em;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
  }

  .top-search,
  .quick-create-button,
  .storage-pill,
  .user-chip,
  #logoutButton {
    width: 100%;
    min-width: 0;
  }

  .top-search {
    height: 44px;
  }

  .top-search input {
    border-radius: 14px;
    padding-right: 16px;
  }

  .quick-create-button,
  #logoutButton {
    min-height: 44px;
    justify-content: center;
  }

  .notification-button,
  .storage-pill {
    display: none;
  }

  .user-chip {
    min-height: 46px;
    padding: 8px 10px;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    background: #fff;
  }

  .tabs {
    position: static;
    display: flex;
    gap: 8px;
    width: 100%;
    max-height: none;
    margin: 4px 0 10px;
    padding: 2px 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar,
  .work-subtabs::-webkit-scrollbar,
  .material-subtabs::-webkit-scrollbar,
  .project-subtabs::-webkit-scrollbar,
  .progress-subtabs::-webkit-scrollbar,
  .people-subtabs::-webkit-scrollbar,
  .settings-subtabs::-webkit-scrollbar {
    display: none;
  }

  .tab-button {
    flex: 0 0 auto;
    min-height: 42px;
    border: 1px solid var(--stroke);
    border-radius: 12px;
    background: #fff;
    padding: 0 12px;
    white-space: nowrap;
    box-shadow: var(--card-shadow);
  }

  .tab-button.is-active {
    border-color: transparent;
    background: var(--nav-bg, #eef2ff);
  }

  .work-subtabs,
  .material-subtabs,
  .project-subtabs,
  .progress-subtabs,
  .people-subtabs,
  .settings-subtabs {
    display: flex;
    gap: 8px;
    width: 100%;
    margin: 0 0 12px;
    padding: 0 0 6px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .work-subtab,
  .material-subtab,
  .project-subtab,
  .progress-subtab,
  .people-subtab,
  .settings-subtab {
    flex: 0 0 auto;
    min-height: 38px;
    border-radius: 12px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .workspace,
  #tab-settings .workspace,
  .material-content,
  .route-input-layout,
  .task-main,
  .assigned-task-detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card-form,
  .task-panel,
  .table-panel,
  .dashboard-panel,
  .mini-panel,
  .workflow-panel,
  .gantt-panel {
    min-height: 0;
    border-radius: 12px;
    padding: 14px;
  }

  .card-form {
    position: static;
    gap: 12px;
  }

  .form-head,
  .panel-head,
  .filters,
  .project-filters,
  .expense-filters,
  .material-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
  }

  .filters input,
  .filters select,
  .project-filters input,
  .project-filters select,
  .expense-filters input,
  .expense-filters select,
  .material-filters select,
  input,
  select,
  textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .field-grid,
  .stat-grid,
  .dashboard-grid,
  .route-progress-grid,
  .project-card,
  .person-card {
    grid-template-columns: 1fr;
  }

  .table-scroll {
    max-width: 100%;
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table,
  .project-table,
  .material-table,
  .assigned-task-table {
    min-width: 980px;
  }

  #projectViewPackages .table-scroll {
    max-height: 68vh;
    min-height: 360px;
  }

  .row-actions,
  .assigned-detail-actions {
    justify-content: flex-start;
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .app-sidebar {
    margin: 8px 8px 0;
  }

  .app-main {
    padding: 12px 8px 20px;
  }

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

  .tab-button::before,
  .work-subtab::before {
    display: none;
  }

  .tab-button,
  .work-subtab,
  .material-subtab,
  .project-subtab,
  .progress-subtab,
  .people-subtab,
  .settings-subtab {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }
}
