:root {
  font-family: Inter, system-ui, sans-serif;
  color: #10243e;
  background: #f3f6fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 86% 8%, #d8f1f333 0, transparent 24rem),
    #f3f6fa;
}

.new-task-button {
  border: 0;
  border-radius: 10px;
  background: #087f8c;
  color: #fff;
  font-weight: 800;
  padding: .7rem 1rem;
  cursor: pointer;
}

.task-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(7, 28, 49, .62);
  backdrop-filter: blur(3px);
}

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

.task-modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(0, 24, 48, .3);
  padding: 1.35rem;
}

.task-modal-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.task-modal-card h2,
.task-modal-card p {
  margin: .2rem 0;
}

.task-modal-card header small {
  color: #087f8c;
  font-weight: 800;
  letter-spacing: .08em;
}

.modal-close {
  width: 2.3rem;
  height: 2.3rem;
  border: 0;
  border-radius: 50%;
  background: #edf3f8;
  color: #17324d;
  font-size: 1.4rem;
  cursor: pointer;
}

.task-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.task-form-grid label {
  display: grid;
  gap: .35rem;
  color: #304a63;
  font-size: .84rem;
  font-weight: 750;
}

.task-form-grid input,
.task-form-grid select,
.task-form-grid textarea {
  width: 100%;
  border: 1px solid #cbd8e5;
  border-radius: 9px;
  background: #fff;
  color: #10243e;
  padding: .7rem .75rem;
  font: inherit;
}

.task-form-wide {
  grid-column: 1 / -1;
}

.impact-toggle {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin-top: 1rem;
  padding: .85rem;
  border-radius: 10px;
  background: #f1f7fa;
}

.impact-toggle span {
  display: grid;
  gap: .2rem;
}

.impact-toggle small {
  color: #60768a;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  margin-top: 1rem;
}

.modal-actions button {
  border: 1px solid #bdd0df;
  border-radius: 9px;
  padding: .7rem 1rem;
  font-weight: 800;
  cursor: pointer;
}

.modal-actions .primary {
  border-color: #087f8c;
  background: #087f8c;
  color: #fff;
}

@media (max-width: 680px) {
  .task-form-grid {
    grid-template-columns: 1fr;
  }

  .task-form-wide {
    grid-column: auto;
  }
}

.session-failure {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #062b55, #0b6f84);
}

.session-failure[hidden] {
  display: none !important;
}

.session-failure-card {
  width: min(440px, 92vw);
  display: grid;
  gap: 14px;
  background: #fff;
  padding: 32px;
  border-radius: 18px;
  box-shadow: 0 25px 70px #001a3566;
}

.session-failure-card img {
  width: 150px;
}

.session-failure-card h1,
.session-failure-card p {
  margin: 0;
}

.session-failure-card .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 9px 14px;
  text-decoration: none;
}

.filters input,
.filters select,
.filters button,
.task-detail input,
.task-detail select,
.task-detail textarea,
.task-detail button {
  min-height: 42px;
  border: 1px solid #cbd6e3;
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
}

.filters button,
.primary {
  background: #087b8f !important;
  color: #fff;
  border: 0 !important;
  font-weight: 800;
  cursor: pointer;
}

.topbar {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid #dce4ed;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}

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

.topbar button {
  border: 1px solid #ccd8e4;
  background: #fff;
  border-radius: 7px;
  padding: 8px 12px;
  color: #30445c;
  cursor: pointer;
}

.topbar-brand {
  display: flex;
  gap: 15px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.topbar-brand img {
  width: 104px;
}

.topbar-brand > span {
  width: 1px;
  height: 38px;
  background: #dce4ed;
}

.session-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  background: #eaf3fc;
  color: #084c83;
  font-weight: 800;
}

.tasks-shell {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: calc(100vh - 72px);
}

.side-nav {
  background: #092e58;
  padding: 22px 14px;
}

.side-nav nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  color: #dceafa;
  text-decoration: none;
  padding: 11px 13px;
  border-radius: 8px;
}

.side-nav a:hover,
.side-nav a.active {
  background: #0a7287;
  color: #fff;
}

.tasks-shell main {
  width: min(1580px, 100%);
  padding: 30px;
  min-width: 0;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(120deg, #ffffff 0%, #f3fbfc 58%, #e5f4f7 100%);
  border: 1px solid #cfe1e8;
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: 0 12px 35px #0c3c6410;
}

.hero::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -75px;
  top: -105px;
  border: 28px solid #0b879510;
  border-radius: 50%;
}

.hero-copy {
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.hero-icon {
  width: 54px;
  height: 54px;
  display: grid;
  flex: 0 0 54px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, #087b8f, #075d79);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 10px 24px #087b8f38;
}

.hero small {
  color: #087b8f;
  font-weight: 900;
  letter-spacing: .08em;
}

.hero h1 {
  margin: 5px 0;
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: -.025em;
}

.hero p {
  margin: 0;
  color: #5d6c7d;
}

.task-view-control {
  display: grid;
  justify-items: end;
  gap: 7px;
  position: relative;
  z-index: 1;
}

.task-view-control > small {
  color: #647487;
  font-weight: 600;
  letter-spacing: 0;
}

.task-view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #e8eef5;
  border-radius: 10px;
}

.task-view-switch button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  padding: 8px 13px;
  background: transparent;
  color: #42566e;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.task-view-switch button.active {
  background: #087b8f;
  color: #fff;
  box-shadow: 0 3px 8px #0a526433;
}

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

.metric {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dce4ed;
  border-radius: 14px;
  padding: 18px 19px;
  box-shadow: 0 8px 22px #143a5a0a;
}

.metric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #0b8191;
}

.metric.warning::before {
  background: #d39526;
}

.metric.danger::before {
  background: #c94343;
}

.metric.company::before {
  background: #7f55b5;
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.metric-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e9f5f7;
  color: #087b8f;
  font-weight: 900;
}

.metric strong {
  display: block;
  font-size: 28px;
  letter-spacing: -.03em;
}

.metric span {
  color: #647487;
}

.filter-panel {
  background: #fff;
  padding: 17px;
  border: 1px solid #dce4ed;
  border-radius: 14px;
  box-shadow: 0 8px 24px #153a5d0a;
}

.filter-heading,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.filter-heading small,
.panel-heading small {
  color: #087b8f;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
}

.filter-heading h2,
.panel-heading h2 {
  margin: 3px 0 0;
  font-size: 17px;
}

.quiet-button {
  border: 1px solid #cbd8e5;
  border-radius: 8px;
  padding: 8px 11px;
  background: #fff;
  color: #52657a;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.filters {
  display: grid;
  grid-template-columns: 1.8fr repeat(6, minmax(110px, 1fr)) auto;
  gap: 9px;
  align-items: end;
}

.filters label {
  display: grid;
  gap: 5px;
}

.filters label > span {
  color: #53677d;
  font-size: 11px;
  font-weight: 800;
}

.filters input,
.filters select {
  width: 100%;
  background: #fbfcfe;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 39%) 1fr;
  gap: 16px;
  margin-top: 18px;
}

.task-panel,
.task-detail {
  background: #fff;
  border: 1px solid #dce4ed;
  border-radius: 14px;
  padding: 17px;
  min-height: 480px;
  box-shadow: 0 8px 24px #153a5d0a;
}

.count-pill {
  min-width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #e8f4f6;
  color: #087b8f;
  font-size: 13px;
  font-weight: 900;
}

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

.task-card {
  position: relative;
  border: 1px solid #d9e2eb;
  border-left: 5px solid #2b8ba0;
  border-radius: 11px;
  padding: 14px;
  cursor: pointer;
  background: #fff;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.task-card:hover {
  transform: translateY(-1px);
  border-color: #9ebdca;
  box-shadow: 0 8px 20px #0d506b12;
}

.task-card.active {
  background: #eaf7f8;
  border-color: #087b8f;
  box-shadow: 0 7px 18px #087b8f18;
}

.task-card.priority-urgente {
  border-left-color: #c94343;
}

.task-card.priority-alta {
  border-left-color: #d48724;
}

.task-card.priority-baja {
  border-left-color: #6f879d;
}

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

.task-card p,
.task-card small {
  display: block;
  margin: 3px 0;
  color: #617184;
}

.task-card .task-owner {
  color: #2e5368;
  font-weight: 700;
}

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.task-card-footer small {
  margin: 0;
}

.mini-progress {
  width: 64px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e9ef;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #087b8f;
}

.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  background: #edf2f7;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.badge.empresa {
  background: #f3e8ff;
  color: #6b2a8d;
}

.badge.automatic {
  background: #e8f6ee;
  color: #1f7550;
}

.badge.vencida {
  background: #ffe8e8;
  color: #a51c1c;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #e2e8ef;
  padding-bottom: 14px;
}

.detail-head h2 {
  margin: 5px 0;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 9px;
  margin: 15px 0;
}

.detail-meta div {
  padding: 10px 11px;
  border: 1px solid #e0e7ee;
  border-radius: 9px;
  background: #f8fafc;
}

.detail-meta small,
.detail-meta strong {
  display: block;
}

.detail-meta small {
  margin-bottom: 4px;
  color: #718095;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-meta strong {
  overflow: hidden;
  color: #263c54;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

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

.progress-row input {
  width: 100%;
}

.section {
  border-top: 1px solid #e2e8ef;
  margin-top: 18px;
  padding-top: 16px;
}

.section h3 {
  margin-top: 0;
}

.comment-form,
.document-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.comment-list,
.document-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.entry {
  background: #f5f8fb;
  padding: 10px;
  border-radius: 8px;
}

.entry a {
  color: #087b8f;
}

.message {
  color: #a51c1c;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  color: #738296;
  padding: 72px 18px;
}

.empty strong {
  color: #314860;
  font-size: 17px;
}

.empty p {
  max-width: 360px;
  margin: 0;
  line-height: 1.5;
}

.empty-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eaf5f7;
  color: #087b8f;
  font-size: 23px;
  font-weight: 900;
}

.empty-link {
  margin-top: 6px;
  color: #087b8f;
  font-weight: 800;
  text-decoration: none;
}

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

  .side-nav {
    display: none;
  }

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

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

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

  .tasks-shell main {
    padding: 14px;
  }
}

@media (max-width: 560px) {
  .summary,
  .filters {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: start;
    flex-direction: column;
  }

  .task-view-control {
    width: 100%;
    justify-items: start;
  }

  .task-view-switch {
    width: 100%;
  }

  .task-view-switch button {
    flex: 1;
  }

  .hero-copy {
    align-items: flex-start;
  }

  .hero-icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 12px;
    font-size: 22px;
  }

  .filter-heading {
    align-items: flex-start;
  }

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