:root {
  --bg: #11131d;
  --surface: rgba(21, 22, 35, 0.78);
  --surface-strong: #151623;
  --surface-soft: #1e2233;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.12);
  --text: #f7f4ef;
  --text-muted: #c8c5c0;
  --text-dark: #151623;
  --accent: #d49a4a;
  --accent-soft: #f2d8b1;
  --line: rgba(255, 255, 255, 0.12);
  --ok: #59c07b;
  --warn: #f1b558;
  --danger: #f16d5f;
  --neutral: #dcdee3;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

body[data-theme="light"] {
  --bg: #f3f0ea;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --surface-soft: #eef1f5;
  --card: rgba(255, 255, 255, 0.92);
  --card-strong: rgba(255, 255, 255, 0.98);
  --text: #161823;
  --text-muted: #60697d;
  --text-dark: #161823;
  --line: rgba(21, 22, 35, 0.12);
  --neutral: #e6ebf1;
  --shadow: 0 18px 42px rgba(32, 33, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Montserrat", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(212, 154, 74, 0.22), transparent 26%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.1), transparent 22%),
    linear-gradient(180deg, #0d0f18 0%, #151623 100%);
  color: var(--text);
}

body[data-theme="light"] {
  background:
    radial-gradient(circle at top left, rgba(212, 154, 74, 0.18), transparent 24%),
    radial-gradient(circle at bottom right, rgba(21, 22, 35, 0.06), transparent 20%),
    linear-gradient(180deg, #f6f1e8 0%, #edf0f5 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 32px;
}

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

.auth-card {
  width: min(480px, 100%);
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(21, 22, 35, 0.92), rgba(30, 34, 51, 0.78));
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.auth-title {
  font-size: clamp(1.35rem, 2.3vw, 1.8rem) !important;
  line-height: 1.05;
}

body[data-theme="light"] .auth-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(244, 246, 250, 0.9));
}

.auth-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.top-utility {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.hero,
.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.8fr);
  gap: 20px;
  margin-bottom: 22px;
}

.hero__copy,
.hero__panel,
.detail-hero__content {
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(21, 22, 35, 0.92), rgba(30, 34, 51, 0.78));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

body[data-theme="light"] .hero__copy,
body[data-theme="light"] .hero__panel,
body[data-theme="light"] .detail-hero__content,
body[data-theme="light"] .panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(244, 246, 250, 0.9));
}

.hero__copy h1,
.detail-hero__content h1 {
  margin: 6px 0 8px;
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero__text,
.hero__hint {
  max-width: 62ch;
  color: var(--text-muted);
  line-height: 1.7;
}

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

.brand-lockup__logo {
  width: 136px;
  max-width: 28vw;
  height: auto;
  object-fit: contain;
}

.hero__panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
}

.switch-row,
.detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.switch-row--detail {
  justify-content: flex-end;
}

.switch-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.switch-pill__label {
  line-height: 1;
}

.switch-track {
  position: relative;
  display: inline-flex;
  width: 30px;
  height: 16px;
}

.switch-track input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.switch-track__slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(212, 154, 74, 0.25);
  border: 1px solid rgba(212, 154, 74, 0.24);
  transition: background 140ms ease, border-color 140ms ease;
}

.switch-track__slider::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #f0c789);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 140ms ease;
}

.switch-track input:checked + .switch-track__slider::after {
  transform: translateX(14px);
}

.switch-track input:checked + .switch-track__slider {
  background: rgba(212, 154, 74, 0.38);
  border-color: rgba(212, 154, 74, 0.48);
}

.panel__label,
.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
}

.eyebrow--dark {
  color: #876027;
}

.layout,
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 20px;
}

.panel {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.panel--wide {
  min-width: 0;
}

.sidebar {
  display: grid;
  gap: 20px;
  align-content: start;
}

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

.section-head h2 {
  margin: 4px 0 0;
  font-size: 1.45rem;
}

.dialog__body .section-head h2 {
  color: var(--text);
}

.button,
.icon-button {
  border: 0;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

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

.button {
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
}

.button--small {
  padding: 8px 12px;
  font-size: 0.78rem;
}

.button--primary {
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--accent), #efbe7a);
}

.button--secondary {
  color: var(--text-dark);
  background: var(--neutral);
}

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

.hero__link,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212, 154, 74, 0.38);
  color: var(--text);
  background: rgba(212, 154, 74, 0.12);
}

.hero__link.muted,
.hero__link.dark.muted {
  background: transparent;
  border-color: var(--line);
}

.hero__link.dark,
.back-link {
  color: var(--text-dark);
  background: linear-gradient(135deg, rgba(212, 154, 74, 0.95), rgba(244, 203, 134, 0.95));
  border-color: transparent;
  font-weight: 700;
}

.stat-grid,
.client-grid,
.form-grid {
  display: grid;
  gap: 16px;
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin-bottom: 18px;
}

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

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

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

.stat-card,
.client-card,
.stack-card,
.timeline-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--card);
}

.stat-card {
  padding: 16px;
}

.stat-card p,
.detail-hero__content p {
  margin: 0;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.55rem;
}

.stat-card p {
  font-size: 0.7rem;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.search {
  display: grid;
  gap: 6px;
  flex: 1 1 220px;
}

.search span,
label span,
fieldset legend {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 600;
}

.dialog__body label span,
.dialog__body fieldset legend,
.dialog__body .checkbox-grid label span,
.dialog__body .checkbox span {
  color: var(--text);
}

input,
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

body[data-theme="light"] input,
body[data-theme="light"] textarea,
body[data-theme="light"] select,
body[data-theme="light"] .checkbox-grid--services label,
body[data-theme="light"] .switch-pill {
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-dark);
}

select option {
  color: var(--text-dark);
}

textarea {
  resize: vertical;
}

.client-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.client-card__top,
.badge-row,
.dialog__actions,
.compact-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge-row--compact {
  gap: 8px;
}

.client-card__top {
  justify-content: space-between;
  align-items: start;
}

.client-card h3,
.timeline-item h3 {
  margin: 0;
}

.client-card__meta,
.stack-card p,
.timeline-item p,
.detail-hero__content p {
  color: var(--text-muted);
  line-height: 1.55;
}

.chip,
.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.chip {
  color: var(--text-dark);
  background: var(--accent-soft);
}

.badge.attention,
.priority-high {
  background: rgba(241, 109, 95, 0.18);
  color: #ffb0a5;
}

.badge.stable,
.priority-low {
  background: rgba(89, 192, 123, 0.18);
  color: #b2f0c5;
}

.priority-medium {
  background: rgba(241, 181, 88, 0.18);
  color: #ffd596;
}

.stack,
.timeline {
  display: grid;
  gap: 12px;
}

.stack-card,
.timeline-item {
  padding: 16px;
}

.timeline-item {
  position: relative;
  overflow: hidden;
}

.timeline-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), transparent);
}

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

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

.dialog {
  width: min(820px, calc(100% - 24px));
  border: 0;
  border-radius: 28px;
  padding: 0;
  background: transparent;
}

.dialog::backdrop {
  background: rgba(9, 11, 19, 0.74);
  backdrop-filter: blur(14px);
}

.dialog__body {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, #171926, #131520);
  border: 1px solid var(--line);
}

body[data-theme="light"] .dialog__body {
  background: linear-gradient(180deg, #ffffff, #f3f5f9);
}

.checkbox,
.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.checkbox-grid--services label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

body[data-theme="light"] .dialog__body .fieldset,
body[data-theme="light"] .dialog__body .checkbox-grid--services label,
body[data-theme="light"] .dialog__body input,
body[data-theme="light"] .dialog__body textarea,
body[data-theme="light"] .dialog__body select {
  background: #ffffff;
  color: var(--text-dark);
}

body[data-theme="light"] .dialog__body .icon-button,
body[data-theme="light"] .dialog__body .button--ghost {
  color: var(--text-dark);
  border-color: rgba(21, 22, 35, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

.checkbox input,
.checkbox-grid input {
  width: auto;
}

.fieldset {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.detail-hero {
  grid-template-columns: 1fr;
}

.detail-hero__content {
  display: grid;
  gap: 12px;
}

.detail-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.compact-form {
  margin-top: 14px;
}

.entry-form {
  margin-bottom: 22px;
}

#provider-list {
  margin-bottom: 18px;
}

#client-reminders {
  margin-top: 8px;
}

.compact-form input {
  flex: 1 1 180px;
}

.empty-state {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  color: var(--text-muted);
}

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

.profile-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  align-items: start;
}

.profile-row__label {
  color: var(--accent-soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-row__value {
  color: var(--text);
  line-height: 1.6;
}

.profile-row__value.muted {
  color: var(--text-muted);
}

.more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.footer {
  width: min(1380px, calc(100% - 32px));
  margin: 6px auto 26px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

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

@media (max-width: 640px) {
  .shell {
    width: min(100% - 18px, 1380px);
    padding-top: 18px;
  }

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

  .hero__copy,
  .hero__panel,
  .panel,
  .detail-hero__content {
    padding: 16px;
  }

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

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

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

  .detail-toolbar,
  .switch-row {
    align-items: stretch;
  }
}
