:root {
  --bg: #f3f6fb;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-dark: #08111f;
  --line: #d8e0ea;
  --line-strong: #b9c6d8;
  --text: #0f172a;
  --muted: #607087;
  --accent: #13253f;
  --accent-soft: #dce8fb;
  --accent-warm: #8a6135;
  --success: #157347;
  --danger: #b42318;
  --warning: #b7791f;
  --shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-ui: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", "Menlo", "Consolas", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(138, 97, 53, 0.14), transparent 34%),
    linear-gradient(180deg, #f8fafc 0%, #eef3f9 100%);
  color: var(--text);
  font-family: var(--font-ui);
}

body {
  min-width: 320px;
}

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

img {
  max-width: 100%;
  display: block;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, rgba(8, 17, 31, 0.97), rgba(19, 37, 63, 0.94));
  color: #eef4ff;
}

.brand-card,
.nav-card,
.terminal-card {
  min-width: 0;
  border-radius: var(--radius-lg);
}

.brand-card {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.brand-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-meta {
  margin: 6px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(238, 244, 255, 0.7);
  word-break: break-word;
}

.nav-card {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 6px 0;
  padding: 13px 14px;
  border-radius: 14px;
  color: rgba(238, 244, 255, 0.76);
  transition: 0.18s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(255,255,255,0.11);
  color: #ffffff;
}

.nav-link span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sidebar-footer {
  margin-top: 18px;
}

.terminal-card {
  margin-top: 18px;
  padding: 18px;
  background: radial-gradient(circle at top right, rgba(38, 211, 141, 0.18), transparent 42%), #050b14;
  border: 1px solid rgba(38, 211, 141, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.terminal-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6ee7b7;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
}

.terminal-screen {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.42);
  color: #d8ffe8;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  min-width: 0;
}

.terminal-screen p {
  margin: 0 0 7px;
  overflow-wrap: anywhere;
}

.content {
  min-width: 0;
  padding: 26px;
}

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

.topbar h1 {
  margin: 0;
  font-size: clamp(1.75rem, 2vw, 2.3rem);
  line-height: 1.1;
}

.topbar p {
  margin: 8px 0 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}

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

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.card,
.panel,
.table-card,
.form-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.card {
  padding: 20px;
}

.card-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-value {
  margin: 0;
  font-size: clamp(1.8rem, 2vw, 2.4rem);
  font-weight: 700;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.card-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.panel,
.form-card,
.table-card {
  padding: 22px;
}

.panel + .panel,
.panel + .table-card,
.form-card + .table-card,
.table-card + .table-card {
  margin-top: 18px;
}

.panel-title {
  margin: 0 0 16px;
  font-size: 1.15rem;
  line-height: 1.25;
}

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

.btn,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.btn {
  background: linear-gradient(135deg, #13253f, #25466f);
  color: #fff;
  box-shadow: 0 12px 22px rgba(19, 37, 63, 0.22);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text);
  border-color: var(--line);
}

.btn-danger {
  background: #fff5f4;
  color: var(--danger);
  border-color: #f2c4bf;
}

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

.field {
  min-width: 0;
}

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

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.input,
.textarea,
.select {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.textarea {
  min-height: 150px;
  resize: vertical;
}

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

.toolbar {
  justify-content: space-between;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.status-active,
.status-sent,
.status-completed {
  background: #e8fff1;
  color: var(--success);
}

.status-draft,
.status-pending {
  background: #ebf3ff;
  color: #264a79;
}

.status-paused,
.status-warning,
.status-skipped {
  background: #fff6e8;
  color: var(--warning);
}

.status-failed,
.status-danger,
.status-blocked,
.status-bounced {
  background: #fff1f0;
  color: var(--danger);
}

.progress-shell {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

.progress-bar {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: #dbe6f3;
  overflow: hidden;
}

.progress-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #13253f, #8a6135);
}

.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  line-height: 1.5;
}

.alert-success {
  background: #edfff4;
  border-color: #bde4cd;
  color: #14532d;
}

.alert-error {
  background: #fff5f3;
  border-color: #efc2bb;
  color: #8d1c13;
}

.mobile-nav-toggle {
  display: none;
}

.stack {
  display: grid;
  gap: 18px;
}

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

.checkbox-list {
  display: grid;
  gap: 10px;
  max-height: 240px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.7);
}

.terminal-log {
  margin: 0;
  padding-left: 18px;
  color: #c6f6d5;
  font-family: var(--font-mono);
  line-height: 1.6;
}

.table-mobile {
  display: none;
}

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

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

  .sidebar {
    position: fixed;
    inset: 0 18% 0 0;
    z-index: 30;
    transform: translateX(-104%);
    transition: transform 0.22s ease;
  }

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

  .content {
    padding: 18px;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .card-grid,
  .form-grid,
  .split,
  .progress-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .panel,
  .form-card,
  .table-card,
  .card {
    padding: 18px;
    border-radius: 18px;
  }

  table {
    display: none;
  }

  .table-mobile {
    display: grid;
    gap: 12px;
  }

  .table-mobile-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,0.92);
  }

  .table-mobile-card strong,
  .table-mobile-card span {
    overflow-wrap: anywhere;
  }

  .sidebar {
    inset: 0 10% 0 0;
  }
}
