:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #eef3f8;
  --text: #172033;
  --muted: #667287;
  --line: #dfe5ee;
  --primary: #1d6fd8;
  --primary-dark: #1456ab;
  --danger: #c93535;
  --ok-bg: #dff7e8;
  --warn-bg: #fff2c5;
  --work-bg: #dfeeff;
  --late-bg: #ffe0df;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
}

a {
  color: inherit;
}

.shell {
  margin: 0 auto;
  max-width: 1480px;
  padding: 24px;
}

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

.appbar {
  align-items: center;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.login-body {
  align-items: center;
  display: flex;
  min-height: 100vh;
}

.login-shell {
  margin: 0 auto;
  max-width: 440px;
  padding: 22px;
  width: 100%;
}

.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.full {
  width: 100%;
}

.demo-users {
  background: var(--surface-strong);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 12px;
}

.demo-users span {
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1 {
  font-size: 32px;
  line-height: 1.1;
  margin: 0;
}

.subtitle {
  color: var(--muted);
  font-size: 15px;
  margin: 8px 0 0;
}

.layout {
  display: grid;
  gap: 18px;
  grid-template-columns: 370px 1fr;
}

.panel,
.card,
.filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 18px;
}

.lower-layout {
  margin-top: 18px;
}

.wide-section {
  grid-column: 1 / -1;
}

.panel h2,
.list-head h2 {
  font-size: 19px;
  margin: 0 0 14px;
}

.field {
  margin-bottom: 13px;
}

label {
  color: #3d4a61;
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #ccd5e2;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
  width: 100%;
}

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

.button,
button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
}

.button-primary {
  background: var(--primary);
  color: #fff;
}

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

.button-light {
  background: var(--surface-strong);
  color: var(--text);
}

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

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

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

.dashboard-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.summary-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
}

.summary-link {
  color: inherit;
  display: block;
  text-decoration: none;
}

.summary-link:hover,
.summary-link.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(29, 111, 216, 0.12);
}

.summary-item strong {
  display: block;
  font-size: 24px;
}

.summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filters {
  display: grid;
  gap: 10px;
  grid-template-columns: 1.6fr 1fr 1fr auto;
  margin-bottom: 14px;
  padding: 12px;
}

.list-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.list-count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.list-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

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

.list-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.9fr) auto;
  padding: 13px;
}

.list-row p {
  color: var(--muted);
  line-height: 1.35;
  margin: 4px 0 0;
}

.row-title {
  font-size: 16px;
  font-weight: 900;
}

.row-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.cards {
  display: grid;
  gap: 12px;
}

.card {
  padding: 15px;
}

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

.contract {
  font-size: 18px;
  font-weight: 900;
  margin: 0;
}

.commitment {
  color: #2f3b52;
  line-height: 1.45;
  margin: 10px 0 12px;
}

.badge {
  border-radius: 6px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 9px;
  white-space: nowrap;
}

.estado-pendiente {
  background: var(--warn-bg);
}

.estado-en-proceso {
  background: var(--work-bg);
}

.estado-cumplido {
  background: var(--ok-bg);
}

.estado-vencido {
  background: var(--late-bg);
}

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

.meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  margin: 0 0 3px;
  text-transform: uppercase;
}

.meta dd {
  font-size: 14px;
  margin: 0;
}

.state-form {
  align-items: center;
  display: flex;
  gap: 8px;
}

.state-form select {
  max-width: 170px;
}

.empty {
  background: var(--surface);
  border: 1px dashed #bdc8d8;
  border-radius: 8px;
  color: var(--muted);
  padding: 34px;
  text-align: center;
}

.calendar-empty {
  margin-top: 14px;
}

.modal-backdrop {
  align-items: flex-start;
  background: rgba(14, 26, 43, 0.48);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  overflow-y: auto;
  padding: 36px 18px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 10;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(18, 31, 49, 0.25);
  max-width: 1080px;
  padding: 20px;
  width: 100%;
}

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

.modal-head h2 {
  font-size: 22px;
  margin: 0;
}

.modal-subtitle {
  color: var(--muted);
  font-weight: 700;
  margin: 4px 0 0;
}

.modal-close {
  background: var(--surface-strong);
  border-radius: 8px;
  font-weight: 800;
  padding: 9px 12px;
  text-decoration: none;
  white-space: nowrap;
}

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

.modal-actions {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.notice {
  background: #edf7ff;
  border: 1px solid #c8e4ff;
  border-radius: 8px;
  color: #16466f;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.error {
  background: #fff0f0;
  border-color: #ffd1d1;
  color: #8b2424;
}

.calendar-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  overflow: hidden;
}

.calendar-toolbar {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto 1fr;
  padding: 16px;
}

.calendar-toolbar h2 {
  font-size: 27px;
  margin: 0;
  text-align: center;
}

.calendar-nav,
.view-tabs {
  display: flex;
  gap: 8px;
}

.view-tabs {
  justify-content: flex-end;
}

.nav-button,
.view-tabs span {
  align-items: center;
  background: #24374d;
  border-radius: 4px;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 40px;
  min-width: 42px;
  padding: 8px 12px;
  text-decoration: none;
}

.view-tabs span {
  background: #21344d;
  min-width: auto;
}

.view-tabs .active {
  box-shadow: 0 0 0 3px rgba(36, 55, 77, 0.25);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  overflow-x: auto;
}

.calendar-head {
  background: #fbfbfc;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-weight: 900;
  padding: 8px;
  text-align: center;
  text-decoration: underline;
}

.calendar-day {
  background: #f9fcf8;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 118px;
  padding: 28px 4px 6px;
  position: relative;
}

.muted-day {
  background: #f2f5f1;
  color: #9aa4b4;
}

.today-day {
  background: #fffbdc;
}

.day-number {
  font-size: 16px;
  position: absolute;
  right: 7px;
  top: 7px;
}

.calendar-event {
  border-radius: 4px;
  color: #122033;
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 3px;
  overflow: hidden;
  padding: 6px 5px;
  text-decoration: none;
}

.calendar-event strong,
.calendar-event span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event.estado-pendiente,
.calendar-event.estado-vencido {
  background: #ffc20f;
}

.calendar-event.estado-en-proceso {
  background: #1874f5;
  color: #fff;
}

.calendar-event.estado-cumplido {
  background: #28a745;
  color: #fff;
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
}

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

.check-row {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.check-row input {
  width: auto;
}

.support-list {
  background: #f5f8fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px;
}

.support-list a {
  color: var(--primary);
  font-weight: 700;
}

.upload-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-form input[type="file"] {
  max-width: 260px;
  padding: 8px;
}

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

  .list-row {
    grid-template-columns: 1fr;
  }

  .row-meta {
    justify-content: flex-start;
  }

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

  .calendar-toolbar {
    grid-template-columns: 1fr;
  }

  .calendar-toolbar h2 {
    text-align: left;
  }

  .view-tabs {
    justify-content: flex-start;
  }

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

@media (max-width: 560px) {
  .shell {
    padding: 16px;
  }

  .topbar,
  .card-head,
  .modal-head,
  .state-form,
  .upload-form {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 27px;
  }

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

  .actions .button,
  .actions button,
  .state-form select,
  .upload-form input[type="file"] {
    width: 100%;
  }
}
