:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef3f5;
  --ink: #1d2730;
  --muted: #65717d;
  --line: #d8e0e5;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #c2410c;
  --green: #15803d;
  --shadow: 0 18px 50px rgba(29, 39, 48, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  color: #eaf3f2;
  background: #17242b;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #37b7a9;
  color: #102126;
  font-weight: 800;
}

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

.brand span {
  color: #b8c8ca;
  font-size: 13px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #d7e5e3;
  background: transparent;
  text-align: left;
}

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

.nav-item span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
}

.sidebar-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-card p {
  margin: 10px 0 4px;
  color: #cfe1df;
}

.status-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #37b7a9;
  box-shadow: 0 0 0 6px rgba(55, 183, 169, 0.16);
}

.workspace {
  padding: 28px;
  overflow-x: hidden;
}

.topbar,
.section-head,
.controls,
.topbar-actions,
.form-row,
menu {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar h1,
.section-head h2 {
  margin: 0;
}

.topbar h1 {
  font-size: 30px;
  line-height: 1.15;
}

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

.topbar-actions {
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(420px, 40vw);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
}

.primary-btn,
.ghost-btn,
.icon-btn {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
}

.primary-btn {
  padding: 0 15px;
  background: var(--teal);
  color: #ffffff;
}

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

.ghost-btn {
  padding: 0 13px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.icon-btn {
  width: 40px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface-soft);
  font-size: 24px;
}

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

.metrics article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metrics span,
.metrics small {
  display: block;
  color: var(--muted);
}

.metrics strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 34px;
}

.controls {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.controls select,
.segmented {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.controls select {
  padding: 0 10px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  padding: 3px;
}

.segmented button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented button.active {
  background: #d9f0ec;
  color: var(--teal-dark);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.task-panel,
.side-panel section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.task-panel {
  padding: 18px;
}

.section-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-head.compact {
  margin: 0 0 12px;
}

.section-head h2 {
  font-size: 20px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 12px;
}

.kanban.list-view {
  display: grid;
  grid-template-columns: 1fr;
}

.column {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.column-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.task-card {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.task-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

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

.task-meta,
.card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.priority-Alta {
  background: #fee2d5;
  color: var(--red);
}

.priority-Media {
  background: #fef3c7;
  color: var(--amber);
}

.priority-Bassa {
  background: #dcfce7;
  color: var(--green);
}

.due-soon {
  color: var(--red);
}

.mini-btn {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.side-panel section {
  padding: 16px;
}

.client-list,
.deadline-list {
  display: grid;
  gap: 10px;
}

.client-item,
.deadline-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.client-item strong,
.deadline-item strong {
  font-size: 14px;
}

.client-item span,
.deadline-item span {
  color: var(--muted);
  font-size: 13px;
}

dialog {
  width: min(620px, calc(100vw - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(29, 39, 48, 0.24);
}

dialog::backdrop {
  background: rgba(23, 36, 43, 0.48);
}

form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

textarea {
  resize: vertical;
}

.form-row {
  gap: 12px;
}

.form-row label {
  flex: 1;
}

menu {
  justify-content: flex-end;
  gap: 10px;
  margin: 4px 0 0;
  padding: 0;
}

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

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

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

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 14px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    padding: 0 8px;
    font-size: 0;
  }

  .nav-item span {
    font-size: 16px;
  }

  .sidebar-card {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

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

  .search-box {
    width: 100%;
  }

  .metrics,
  .side-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .brand div {
    display: none;
  }

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

  .segmented {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    flex-direction: column;
  }
}
