:root {
  --ink: #f6f8fb;
  --muted: #9ca8b8;
  --line: rgba(255, 255, 255, 0.1);
  --panel: rgba(17, 23, 32, 0.9);
  --page: #070b10;
  --brand: #2dd4bf;
  --brand-dark: #14b8a6;
  --accent: #f2b84b;
  --danger: #f04452;
  --navy: #0b111a;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(45, 212, 191, 0.16) 0 8%, transparent 8% 34%, rgba(242, 184, 75, 0.08) 34% 38%, transparent 38% 74%, rgba(240, 68, 82, 0.1) 74% 78%, transparent 78%),
    linear-gradient(180deg, #08111a 0%, var(--page) 100%);
  font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
}

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

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

.sidebar {
  background:
    linear-gradient(160deg, rgba(45, 212, 191, 0.13), transparent 30%),
    linear-gradient(180deg, var(--navy), #0b1018 62%, #111815);
  color: #fff;
  padding: 24px;
  box-shadow: 14px 0 45px rgba(18, 32, 52, 0.14);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 32px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #38bdf8);
  font-weight: 700;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #b9c2cf;
  font-size: 14px;
}

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

.nav-button {
  display: block;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  color: #dfe6ef;
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-button.nav-link {
  width: 100%;
}

.nav-button:hover,
.nav-button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

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

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

.cloud-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cloud-pill,
.ghost-action {
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: #dbe5f1;
  background: rgba(255, 255, 255, 0.075);
  font-size: 13px;
  font-weight: 800;
}

.cloud-pill.connected {
  color: #06120f;
  background: linear-gradient(135deg, var(--brand), #8bd8a2);
}

.cloud-pill.warning {
  color: #1a1203;
  background: linear-gradient(135deg, var(--accent), #f7d47a);
}

.ghost-action {
  cursor: pointer;
}

.ghost-action:hover {
  border-color: rgba(45, 212, 191, 0.55);
  color: #fff;
}

.ghost-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.save-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: #06120f;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 12px 28px rgba(45, 212, 191, 0.18);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.save-button:hover {
  filter: brightness(1.05);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

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

.status {
  min-width: 110px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
  max-width: 980px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.form-grid.compact {
  max-width: none;
  box-shadow: none;
}

.form-grid.inner {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.form-section {
  min-width: 0;
  margin: 0;
  border: 1px solid #e3e8ef;
  border-radius: 14px;
  padding: 16px;
  background: #fbfcfe;
}

.form-section legend {
  padding: 0 8px;
  color: var(--brand-dark);
  font-weight: 750;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 14px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(27, 111, 104, 0.18);
  border-color: var(--brand);
}

.span-2 {
  grid-column: span 2;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

button.primary,
button.secondary {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #1a9087);
  box-shadow: 0 10px 24px rgba(20, 116, 111, 0.22);
}

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

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

.check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

.check-grid label {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
  font-weight: 650;
}

.check-grid input {
  width: auto;
}

.client-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-row {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.client-list {
  max-height: calc(100vh - 245px);
  overflow: auto;
}

.client-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.client-item:hover,
.client-item.active {
  background: #eef8f7;
}

.client-item strong,
.client-item span {
  display: block;
}

.client-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 24px 14px;
  color: var(--muted);
  text-align: center;
}

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

  .sidebar {
    padding: 16px;
  }

  .brand {
    margin-bottom: 16px;
  }

  .workspace {
    padding: 18px;
  }

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

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

  .span-2 {
    grid-column: span 1;
  }
}

.form-grid,
.panel {
  backdrop-filter: blur(12px);
}

.status,
input,
select,
textarea,
.client-item,
.check-grid label {
  border-color: rgba(255, 255, 255, 0.13);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.075);
}

label,
.date-field {
  color: #dbe5f1;
}

.form-section {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.client-item:hover,
.client-item.active {
  background: rgba(45, 212, 191, 0.12);
}

button.primary {
  background: linear-gradient(135deg, var(--brand), #38bdf8);
}

button.primary:hover {
  background: linear-gradient(135deg, var(--brand-dark), #0ea5e9);
}

button.secondary {
  color: var(--danger);
  background: rgba(240, 68, 82, 0.14);
}
