:root {
  --evotrope-ink: #202833;
  --evotrope-muted: #697586;
  --evotrope-soft: #f6f8fb;
  --evotrope-line: #dfe5ee;
  --evotrope-panel: #ffffff;
  --evotrope-accent: #168c7d;
  --evotrope-accent-dark: #0d6f63;
  --evotrope-accent-soft: #e8f7f4;
  --evotrope-warm: #b7791f;
  --evotrope-danger: #b42318;
  --evotrope-danger-soft: #fff1f0;
  --evotrope-success: #107a48;
  --evotrope-success-soft: #ecfdf3;
  --evotrope-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 28px rgba(16, 24, 40, .06);
}

html {
  background: var(--evotrope-soft);
}

body {
  color: var(--evotrope-ink);
  background:
    linear-gradient(180deg, #f8fafc 0, #f3f6fa 260px, #f6f8fb 100%);
}

a {
  color: var(--evotrope-accent);
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 1000;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
  padding: 8px 12px;
  background: var(--evotrope-panel);
  color: var(--evotrope-ink);
  border: 1px solid var(--evotrope-line);
  border-radius: 6px;
  box-shadow: var(--evotrope-shadow);
}

.sidebar {
  background: #172231;
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-brand {
  height: 64px;
  min-height: 64px;
  padding-inline: 18px;
}

.brand-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #21b09e, #126b61);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.brand-name {
  font-size: 15px;
  line-height: 1.1;
}

.brand-name small {
  display: block;
  margin: 2px 0 0;
  color: #98a6b8;
}

.nav-group {
  padding: 10px;
}

.nav-label {
  padding: 12px 10px 8px;
  color: #7f91a7;
  letter-spacing: .08em;
}

.nav-link {
  min-height: 38px;
  margin-bottom: 3px;
  border-radius: 7px;
  padding: 8px 10px;
  color: #a7b4c4;
  font-size: 13px;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
}

.nav-link.active {
  color: #fff;
  background: rgba(22, 140, 125, .28);
  box-shadow: inset 3px 0 0 #23b8a6;
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
  flex: 0 0 auto;
}

.nav-link.active .nav-dot {
  opacity: 1;
}

.topbar {
  height: 64px;
  min-height: 64px;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid rgba(214, 221, 230, .9);
  box-shadow: 0 1px 0 rgba(16, 24, 40, .03);
}

.sidebar-toggle {
  border: 1px solid var(--evotrope-line);
  background: #fff;
  box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
}

.breadcrumb {
  min-width: 0;
}

.topbar-logout {
  margin-left: auto;
}

.main {
  padding-top: 64px;
}

.page-wrapper {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 28px 28px 48px;
}

.page-header {
  margin-bottom: 18px;
}

.page-header-row {
  align-items: flex-end;
  gap: 16px;
}

.page-pretitle {
  color: var(--evotrope-accent-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.page-title {
  margin-top: 2px;
  color: #17202c;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.row {
  gap: 16px;
  margin-bottom: 18px;
}

.card {
  background: var(--evotrope-panel);
  border: 1px solid rgba(215, 222, 232, .95);
  border-radius: 8px;
  box-shadow: var(--evotrope-shadow);
  overflow: hidden;
}

.card + .card,
.card + .row,
.row + .card {
  margin-top: 18px;
}

.card-header {
  min-height: 58px;
  padding: 16px 18px;
  border-bottom: 1px solid #edf1f6;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.card-title {
  margin: 0;
  color: #202833;
  font-size: 15px;
  font-weight: 700;
}

.card-subtitle {
  margin: 3px 0 0;
  color: var(--evotrope-muted);
  font-size: 12.5px;
}

.card-body {
  padding: 18px;
}

.card-body p {
  margin: 0;
}

.card-body.padded {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.stat {
  min-height: 128px;
  display: flex;
  align-items: stretch;
  padding: 18px;
  position: relative;
}

.stat::before {
  content: "";
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--evotrope-accent), #e0a33a);
  position: absolute;
  inset: 18px auto 18px 0;
}

.stat-content {
  display: grid;
  gap: 7px;
  align-content: center;
  min-width: 0;
}

.stat-label {
  color: var(--evotrope-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-value {
  color: #182230;
  font-size: 34px;
  font-weight: 750;
  line-height: 1;
}

.stat-subtext {
  color: var(--evotrope-muted);
  font-size: 13px;
}

.btn {
  min-height: 36px;
  height: auto;
  border-radius: 6px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  color: #fff;
  background: var(--evotrope-accent);
  border-color: var(--evotrope-accent-dark);
  box-shadow: 0 1px 1px rgba(16, 24, 40, .06);
}

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

.btn-outline {
  color: #344054;
  background: #fff;
  border-color: #cfd8e3;
  box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
}

.btn-outline:hover {
  color: #182230;
  background: #f8fafc;
  border-color: #b8c3d1;
}

.alert {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-weight: 600;
}

.alert-danger {
  background: var(--evotrope-danger-soft);
  border: 1px solid #fecdca;
  color: var(--evotrope-danger);
}

.alert-success {
  background: var(--evotrope-success-soft);
  border: 1px solid #abefc6;
  color: var(--evotrope-success);
}

.alert-warning {
  background: #fffaeb;
  border: 1px solid #fedf89;
  color: #93370d;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: #596579;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.data-table td {
  color: #344054;
}

.data-table tbody tr {
  transition: background .12s;
}

.data-table tbody tr:hover {
  background: #fbfcfe;
}

.data-table tbody tr:last-child td,
.data-table tbody tr:last-child th {
  border-bottom: 0;
}

.data-table td[colspan] {
  color: var(--evotrope-muted);
  text-align: center;
  padding: 30px 16px;
}

.table-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions form {
  margin: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef4ff;
  color: #175cd3;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.workflow-chip {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(215, 222, 232, .95);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  text-decoration: none;
}

.workflow-chip:hover {
  border-color: rgba(22, 140, 125, .35);
  color: #182230;
  text-decoration: none;
}

.workflow-chip span {
  color: var(--evotrope-muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.workflow-chip strong {
  color: var(--evotrope-accent-dark);
  font-size: 26px;
  line-height: 1;
}

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

.calendar-card {
  min-width: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: #edf1f6;
  gap: 1px;
}

.calendar-grid-week {
  min-height: 640px;
}

.calendar-weekday {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: var(--evotrope-muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.calendar-day {
  min-height: 158px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #fff;
  transition: background .12s, box-shadow .12s;
}

.calendar-grid-week .calendar-day {
  min-height: 540px;
}

.calendar-day.muted {
  background: #fbfcfe;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px rgba(22, 140, 125, .28);
}

.calendar-day.is-drop-target {
  background: #e8f7f4;
  box-shadow: inset 0 0 0 2px var(--evotrope-accent);
}

.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #344054;
  font-weight: 750;
}

.calendar-day-head strong {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--evotrope-accent-soft);
  color: var(--evotrope-accent-dark);
  font-size: 12px;
}

.calendar-events {
  display: grid;
  gap: 7px;
}

.calendar-event {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid #dbe4ef;
  border-left: 4px solid var(--evotrope-accent);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.calendar-event[draggable="true"] {
  cursor: grab;
}

.calendar-event.is-dragging {
  opacity: .55;
}

.calendar-event.event-publication {
  border-left-color: #b7791f;
}

.calendar-event-time {
  color: var(--evotrope-accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.calendar-event-title {
  color: #202833;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.35;
}

.calendar-event-meta,
.calendar-event-footer {
  color: var(--evotrope-muted);
  font-size: 11.5px;
}

.calendar-event-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-reschedule {
  position: relative;
}

.calendar-reschedule summary {
  color: var(--evotrope-accent);
  cursor: pointer;
  font-weight: 750;
  list-style: none;
}

.calendar-reschedule summary::-webkit-details-marker {
  display: none;
}

.calendar-reschedule form {
  width: 260px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--evotrope-shadow);
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
}

.calendar-reschedule input {
  min-height: 38px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  padding: 8px;
}

.calendar-side {
  position: sticky;
  top: 82px;
}

.calendar-agenda {
  display: grid;
  gap: 1px;
  background: #edf1f6;
}

.agenda-item {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  background: #fff;
  color: #344054;
  text-decoration: none;
}

.agenda-item:hover {
  color: #182230;
  text-decoration: none;
  background: #fbfcfe;
}

.agenda-item strong {
  color: #202833;
  font-size: 13px;
  line-height: 1.35;
}

.agenda-item span {
  color: var(--evotrope-muted);
  font-size: 12px;
}

.agenda-date {
  color: var(--evotrope-accent-dark) !important;
  font-weight: 750;
}

.agenda-empty {
  padding: 28px 16px;
  background: #fff;
  color: var(--evotrope-muted);
  text-align: center;
}

.muted-text {
  color: var(--evotrope-muted);
  font-size: .875rem;
}

.inline-search {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.inline-search label {
  margin: 0 -2px 0 0;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.inline-search input,
.inline-search select {
  flex: 1 1 220px;
}

.inline-search input,
.inline-search select,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
  color: #1f2937;
  padding: 9px 11px;
  font: inherit;
  transition: border-color .12s, box-shadow .12s, background .12s;
}

.inline-search input:focus,
.inline-search select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--evotrope-accent);
  box-shadow: 0 0 0 3px rgba(22, 140, 125, .14);
  outline: none;
}

.form-group textarea {
  resize: vertical;
  line-height: 1.45;
}

.form-group input:disabled {
  background: #f2f4f7;
  color: #667085;
}

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

.form-grid.single {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.form-grid .form-group,
.form-grid .checkbox-line {
  grid-column: span 6;
}

.form-grid.single .form-group,
.form-grid.single .checkbox-line,
.form-grid .full {
  grid-column: 1 / -1;
}

.form-group {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.form-group label {
  color: #344054;
  font-size: 12.5px;
  font-weight: 750;
}

.field-error {
  color: var(--evotrope-danger);
  font-size: 12.5px;
  font-weight: 600;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

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

.checkbox-line {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  color: #344054;
  font-weight: 600;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--evotrope-accent);
}

.audit-filters {
  align-items: flex-end;
}

.audit-table td {
  vertical-align: top;
}

.json-preview {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #263244;
  max-width: 420px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.secret-preview {
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  font-family: Consolas, Monaco, monospace;
  padding: 12px;
  resize: vertical;
  width: 100%;
  min-height: 180px;
  background: #fbfcfe;
}

.pagination-row {
  align-items: center;
  border-top: 1px solid #edf1f6;
  color: var(--evotrope-muted);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 14px 18px;
}

.recovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 20px;
}

.recovery-grid code {
  background: #f8fafc;
  border: 1px solid #dfe5ee;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}

.auth-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #f8fafc, #eef3f7);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 440px);
  background: #fff;
  border: 1px solid #dde5ed;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 24px 70px rgba(16, 24, 40, .14);
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.login-brand h1 {
  margin: 0 0 4px;
  color: #182230;
  font-size: 24px;
}

.login-brand p {
  margin: 0;
  color: var(--evotrope-muted);
}

.login-form {
  display: grid;
  gap: 16px;
}

.auth-link {
  justify-self: center;
  color: var(--evotrope-accent);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 1200px) {
  .page-wrapper {
    max-width: 100%;
  }
}

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

  .calendar-side {
    position: static;
  }

  .form-grid,
  .form-grid.single {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .form-grid .form-group,
  .form-grid .checkbox-line,
  .form-grid .full,
  .form-grid.single .form-group,
  .form-grid.single .checkbox-line {
    grid-column: 1 / -1;
  }

  .inline-search {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-search input,
  .inline-search select,
  .inline-search .btn {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .page-wrapper {
    padding: 18px 14px 34px;
  }

  .page-title {
    font-size: 22px;
  }

  .page-header-row {
    align-items: stretch;
  }

  .page-actions,
  .page-actions .btn,
  .form-actions,
  .form-actions .btn {
    width: 100%;
  }

  .page-actions .btn,
  .form-actions .btn {
    justify-content: center;
  }

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

  .data-table {
    min-width: 680px;
  }

  .calendar-grid {
    display: block;
    background: transparent;
  }

  .calendar-weekday {
    display: none;
  }

  .calendar-day,
  .calendar-grid-week .calendar-day {
    min-height: 0;
    margin-bottom: 10px;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
  }

  .calendar-day.muted {
    display: none;
  }

  .calendar-reschedule form {
    width: min(260px, calc(100vw - 56px));
    left: 0;
    right: auto;
  }
}
