:root {
  color-scheme: light;
  --bg: #eef3fb;
  --bg-2: #f8fbff;
  --card: rgba(255, 255, 255, 0.86);
  --card-solid: #ffffff;
  --line: rgba(148, 163, 184, 0.26);
  --text: #111827;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --primary: #2563eb;
  --primary-2: #7c3aed;
  --primary-soft: #e8efff;
  --success: #059669;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --shadow: 0 22px 70px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 14px 40px rgba(15, 23, 42, 0.08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --log-bg: #07111f;
  --log-fg: #d7e4ff;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(37, 99, 235, 0.2), transparent 26rem),
    radial-gradient(circle at 88% 4%, rgba(124, 58, 237, 0.18), transparent 24rem),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000, transparent 80%);
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 28px;
  overflow: hidden;
  padding: 34px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 64, 175, 0.94) 55%, rgba(88, 28, 135, 0.9)),
    radial-gradient(circle at 82% 20%, rgba(255, 255, 255, 0.3), transparent 18rem);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-card::after {
  position: absolute;
  right: -120px;
  bottom: -160px;
  width: 360px;
  height: 360px;
  content: "";
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 65%);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 12px;
  padding: 6px 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.eyebrow.dark {
  margin-bottom: 8px;
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.12);
}

.hero-card h1 {
  max-width: 680px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.hero-card p {
  max-width: 620px;
  margin-top: 18px;
  color: rgba(226, 232, 240, 0.86);
  font-size: 16px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.connection-pill,
.soft-pill,
.card-badge,
.live-dot,
.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  white-space: nowrap;
}

.connection-pill,
.soft-pill {
  gap: 8px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(14px);
}

.connection-pill::before,
.live-dot::before {
  width: 8px;
  height: 8px;
  content: "";
  background: #22c55e;
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

.metric-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-self: end;
}

.metric-card {
  min-height: 142px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  backdrop-filter: blur(18px);
}

.metric-label {
  display: block;
  color: rgba(226, 232, 240, 0.78);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 18px;
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 10px;
  color: rgba(226, 232, 240, 0.72);
}

.tabs {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  gap: 10px;
  width: fit-content;
  margin: -24px auto 24px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 148px;
  padding: 10px 16px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 999px;
}

.tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.28);
}

.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.workspace {
  padding-bottom: 24px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

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

.panel-title h2 {
  font-size: 28px;
  letter-spacing: -0.03em;
}

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

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

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

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

.section-card {
  padding: 22px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

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

.card-head h3 {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.card-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.card-badge,
.live-dot {
  gap: 8px;
  padding: 7px 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  background: var(--primary-soft);
}

.live-dot {
  color: var(--success);
  background: var(--success-soft);
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-group > label {
  display: block;
}

.field-group small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

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

.select-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 13px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.72);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.toggle-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 12px;
  color: var(--text);
  background: linear-gradient(180deg, #fff, rgba(248, 250, 252, 0.84));
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
}

.toggle-card.compact {
  min-height: 54px;
}

.toggle-card input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.toggle-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

.inline-check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--text);
  background: rgba(248, 250, 252, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 13px;
}

.inline-check input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--primary);
}

.command-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(239, 246, 255, 0.78)),
    var(--card-solid);
}

.command-grid,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.command-grid {
  flex-direction: column;
}

.schedule-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
}

.schedule-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.schedule-countdown {
  min-height: 42px;
  padding: 11px 12px;
  color: var(--primary);
  font-weight: 800;
  text-align: center;
  background: var(--primary-soft);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  color: var(--text);
  cursor: pointer;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 13px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.btn:hover {
  border-color: rgba(37, 99, 235, 0.36);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.btn:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

.btn.compact-btn {
  min-width: 128px;
  white-space: nowrap;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.28);
}

.btn.secondary {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.2);
}

.btn.ghost {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(37, 99, 235, 0.14);
  box-shadow: none;
}

.btn.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(220, 38, 38, 0.14);
}

.log-card {
  padding-bottom: 18px;
}

.log {
  min-height: 230px;
  max-height: 380px;
  padding: 18px;
  overflow: auto;
  color: var(--log-fg);
  white-space: pre-wrap;
  background:
    radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.16), transparent 22rem),
    var(--log-bg);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.table-card-head {
  align-items: center;
}

.account-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin: 2px 0 16px;
  padding: 14px;
  background: rgba(248, 250, 252, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.78);
}

.account-table {
  min-width: 880px;
  font-size: 12px;
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.account-table th,
.account-table td {
  padding: 7px 10px;
  line-height: 1.25;
}

.account-table input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
}

.account-table .status-pill {
  padding: 3px 7px;
  font-size: 11px;
}

th {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(248, 250, 252, 0.92);
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

td.empty {
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.status-pill {
  padding: 5px 9px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  background: #f1f5f9;
}

.balance-pill {
  min-height: 42px;
  justify-content: center;
  padding: 10px 12px;
  font-size: 13px;
}

.status-pill.ok {
  color: var(--success);
  background: var(--success-soft);
}

.status-pill.warn {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-pill.multiline {
  align-items: flex-start;
  border-radius: 14px;
  line-height: 1.35;
  white-space: pre-line;
}

.account-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.pagination-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
}

.pagination-actions .btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

@media (max-width: 1120px) {
  .hero-card {
    grid-template-columns: 1fr;
  }

  .span-4,
  .span-8 {
    grid-column: span 12;
  }

  .command-grid {
    flex-direction: row;
  }

  .account-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 10px;
  }

  .hero-card {
    padding: 24px;
    border-radius: 22px;
  }

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

  .tabs {
    position: static;
    width: 100%;
    margin: 12px 0 18px;
  }

  .tab {
    flex: 1;
    min-width: 0;
    justify-content: center;
  }

  .panel-title,
  .card-head,
  .table-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar,
  .command-grid {
    width: 100%;
  }

  .country-field {
    grid-column: span 1;
  }

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

  .account-filters {
    grid-template-columns: 1fr;
  }

  .account-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-actions {
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .btn.compact-btn {
    min-width: 0;
  }
}
