:root {
  --ink: #101828;
  --muted: #667085;
  --blue: #2e6cff;
  --blue-2: #1f58df;
  --blue-3: #0f3fb4;
  --card: #eef1f6;
  --panel: #f6f7fb;
  --line: #d6dbe5;
  --dark: #2b2d33;
  --shadow: 0 20px 60px rgba(12, 26, 75, 0.15);
  --radius-lg: 20px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }

body {
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(1200px 600px at 10% 10%, #e8f0ff 0%, #f7f8fb 40%, #f3f4f8 100%);
  color: var(--ink);
}

.login-shell { min-height: 100vh; }

.brand-panel {
  background: linear-gradient(160deg, #f5f7ff 0%, #e6eeff 55%, #dfe7ff 100%);
  padding: 64px;
  position: relative;
  overflow: hidden;
}

.brand-panel::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 108, 255, 0.35) 0%, rgba(46, 108, 255, 0) 70%);
}

.brand-title {
  font-family: "Archivo Black", "Archivo", Arial, sans-serif;
  font-size: 54px;
  letter-spacing: 0.04em;
  color: var(--blue);
  line-height: 1.05;
}

.brand-sub {
  font-size: 20px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 18px;
  max-width: 420px;
}

.brand-mark {
  font-size: 24px;
  letter-spacing: 0.2em;
  color: #2a4db8;
  text-transform: uppercase;
  margin-top: 12px;
}

.brand-footer {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #5a6bb2;
  font-weight: 700;
}

.login-card {
  max-width: 420px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-header {
  background: linear-gradient(135deg, #2e6cff 0%, #5a8cff 100%);
  color: white;
  padding: 20px 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
}

.login-body {
  padding: 24px;
}

.server-badge {
  font-size: 13px;
  font-weight: 600;
  color: #344054;
  background: #f3f4f6;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
}

.login-footer {
  color: #6b7280;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: transparent;
  border: none;
}

.error-banner {
  background: #fff2f0;
  border: 1px solid #ffd9d4;
  color: #b42318;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 14px;
}

.dashboard-shell {
  min-height: 100vh;
  background: #dfe1e6;
  padding: 10px 12px 14px;
}

.top-header {
  padding: 0;
}

.brand-line {
  font-size: 13px;
  font-weight: 700;
  color: #1182ce;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: 0.08em;
}

.brand-mark {
  font-size: 24px;
  letter-spacing: 0.2em;
  color: #2a4db8;
  text-transform: uppercase;
  margin-top: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue-3);
  font-weight: 700;
  font-size: 12px;
}

.lang-icon {
  font-size: 16px;
  line-height: 1;
}

.lang-select {
  width: 64px;
  font-weight: 700;
  border-radius: 2px;
  border-color: #acafba;
  background: #f4f5f8;
  height: 28px;
  font-size: 13px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  min-height: 72px;
}

.left-logo-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  padding: 4px 0;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid #aeb1bc;
  border-radius: 2px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  background: #f6f7f9;
}

.top-bar {
  min-height: 52px;
  background: #4a4a4f;
  border-radius: 14px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow-x: auto;
  flex: 1 1 auto;
  min-width: 0;
}

.state-chips-group {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.top-bar-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.top-bar-wrap .header-controls {
  min-height: auto;
  flex: 0 0 auto;
  justify-content: flex-start;
  margin-left: auto;
}

.top-wordmark-logo {
  width: 280px !important;
  height: auto !important;
  max-height: 108px !important;
  display: block;
  flex: 0 0 auto;
  cursor: pointer;
  object-fit: contain;
  margin-right: 2px;
}

.top-corner-logo {
  width: 30px;
  height: 30px;
  display: block;
  flex: 0 0 auto;
  cursor: pointer;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #c8d1e2;
  padding: 4px;
  margin-right: 6px;
}

.home-chip {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 2px solid #0d8bff;
  color: #0d8bff;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
}

.nav-pill,
.state-chip {
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}

.sponsor-badge {
  background: #f7f7f8;
  border: 1px solid #d4d6dc;
  border-radius: 2px;
  color: #22262e;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  padding: 10px 14px;
  white-space: nowrap;
}

.nav-pill,
.state-chip.active {
  background: #4ba5ff;
  color: #ffffff;
}

.state-chip.off {
  background: #efeff1;
  color: #101828;
}

.side-panel {
  background: #d2d5de;
  border-radius: 20px;
  border: 1px solid #b9bdca;
  padding: 14px;
}

.module-card {
  background: #c9ced8;
  border-radius: 16px;
  padding: 14px 14px 12px;
  margin-bottom: 12px;
  border: 1px solid #c1c6d1;
}

.module-card h3 {
  margin: 0 0 10px;
  background: #4ba5ff;
  color: white;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 700;
  text-align: center;
}

.module-card p {
  font-size: 13px;
  line-height: 1.35;
  color: #111827;
  min-height: 110px;
  text-align: center;
  margin: 0;
}

.module-card .cta {
  display: flex;
  justify-content: center;
}

.module-card .cta button {
  border: none;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #4ba5ff;
  color: white;
  font-size: 38px;
  font-weight: 700;
}

.content-panel {
  background: #dfe1e6;
  border: none;
  min-height: 100%;
  color: #6b7280;
  font-weight: 600;
  position: relative;
}

.stack-view {
  display: none;
  height: 100%;
}

.stack-view.active {
  display: block;
}

.stack-page {
  min-height: 420px;
  border: 2px dashed #e84b4b;
  border-radius: 12px;
  margin: 0;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  background: #f7f8fb;
}

.stack-page h2 {
  margin: 0;
  color: #0f172a;
  font-weight: 800;
}

.stack-page p {
  margin: 0;
  color: #475467;
  max-width: 640px;
}

.control-title {
  text-align: center;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #111827;
  margin: 6px 0 10px;
}

.panel-filter-row {
  display: flex;
  gap: 8px;
  padding: 0 2px;
  margin-bottom: 6px;
}

.panel-filter-input {
  flex: 0 1 390px;
  border: 1px solid #aeb1bc;
  border-radius: 2px;
  font-size: 13px;
  padding: 3px 6px;
  height: 30px;
}

.btn-filter {
  border: 1px solid #aeb1bc;
  background: #eceef2;
  color: #111827;
  border-radius: 2px;
  min-width: 74px;
  height: 30px;
  font-size: 13px;
  font-weight: 600;
}

.table-shell {
  width: 100%;
  height: 100%;
  padding: 0;
}

.table-wrap {
  background: #e5e6ea;
  border-radius: 0;
  padding: 0;
  border: 1px solid #c3c6ce;
  max-height: calc(100vh - 245px);
  overflow-y: auto;
  overflow-x: auto;
}

.data-table {
  font-size: 13px;
  margin: 0;
  width: 100%;
}

.data-table th {
  text-align: left;
  color: #0f172a;
  font-weight: 500;
  padding: 5px 8px;
  border-bottom: 1px solid #bec3cc;
  background: #eceef2;
  font-size: 12px;
  text-transform: uppercase;
}

.data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #c8ccd4;
  color: #101828;
  height: auto;
}

.data-table tbody tr:nth-child(odd) > td {
  background: #ffffff !important;
}

.data-table tbody tr:nth-child(even) > td {
  background: #f3f4f6 !important;
}

.table-empty {
  text-align: center;
  padding: 20px;
  color: #98a2b3;
}

.state-pill {
  font-weight: 700;
  font-size: 13px;
}

.progress-line {
  width: 100%;
  height: 16px;
  border: 1px solid #a5abb7;
  border-radius: 2px;
  background: #eef0f4;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #1d8cff;
}

.progress-label {
  font-size: 12px;
  color: #475467;
  margin-top: 0;
}

.actions-cell {
  white-space: nowrap;
}

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

.action-select {
  height: 26px;
  border: 1px solid #aeb1bc;
  background: #f4f5f8;
  border-radius: 2px;
  font-size: 12px;
  min-width: 112px;
}

.action-link {
  border: none;
  background: transparent;
  color: #6b7280;
  text-decoration: none;
  font-size: 13px;
  padding: 0;
}

.action-link.strong {
  color: #0f172a;
  font-weight: 600;
}

@media (max-width: 1024px) {
  .header-controls {
    justify-content: flex-start;
    min-height: auto;
  }
  .module-card h3 {
    font-size: 16px;
  }
  .module-card p {
    font-size: 13px;
    min-height: 0;
  }
  .panel-filter-input {
    flex: 1;
  }
}
