:root {
  --page: #f4f5f7;
  --surface: #ffffff;
  --surface-subtle: #f8f9fa;
  --ink: #20252b;
  --ink-soft: #505860;
  --muted: #78818a;
  --line: #dfe3e6;
  --line-soft: #edf0f2;
  --nav: #22272b;
  --nav-hover: #30363b;
  --green: #2b8a63;
  --green-soft: #dff2e9;
  --amber: #b86c10;
  --amber-soft: #f8ead4;
  --red: #c34a51;
  --red-soft: #f7e1e3;
  --teal: #247f86;
  --teal-soft: #dceff0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: 220px;
  flex-direction: column;
  padding: 22px 14px 18px;
  background: var(--nav);
  color: #d9dde0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px 20px;
  color: #fff;
  font-size: 18px;
  font-weight: 720;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 5px;
  background: #e9f4ef;
  color: #1f7655;
  font-size: 16px;
}

.primary-nav,
.sidebar-section {
  display: grid;
  gap: 3px;
}

.sidebar-section {
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px solid #394046;
}

.sidebar-section p {
  margin: 0 10px 7px;
  color: #8f999f;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  min-height: 39px;
  padding: 9px 12px;
  border-radius: 5px;
  color: #bfc6ca;
  font-size: 13px;
  font-weight: 620;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--nav-hover);
  color: #fff;
}

.nav-item.selected {
  background: #353c41;
  color: #fff;
}

.nav-item.selected::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: #66b895;
  content: "";
}

.sidebar-footer {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid #394046;
}

.sidebar-footer a {
  color: #d8dddf;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.sidebar-role {
  color: #8f999f;
  font-size: 11px;
}

.copyright {
  color: #8f999f;
  font-size: 10px;
  margin-top: 10px;
}

.main-content {
  min-height: 100vh;
  margin-left: 220px;
  padding: 32px clamp(22px, 3vw, 48px) 48px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  max-width: 1500px;
  margin: 0 auto 25px;
}

.section-label {
  margin: 0 0 3px;
  color: var(--green);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.page-header h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 730;
  letter-spacing: 0;
}

.header-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  justify-content: flex-end;
}

.user-block > span:last-child {
  display: grid;
}

.user-block strong {
  max-width: 210px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-block small {
  color: var(--muted);
  font-size: 11px;
}

.avatar,
.person-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: #1f7655;
  font-weight: 750;
}

.avatar {
  width: 36px;
  height: 36px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1500px;
  margin: 0 auto 14px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.metric {
  min-height: 126px;
  padding: 17px 18px;
}

.metric-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 680;
}

.metric-heading i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.metric-review .metric-heading i {
  background: var(--teal);
}

.metric-idle .metric-heading i {
  background: var(--amber);
}

.metric-offline .metric-heading i {
  background: var(--red);
}

.metric strong {
  display: block;
  margin-top: 9px;
  font-size: 29px;
  line-height: 1.05;
}

.metric p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(310px, .75fr);
  gap: 14px;
  max-width: 1500px;
  margin: 0 auto;
}

.panel {
  min-width: 0;
  padding: 20px;
}

.team-panel {
  padding: 0;
}

.team-panel .panel-header {
  padding: 20px 20px 0;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 720;
}

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

.text-link {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

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

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

table {
  width: 100%;
  min-width: 790px;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  text-transform: uppercase;
}

td {
  height: 59px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 12px;
  vertical-align: middle;
}

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

tbody tr:hover {
  background: #fbfcfc;
}

td strong {
  color: var(--ink);
}

.employee-link {
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}

.employee-link > span:last-child {
  display: grid;
}

.employee-link small,
.cell-note {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.person-mark {
  width: 29px;
  height: 29px;
  font-size: 11px;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
}

.state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.state-break i,
.state-idle i {
  background: var(--amber);
}

.state-offline i {
  background: var(--red);
}

.attention-panel {
  grid-row: span 2;
}

.attention-list {
  margin: 0 -20px -20px;
}

.attention-row {
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr) 16px;
  gap: 12px;
  min-height: 74px;
  padding: 13px 17px;
  border-top: 1px solid var(--line-soft);
  color: inherit;
  text-decoration: none;
}

.attention-row:hover {
  background: var(--surface-subtle);
}

.attention-marker {
  width: 3px;
  height: 34px;
  margin-top: 4px;
  border-radius: 2px;
  background: var(--teal);
}

.attention-idle .attention-marker {
  background: var(--amber);
}

.attention-offline .attention-marker {
  background: var(--red);
}

.attention-content {
  display: grid;
  min-width: 0;
}

.attention-content small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 740;
  text-transform: uppercase;
}

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

.attention-content strong {
  margin-top: 1px;
  font-size: 12px;
}

.attention-content span {
  color: var(--muted);
  font-size: 11px;
}

.row-arrow {
  align-self: center;
  color: #a2a9ae;
  font-size: 19px;
}

.time-panel {
  min-height: 250px;
}

.breakdown-list {
  display: grid;
  gap: 15px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(170px, .7fr) minmax(120px, 1fr) 40px;
  align-items: center;
  gap: 13px;
}

.breakdown-row > div:first-child {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.breakdown-row > div:first-child span:last-child {
  color: var(--muted);
}

.breakdown-row b {
  color: var(--ink-soft);
  font-size: 11px;
  text-align: right;
}

.legend {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--green);
}

.legend-idle,
.bar-idle {
  background: var(--amber) !important;
}

.legend-locked,
.bar-locked {
  background: var(--teal) !important;
}

.legend-break,
.bar-break {
  background: #8b72b6 !important;
}

.bar-track {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #edf0f1;
}

.bar-track i {
  display: block;
  min-width: 2px;
  height: 100%;
  border-radius: 3px;
  background: var(--green);
}

.department-list,
.project-list {
  display: grid;
  gap: 16px;
}

.department-row,
.project-row {
  display: grid;
  gap: 7px;
}

.department-row > div:first-child,
.project-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 11px;
}

.department-row span,
.project-row span,
.department-row small {
  color: var(--muted);
}

.department-row small {
  margin-top: -3px;
  font-size: 10px;
}

.project-panel .bar-track i {
  background: var(--teal);
}

.empty-state {
  margin: 0;
  padding: 24px 18px !important;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1120px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .attention-panel {
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 12px;
  }

  .brand {
    padding: 0 6px 11px;
  }

  .primary-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .nav-item {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .nav-item.selected::before {
    inset: auto 10px 2px;
    width: auto;
    height: 2px;
  }

  .sidebar-section {
    display: flex;
    margin-top: 3px;
    overflow-x: auto;
    padding: 0 0 3px;
    border-top: 0;
  }

  .sidebar-section p {
    display: none;
  }

  .sidebar-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    padding: 9px 6px 0;
  }

  .sidebar-footer > strong {
    margin: 0;
  }

  .sidebar-footer form {
    margin-left: auto;
  }

  .sidebar-footer .logout-link {
    margin: 0;
  }

  .main-content {
    margin-left: 0;
    padding: 22px 14px 34px;
  }

  .page-header {
    margin-bottom: 20px;
  }

  .user-block {
    display: none;
  }

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

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

  .metric-heading {
    align-items: flex-start;
    gap: 8px;
  }

  .panel {
    padding: 16px;
  }

  .team-panel {
    padding: 0;
  }

  .team-panel .panel-header {
    padding: 16px 16px 0;
  }

  .attention-list {
    margin: 0 -16px -16px;
  }

  .breakdown-row {
    grid-template-columns: 1fr 42px;
  }

  .breakdown-row .bar-track {
    grid-row: 2;
    grid-column: 1 / -1;
  }
}

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

  .page-header h1 {
    font-size: 24px;
  }
}
