:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f9fbfb;
  --line: #dfe6e6;
  --line-strong: #c9d4d3;
  --text: #16201f;
  --muted: #63706e;
  --faint: #8c9996;
  --primary: #078b7d;
  --primary-dark: #057064;
  --primary-soft: #e2f4f1;
  --green: #35a852;
  --amber: #f1a60b;
  --red: #e24a42;
  --blue: #2878d0;
  --violet: #725ee8;
  --shadow: 0 16px 45px rgba(17, 35, 33, 0.09);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.75fr) minmax(680px, 1.25fr);
  background:
    radial-gradient(circle at 16% 14%, rgba(7, 139, 125, 0.12), transparent 28%),
    linear-gradient(135deg, #f7faf9 0%, #edf3f4 100%);
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(201, 212, 211, 0.92);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 34px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--primary);
  border: 2px solid currentColor;
  border-radius: 7px;
}

.login-card h1 {
  margin: 42px 0 10px;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: 0;
}

.login-card p {
  margin: 0 0 30px;
  color: var(--muted);
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field label,
.section-title,
.meta-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field select,
.field input,
.field textarea,
.search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  min-height: 42px;
  padding: 10px 12px;
  outline: none;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.45;
}

.field select:focus,
.field input:focus,
.field textarea:focus,
.search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(7, 139, 125, 0.12);
}

.primary-btn,
.ghost-btn,
.icon-btn,
.chip-btn {
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(7, 139, 125, 0.2);
}

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

.ghost-btn,
.chip-btn,
.icon-btn {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.ghost-btn:hover,
.chip-btn:hover,
.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.chip-btn.active {
  color: var(--primary-dark);
  border-color: rgba(7, 139, 125, 0.28);
  background: var(--primary-soft);
}

.login-actions {
  display: grid;
  gap: 12px;
}

.login-actions .primary-btn {
  width: 100%;
  min-height: 46px;
}

.demo-users {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.demo-users button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.demo-users button.active {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: rgba(7, 139, 125, 0.28);
}

.preview-panel {
  padding: 42px 42px 42px 0;
  display: flex;
  align-items: center;
}

.preview-shell {
  width: 100%;
  height: min(790px, calc(100vh - 84px));
  min-height: 650px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 210px 1fr 280px;
}

.mini-side,
.mini-detail {
  background: #fbfcfc;
  border-right: 1px solid var(--line);
  padding: 18px;
}

.mini-detail {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.mini-row {
  height: 32px;
  border-radius: 6px;
  background: #eef4f3;
  margin: 10px 0;
}

.mini-row.short {
  width: 68%;
}

.mini-main {
  padding: 22px;
}

.mini-timeline {
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 0 19%, rgba(22, 32, 31, 0.06) 19% 20%, transparent 20% 39%, rgba(22, 32, 31, 0.06) 39% 40%, transparent 40% 59%, rgba(22, 32, 31, 0.06) 59% 60%, transparent 60% 79%, rgba(22, 32, 31, 0.06) 79% 80%, transparent 80%),
    #fff;
  position: relative;
}

.mini-bar {
  position: absolute;
  left: 9%;
  right: 18%;
  top: 42px;
  height: 24px;
  border-radius: 5px;
  background: rgba(7, 139, 125, 0.25);
}

.mini-bar.two {
  left: 28%;
  right: 8%;
  top: 92px;
  background: rgba(241, 166, 11, 0.26);
}

.mini-board {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.mini-card {
  height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.mini-line {
  height: 8px;
  border-radius: 999px;
  background: #dbe5e4;
  margin: 10px 0;
}

.app-shell {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-columns: 230px minmax(560px, 1fr) 330px;
  background: var(--surface);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfcfc;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar .brand {
  padding: 0 8px 18px;
  font-size: 17px;
}

.current-user {
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-weight: 800;
}

.user-role {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 4px;
  margin-bottom: 20px;
}

.nav button,
.project-filter,
.person-row {
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  min-height: 38px;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  text-align: left;
  color: var(--muted);
}

.nav button.active,
.project-filter.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: currentColor;
}

.sidebar-section {
  margin-bottom: 18px;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 8px;
}

.count-pill,
.role-pill,
.privacy-pill,
.status-pill {
  min-width: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #edf2f1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.role-pill.admin,
.privacy-pill {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid rgba(7, 139, 125, 0.25);
}

.role-pill {
  padding-inline: 6px;
  font-size: 11px;
}

.people-list {
  display: grid;
  gap: 6px;
}

.person-row {
  grid-template-columns: 34px 1fr auto;
}

.person-row:hover,
.project-filter:hover,
.nav button:hover {
  background: #f0f4f4;
}

.project-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.project-name-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lock {
  color: var(--faint);
  font-size: 13px;
}

.logout {
  margin-top: auto;
}

.main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: #fff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  min-height: 74px;
  padding: 14px 22px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 280px auto;
  gap: 14px;
  align-items: center;
}

.topbar .primary-btn {
  min-width: 158px;
  white-space: nowrap;
}

.title h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}

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

.toolbar {
  padding: 18px 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline {
  margin: 16px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.timeline-grid {
  display: grid;
  grid-template-columns: 145px repeat(7, minmax(74px, 1fr));
}

.timeline-cell {
  min-height: 43px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  position: relative;
}

.timeline-cell:nth-child(8n) {
  border-right: 0;
}

.timeline-head {
  background: #fbfcfc;
  color: var(--muted);
  font-weight: 800;
}

.timeline-project {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
}

.timeline-bar {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 12px;
  height: 22px;
  border-radius: 5px;
  color: #0f4741;
  background: rgba(7, 139, 125, 0.2);
  padding: 4px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.board {
  padding: 0 22px 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(148px, 1fr));
  gap: 14px;
}

.column {
  min-height: 420px;
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 850;
}

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

.task-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 10px;
  text-align: left;
  color: var(--text);
  box-shadow: 0 8px 20px rgba(17, 35, 33, 0.04);
}

.task-card:hover,
.task-card.active {
  border-color: rgba(7, 139, 125, 0.48);
  box-shadow: 0 10px 26px rgba(7, 139, 125, 0.11);
}

.task-code {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.task-title {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 850;
}

.task-project {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.task-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.task-people {
  display: flex;
  align-items: center;
}

.task-people .avatar {
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  margin-left: -6px;
  font-size: 10px;
}

.task-people .avatar:first-child {
  margin-left: 0;
}

.progress {
  height: 5px;
  border-radius: 999px;
  background: #e9eeee;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
}

.detail {
  border-left: 1px solid var(--line);
  background: #fbfcfc;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

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

.detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.detail h2 {
  margin: 6px 0 0;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 0;
}

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

.status-line {
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 12px;
  align-items: center;
}

.status-line select {
  min-width: 0;
  width: 100%;
}

.inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.assignee-list,
.project-assignment {
  display: grid;
  gap: 8px;
}

.check-row {
  display: grid;
  grid-template-columns: 18px 34px 1fr;
  gap: 9px;
  align-items: center;
  min-height: 36px;
}

.check-row input {
  accent-color: var(--primary);
}

.toggle-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.switch {
  position: relative;
  width: 45px;
  height: 25px;
}

.switch input {
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c9d4d3;
  transition: 160ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 19px;
  height: 19px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: 160ms ease;
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.time-total {
  font-size: 28px;
  font-weight: 850;
  margin: 8px 0 2px;
}

.time-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

.time-form input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.time-log {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.time-log-row {
  display: grid;
  grid-template-columns: 1fr 70px 70px;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.finance-card {
  display: grid;
  gap: 14px;
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.finance-summary div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  min-width: 0;
}

.finance-summary span,
.finance-note {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.finance-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  white-space: nowrap;
}

.finance-budget-field {
  margin: 0;
}

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

.expense-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
}

.expense-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-row strong {
  color: var(--text);
  white-space: nowrap;
}

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

.expense-form input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.payout-table {
  display: grid;
  gap: 6px;
}

.payout-head,
.payout-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 62px 44px 74px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.payout-head {
  color: var(--muted);
  font-weight: 850;
}

.payout-row {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.payout-person {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.payout-person .avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
  flex: 0 0 auto;
}

.payout-row strong {
  text-align: right;
}

.empty.compact {
  padding: 12px;
  font-size: 12px;
}

.links,
.attachments {
  display: grid;
  gap: 8px;
}

.link-row {
  display: grid;
  grid-template-columns: 18px 1fr 16px;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-size: 13px;
  text-decoration: none;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.attachment {
  aspect-ratio: 1.12;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(7, 139, 125, 0.2), rgba(40, 120, 208, 0.14)),
    #eef4f3;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  padding: 8px;
}

.attachment.add {
  background: #fff;
  color: var(--primary);
  font-size: 24px;
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 22px;
  text-align: center;
  line-height: 1.5;
}

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

.modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 22px;
  border: 1px solid var(--line);
}

.modal h2 {
  margin: 0 0 18px;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #15201f;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  z-index: 30;
  font-weight: 750;
}

@media (max-width: 980px) {
  body {
    min-width: 0;
    overflow: auto;
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    display: none;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .sidebar,
  .detail {
    position: static;
    border: 0;
  }

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

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