:root {
  --cream: #f7f5ed;
  --cream-2: #eeefe1;
  --green-50: #eef7e8;
  --green-100: #dcebd0;
  --green-200: #c7dfb5;
  --green-400: #8eaa72;
  --green-600: #40553a;
  --ink: #172018;
  --muted: #667061;
  --line: #dfe4d6;
  --white: #fffefa;
  --danger: #b54d45;
  --warning: #a66f22;
  --blue: #506f8f;
  --shadow: 0 18px 55px rgba(40, 52, 35, 0.09);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--cream);
  color: var(--ink);
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(238, 247, 232, 0.55), rgba(247, 245, 237, 0) 360px),
    var(--cream);
}

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

button {
  border: 0;
}

a {
  color: inherit;
}

#app {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: stretch;
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px;
  background:
    linear-gradient(140deg, rgba(220, 235, 208, 0.96), rgba(247, 245, 237, 0.82)),
    url("assets/workspace-pattern.svg");
  background-size: cover;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark img {
  display: block;
  width: min(260px, 74vw);
  height: auto;
}

.sidebar-logo img {
  width: 190px;
}

.brand-mark span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-weight: 800;
}

.login-copy {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid rgba(23, 32, 24, 0.12);
  border-radius: 999px;
  color: var(--green-600);
  background: rgba(255, 254, 250, 0.48);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.login-copy h1,
.page-title h1 {
  margin: 18px 0 14px;
  font-size: clamp(2.35rem, 5vw, 5.9rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.login-copy p,
.page-title p {
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.65;
  max-width: 680px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 34px;
}

.login-card,
.card,
.modal-card,
.empty-state,
.kanban-column,
.table-wrap {
  background: rgba(255, 254, 250, 0.86);
  border: 1px solid rgba(64, 85, 58, 0.11);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(100%, 455px);
  padding: 32px;
}

.login-card h2,
.modal-card h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.muted {
  color: var(--muted);
}

.demo-logins {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.demo-pill {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--green-50);
  font-size: 0.88rem;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(247, 245, 237, 0.92);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

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

.nav button,
.ghost-button,
.icon-button {
  cursor: pointer;
}

.nav button {
  width: 100%;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 14px;
  color: var(--green-600);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.nav button[draggable="true"] {
  cursor: grab;
}

.nav button[draggable="true"]:active {
  cursor: grabbing;
}

.nav button:hover,
.nav button.active {
  background: var(--green-100);
  color: var(--ink);
}

.nav .count {
  min-width: 23px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 0.72rem;
  text-align: center;
}

.icon-button .count {
  position: absolute;
  transform: translate(12px, -12px);
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 800;
}

.sidebar-footer {
  margin-top: 24px;
  padding: 14px;
  border-radius: 16px;
  background: var(--green-50);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(210px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid rgba(223, 228, 214, 0.74);
  background: rgba(247, 245, 237, 0.78);
  backdrop-filter: blur(22px);
}

.mobile-menu {
  display: none;
}

.search {
  position: relative;
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 12px 18px 12px 42px;
  outline: none;
}

.search svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}

.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 0.82rem;
  font-weight: 800;
}

.avatar-img {
  object-fit: cover;
  padding: 0;
}

.admin-status-bubble {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 44px);
  padding: 10px 13px 10px 10px;
  border: 1px solid rgba(64, 85, 58, 0.14);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.95);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}

.admin-status-bubble strong {
  display: block;
  font-size: 0.84rem;
  line-height: 1.1;
}

.admin-status-bubble span {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.admin-status-bubble i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #5ba85d;
}

.admin-status-bubble.available i {
  background: #3f9f4c;
}

.admin-status-bubble.away i {
  background: #d88925;
}

.admin-status-bubble.unavailable i {
  background: #c84f45;
}

.admin-status-control select {
  border: 0;
  border-radius: 999px;
  background: #e8f5e7;
  color: #2f7337;
  padding: 6px 28px 6px 10px;
  font-size: 0.76rem;
  font-weight: 800;
  outline: none;
  cursor: pointer;
}

.admin-status-control.away select {
  background: #f7ead5;
  color: #9a5d16;
}

.admin-status-control.unavailable select {
  background: #f8dedb;
  color: #a13c35;
}

.admin-status-avatar {
  width: 42px;
  height: 42px;
  font-size: 0.9rem;
}

.admin-status-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.admin-status-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}

.admin-status-card strong {
  display: block;
  line-height: 1.1;
}

.admin-status-card span {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.admin-status-card i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #c84f45;
}

.admin-status-card.available i {
  background: #3f9f4c;
}

.admin-status-card.away i {
  background: #d88925;
}

.admin-status-card-avatar {
  width: 42px;
  height: 42px;
  font-size: 0.9rem;
}

.content {
  padding: 34px 36px 56px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-title h1 {
  margin-top: 8px;
  font-size: clamp(2rem, 4vw, 4.8rem);
}

.actions,
.row-actions,
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.row-actions {
  gap: 6px;
  justify-content: flex-end;
}

.button,
.secondary-button,
.danger-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 15px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.16s ease, background 0.16s ease;
}

.button {
  background: var(--ink);
  color: var(--cream);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--green-100);
  color: var(--ink);
}

.danger-button {
  background: #f6d5d1;
  color: var(--danger);
}

.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
}

.icon-button {
  position: relative;
  width: 40px;
  padding: 0;
}

.button:hover,
.secondary-button:hover,
.danger-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.row-actions .button,
.row-actions .secondary-button,
.row-actions .danger-button,
.row-actions .ghost-button,
.project-card .actions .button,
.project-card .actions .secondary-button,
.project-card .actions .danger-button,
.project-card .actions .ghost-button,
.status-row .button,
.status-row .secondary-button,
.status-row .danger-button,
.status-row .ghost-button,
.file-item .button,
.file-item .secondary-button,
.file-item .danger-button,
.file-item .ghost-button {
  min-height: 30px;
  padding: 6px 10px;
  gap: 5px;
  font-size: 0.74rem;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.metrics {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.grid.two {
  grid-template-columns: minmax(0, 1.15fr) minmax(310px, 0.85fr);
}

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

.projects-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 320px));
  justify-content: start;
  align-items: stretch;
  gap: 14px;
}

.card {
  padding: 18px;
}

.metric {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(150deg, rgba(255, 254, 250, 0.94), rgba(220, 235, 208, 0.52));
}

.metric strong {
  display: block;
  font-size: 2.1rem;
  line-height: 1;
}

.metric span,
.small-label {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
}

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

.contact-tile {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--green-50);
}

.contact-tile span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 0.95rem;
  line-height: 1.25;
}

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

.compact-head {
  align-items: center;
  margin-bottom: 6px;
}

.compact-head p {
  margin-bottom: 0;
}

.card h3,
.card h4 {
  margin: 0;
}

.status-row,
.activity-item,
.comment-item,
.file-item,
.deadline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(223, 228, 214, 0.78);
}

.clickable-row {
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.draggable-project {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.draggable-project:active {
  cursor: grabbing;
}

.drag-handle {
  align-self: center;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -3px;
  opacity: 0.55;
  transform: rotate(90deg);
}

.draggable-project:hover .drag-handle {
  opacity: 1;
}

.project-dragging .draggable-project {
  cursor: grabbing;
}

.clickable-row:hover {
  background: rgba(220, 235, 208, 0.34);
}

div.clickable-row:hover {
  transform: translateY(-1px);
}

.status-row:first-child,
.activity-item:first-child,
.comment-item:first-child,
.file-item:first-child,
.deadline-item:first-child {
  border-top: 0;
}

.dot {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--green-400);
  flex: 0 0 auto;
}

.inline-dot {
  display: inline-block;
  margin: 0 8px 0 0;
  vertical-align: 1px;
}

.project-color-swatch {
  width: 12px;
  height: 12px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 999px;
  border: 1px solid rgba(23, 32, 24, 0.12);
  vertical-align: 1px;
}

.project-color-swatch.large {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 3px 0 0;
}

.dot.danger,
.badge.danger {
  background: #f4d1cd;
  color: var(--danger);
}

.dot.warn,
.badge.warn {
  background: #f4e3c7;
  color: var(--warning);
}

.dot.blue,
.badge.blue {
  background: #d9e4ed;
  color: var(--blue);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--green-50);
  color: var(--green-600);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge.dark {
  background: var(--ink);
  color: var(--cream);
}

.badge.soft {
  background: var(--cream-2);
  color: var(--muted);
}

.priority-baja {
  background: #e7f2df;
  color: #40553a;
}

.priority-media {
  background: #f4e3c7;
  color: #8a5a1d;
}

.priority-alta {
  background: #f1d1aa;
  color: #965719;
}

.priority-urgente {
  background: #f6d5d1;
  color: var(--danger);
}

.custom-badge {
  background: var(--badge-bg);
  color: var(--ink);
  border: 1px solid rgba(23, 32, 24, 0.08);
}

.custom-field-select {
  width: auto;
  max-width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--ink);
  padding: 4px 26px 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.inline-badge-select {
  max-width: 100%;
  min-height: 30px;
  border: 1px solid rgba(23, 32, 24, 0.08);
  border-radius: 999px;
  background: var(--badge-bg, var(--green-50));
  color: var(--ink);
  padding: 4px 26px 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.project-card {
  min-height: 170px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-card .card-head {
  gap: 10px;
  margin-bottom: 8px;
}

.dashboard-project-list {
  display: grid;
  gap: 2px;
}

.projects-list-card {
  min-height: 360px;
}

.projects-list-card .status-row {
  min-height: 82px;
}

.projects-list-card .status-row strong {
  font-size: 1.18rem;
}

.projects-list-card .status-row .muted {
  font-size: 1rem;
}

.project-tasks-card {
  padding: 0;
  overflow: hidden;
}

.project-tasks-card .card-head,
.project-tasks-card .filters {
  margin-left: 18px;
  margin-right: 18px;
}

.project-tasks-card .card-head {
  padding-top: 18px;
}

.project-tasks-card .table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.project-card h3 {
  font-size: 1.08rem;
  line-height: 1.15;
}

.project-card-description {
  margin: 10px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.project-card .project-logo,
.project-card .project-logo-fallback {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.project-card .badge {
  min-height: 23px;
  padding: 3px 8px;
  font-size: 0.68rem;
}

.project-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.project-title-wrap h3 {
  margin: 0;
}

.contact-line {
  font-size: 0.82rem;
}

.project-logo,
.project-logo-fallback {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--white);
  object-fit: cover;
}

.project-logo {
  padding: 0;
}

.project-logo.small {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.project-logo.large,
.project-logo-fallback.large {
  width: 58px;
  height: 58px;
  border-radius: 16px;
}

.project-logo-fallback {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--cream);
  font-size: 0.78rem;
  font-weight: 800;
}

.progress {
  height: 9px;
  border-radius: 999px;
  background: var(--cream-2);
  overflow: hidden;
}

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

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 780px;
}

.task-table {
  min-width: 1180px;
}

.task-col-title {
  width: 270px;
}

.task-col-project {
  width: 140px;
}

.task-col-subproject {
  width: 140px;
}

.task-col-category,
.task-col-status,
.task-col-custom {
  width: 120px;
}

.task-col-priority {
  width: 110px;
}

.task-col-date {
  width: 138px;
}

.task-col-actions {
  width: 116px;
}

.task-table .row-actions {
  flex-wrap: nowrap;
  min-width: 108px;
}

.task-table th:last-child,
.task-table td:last-child {
  width: 116px;
  white-space: nowrap;
}

th,
td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: middle;
}

.task-table th {
  font-size: 0.68rem;
}

.task-table td {
  font-size: 0.84rem;
}

.task-table td:first-child {
  min-width: 280px;
}

.task-table .badge {
  min-height: 22px;
  padding: 3px 8px;
  font-size: 0.7rem;
}

.task-check {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
  border: 1px solid rgba(102, 112, 97, 0.55);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  background: transparent;
  cursor: pointer;
  vertical-align: 1px;
}

.task-check.checked {
  border-color: var(--green-400);
  background: var(--green-100);
  color: var(--green-600);
}

.completed-tasks-card {
  opacity: 0.92;
}

tbody tr {
  position: relative;
}

tbody tr::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line);
}

th {
  color: var(--muted);
  font-size: 0.77rem;
  text-transform: uppercase;
}

tbody tr:last-child::after {
  display: none;
}

.filters {
  margin-bottom: 16px;
}

.task-filter-grid {
  display: grid;
  grid-template-columns: minmax(280px, 32fr) minmax(130px, 15fr) minmax(120px, 13fr) minmax(110px, 10fr) minmax(110px, 10fr) minmax(100px, 8fr) minmax(150px, 12fr) 120px;
  gap: 0;
  align-items: center;
  overflow-x: auto;
  padding: 0 12px;
}

.task-filter-grid select,
.task-filter-grid .filter-static {
  width: 100%;
  border-radius: 0;
  border-left: 0;
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.82);
}

.task-filter-grid select:first-of-type,
.task-filter-grid .filter-static {
  border-left: 1px solid var(--line);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.task-filter-grid select:last-of-type {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.filter-static {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 11px 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.filters input,
.filters select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  padding: 11px 12px;
  outline: none;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  overflow: hidden;
}

.password-field input {
  min-width: 0;
  border: 0;
  background: transparent;
}

.password-field button {
  min-height: 100%;
  padding: 0 12px;
  border-left: 1px solid var(--line);
  background: var(--green-50);
  color: var(--green-600);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.file-dropzone {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 14px;
  border: 1px dashed rgba(64, 85, 58, 0.34);
  border-radius: 14px;
  background: rgba(238, 247, 232, 0.52);
  color: var(--green-600);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.file-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-dropzone.drag-over {
  border-color: var(--green-400);
  background: var(--green-100);
  transform: translateY(-1px);
}

.file-drop-title {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.file-drop-name {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.inline-upload-form .file-dropzone {
  min-height: 52px;
  min-width: 180px;
  padding: 9px 12px;
}

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

.system-field-editor {
  display: grid;
  gap: 20px;
}

.system-field-section {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.custom-field-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.custom-option-list {
  display: grid;
  gap: 9px;
}

.custom-option-row {
  display: grid;
  grid-template-columns: 24px minmax(180px, 1fr) 54px auto;
  gap: 8px;
  align-items: center;
}

.custom-option-row[draggable="true"] {
  cursor: grab;
}

.custom-option-row[draggable="true"]:active {
  cursor: grabbing;
}

.custom-option-handle {
  justify-content: center;
  margin: 0;
  cursor: grab;
}

.custom-option-row input[name="option_label"] {
  min-width: 0;
}

.custom-color-input {
  width: 54px;
  min-height: 42px;
  padding: 4px;
  cursor: pointer;
}

.add-option-button {
  justify-self: start;
  margin-top: 10px;
}

.filters input,
.filters select {
  min-height: 42px;
}

.inline-date-input {
  min-height: 28px;
  max-width: 150px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 4px 8px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
}

.due-date-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.due-date-control.overdue .inline-date-input {
  border-color: #efb8b1;
  background: #f6d5d1;
  color: var(--danger);
}

.due-date-control.work-warning .inline-date-input {
  border-color: #edcf9d;
  background: #f4e3c7;
  color: #8a5a1d;
}

.quick-task-row td {
  padding: 7px 12px;
  background: rgba(255, 254, 250, 0.72);
}

.quick-task-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.quick-task-form input,
.quick-task-row select,
.quick-task-row input[type="date"] {
  width: 100%;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 5px 7px;
  font-size: 0.82rem;
  outline: none;
}

.quick-task-form input:focus,
.quick-task-row select:focus,
.quick-task-row input[type="date"]:focus {
  border-color: var(--line);
  background: var(--white);
}

.quick-task-row .custom-field-select,
.form-grid .custom-field-select {
  width: 100%;
  max-width: 112px;
  border: 1px solid rgba(23, 32, 24, 0.08);
  border-radius: 999px;
  background: var(--badge-bg);
  padding: 4px 26px 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.quick-task-row .custom-field-select:focus,
.form-grid .custom-field-select:focus {
  background: var(--badge-bg);
}

.quick-task-row .compact-button {
  min-width: 72px;
  padding-inline: 9px;
}

.quick-task-form input[name="title"] {
  font-weight: 800;
}

.quick-task-form input[name="title"]::placeholder {
  color: var(--muted);
  font-weight: 800;
}

.task-empty-row td {
  color: var(--muted);
  font-size: 0.85rem;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green-600);
  font-size: 0.86rem;
  font-weight: 800;
}

.invoice-proof {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.invoice-proof h3,
.invoice-proof p {
  margin: 0;
}

.inline-upload-form {
  display: inline-flex;
}

.inline-upload-form label {
  cursor: pointer;
}

.inline-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--green-50);
}

.client-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 8px 6px 6px;
  border: 1px solid rgba(64, 85, 58, 0.14);
  border-radius: 999px;
  background: var(--white);
  color: var(--green-600);
  font-size: 0.82rem;
  font-weight: 800;
}

.client-chip img,
.client-chip b {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.client-chip img {
  object-fit: cover;
}

.client-chip b {
  display: grid;
  place-items: center;
  background: var(--green-100);
  color: var(--ink);
  font-size: 0.66rem;
}

.client-chip button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--cream-2);
  color: var(--green-600);
  cursor: pointer;
}

.client-chip button svg {
  width: 13px;
  height: 13px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(230px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-column {
  min-height: 560px;
  padding: 14px;
  background: rgba(255, 254, 250, 0.74);
}

.kanban-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 800;
}

.task-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
  margin-bottom: 10px;
  cursor: pointer;
}

.task-card h4 {
  margin: 0 0 8px;
}

.task-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.compact-button {
  min-height: 28px;
  padding: 5px 10px;
  font-size: 0.76rem;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--green-600);
  font-size: 0.82rem;
  font-weight: 800;
}

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

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

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 24px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

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

.empty-state {
  padding: 34px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.calendar-weekday {
  padding: 0 4px 4px;
  color: var(--green-600);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 130px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 254, 250, 0.75);
}

.calendar-day.non-working {
  background: rgba(248, 222, 219, 0.55);
  border-color: #efc8c2;
}

.calendar-day.today {
  background: var(--green-50);
  border-color: var(--green-200);
}

.calendar-day.today.non-working {
  background: #f8dedb;
}

.calendar-task {
  margin-top: 8px;
  padding: 8px;
  border-radius: 11px;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 0.78rem;
}

.calendar-task.work-event.holiday {
  background: #f8dedb;
  border-color: #efb8b1;
  color: #8d332d;
}

.calendar-task.work-event.partial {
  background: #f7ead5;
  border-color: #edcf9d;
  color: #88510f;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  display: grid;
  gap: 10px;
}

.toast {
  padding: 12px 15px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--cream);
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

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

  .grid.two,
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

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

  .login-brand {
    min-height: 48vh;
    padding: 28px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 16;
    inset: 0 auto 0 0;
    width: min(320px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 14px;
  }

  .user-chip .user-text {
    display: none;
  }

  .content {
    padding: 24px 16px 42px;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .grid.metrics,
  .grid.three,
  .projects-grid,
  .contact-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 24px;
  }

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