:root {
  --bg: #f4f8f4;
  --bg-soft: #e8f2ea;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --line: #d8e2d6;
  --text: #173125;
  --muted: #6b7d72;
  --primary: #186245;
  --primary-strong: #0d4d35;
  --primary-soft: #daf0e2;
  --blue: #377df7;
  --amber: #f4ba41;
  --red: #e24b4b;
  --shadow: 0 22px 50px rgba(26, 54, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(180, 224, 193, 0.65), transparent 22%),
    linear-gradient(180deg, #f9fcfa 0%, #eef6f0 58%, #f7faf8 100%);
}

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

button,
input,
select,
textarea {
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 13px 14px;
}

button {
  cursor: pointer;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  font-weight: 700;
}

button.secondary {
  background: #eef4ff;
  color: #224267;
  border: 1px solid #d9e6ff;
}

button.ghost {
  background: #f4f7f5;
  color: var(--text);
  border: 1px solid var(--line);
}

button.danger {
  background: linear-gradient(135deg, #ff6b6b 0%, #de2c2c 100%);
}

button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.auth-brand {
  padding: 48px;
  background:
    linear-gradient(160deg, rgba(13, 77, 53, 0.94), rgba(53, 122, 92, 0.84)),
    linear-gradient(120deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  position: relative;
  overflow: hidden;
}

.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(2px);
}

.auth-brand::before {
  width: 320px;
  height: 320px;
  top: -120px;
  right: -90px;
}

.auth-brand::after {
  width: 240px;
  height: 240px;
  bottom: -90px;
  left: -70px;
}

.auth-brand-top,
.auth-brand-grid,
.auth-quote,
.auth-feature-list {
  position: relative;
  z-index: 1;
}

.auth-brand h1 {
  margin: 10px 0 12px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 0.95;
}

.auth-brand-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.auth-stat {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-stat span {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.78;
}

.auth-stat strong {
  display: block;
  font-size: 17px;
  line-height: 1.35;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.auth-quote {
  max-width: 420px;
  padding: 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-feature-list {
  display: grid;
  gap: 12px;
}

.auth-feature {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(6, 35, 23, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-feature strong {
  display: block;
  margin-bottom: 6px;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.auth-card {
  width: min(100%, 470px);
  padding: 30px;
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  border: 1px solid rgba(216, 226, 214, 0.9);
  backdrop-filter: blur(10px);
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: 34px;
}

.auth-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.auth-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 10px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(24, 98, 69, 0.12), rgba(67, 126, 247, 0.12));
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field label {
  font-size: 13px;
  font-weight: 700;
  color: #335243;
}

.auth-input-shell {
  position: relative;
  padding: 3px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(24, 98, 69, 0.12), rgba(67, 126, 247, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-input-shell:focus-within {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 14px 28px rgba(24, 98, 69, 0.12);
}

.auth-input-shell input {
  width: 100%;
  border: 0;
  border-radius: 15px;
  padding: 15px 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: #173125;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.auth-input-shell input:focus {
  outline: none;
}

.auth-input-shell input::placeholder {
  color: #92a5a0;
}

.auth-security-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.auth-security-strip span {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: #eef6f0;
  color: #2b5d43;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #d8e8dc;
}

.auth-code-preview {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(49, 89, 139, 0.08), rgba(24, 98, 69, 0.08));
  border: 1px solid rgba(49, 89, 139, 0.14);
  color: #31598b;
  font-weight: 600;
  display: grid;
  gap: 6px;
}

.auth-code-preview strong {
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.12em;
  color: #1e4d7d;
}

.auth-code-preview small {
  color: #5d7893;
  font-size: 12px;
}

.auth-code-label {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5f7fa0;
}

.auth-code-preview.muted-state strong {
  font-size: 18px;
  letter-spacing: 0.02em;
  color: #6d8193;
}

.auth-code-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.auth-code-slot {
  width: 100%;
  min-height: 64px;
  border-radius: 18px;
  border: 1px solid #d6e1df;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #173125;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.auth-code-slot:focus {
  outline: none;
  border-color: rgba(24, 98, 69, 0.35);
  box-shadow:
    0 0 0 4px rgba(24, 98, 69, 0.1),
    0 14px 28px rgba(24, 98, 69, 0.12);
  transform: translateY(-1px);
}

.auth-code-slot.filled {
  border-color: rgba(24, 98, 69, 0.22);
  background: linear-gradient(180deg, #f7fffb, #eef9f3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 10px 18px rgba(24, 98, 69, 0.08);
}

.feedback {
  margin-top: 14px;
  font-size: 14px;
}

.feedback.ok {
  color: var(--primary);
}

.feedback.err {
  color: var(--red);
}

.feedback.info {
  color: #31598b;
}

.code-box {
  display: grid;
  gap: 14px;
}

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

.sidebar {
  padding: 16px;
  background: linear-gradient(180deg, #eff6ef 0%, #f7fbf8 100%);
  border-right: 1px solid #dce7db;
}

.brand-card,
.profile-card,
.nav-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.brand-card,
.profile-card {
  padding: 18px;
}

.brand-card {
  margin-bottom: 14px;
}

.brand-card h2 {
  margin: 10px 0 8px;
  font-size: 34px;
}

.nav-card {
  padding: 12px;
}

.nav-title {
  margin: 4px 10px 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #88a08e;
  font-weight: 700;
}

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

.nav-item {
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
}

.nav-item.active {
  background: #eef5ff;
  color: #2252a0;
  border-color: #d6e5ff;
}

.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d7e0d8;
}

.nav-item.active .nav-dot {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(55, 125, 247, 0.12);
}

.profile-card {
  margin-top: 14px;
}

.content {
  padding: 18px;
}

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

.topbar-actions {
  display: flex;
  gap: 10px;
}

.page {
  display: grid;
  gap: 16px;
}

.panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(237, 246, 240, 0.88), rgba(248, 251, 248, 0.98)),
    linear-gradient(135deg, rgba(24, 98, 69, 0.08), rgba(55, 125, 247, 0.04));
}

.stats-grid,
.card-grid,
.session-grid,
.profile-grid,
.split-grid {
  display: grid;
  gap: 16px;
}

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

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

.split-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

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

.user-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

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

.metric {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  padding: 18px;
}

.metric .label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #799179;
  font-weight: 700;
}

.metric .value {
  font-size: 24px;
  font-weight: 800;
}

.metric.blue {
  border-left: 5px solid var(--blue);
}

.metric.green {
  border-left: 5px solid #2abb70;
}

.metric.amber {
  border-left: 5px solid #f29f05;
}

.metric.red {
  border-left: 5px solid var(--red);
}

.dashboard-highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.dashboard-highlight {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(24, 98, 69, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 246, 240, 0.92));
}

.dashboard-highlight strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.dashboard-highlight p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.dashboard-quick-sessions {
  display: grid;
  gap: 12px;
}

.quick-session-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid #e4ede5;
  background: #fbfdfb;
}

.quick-session-card strong {
  display: block;
  margin-bottom: 6px;
}

.quick-session-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.consumption-meter {
  display: grid;
  gap: 14px;
}

.consumption-meter-bar {
  position: relative;
  overflow: hidden;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(24, 98, 69, 0.1), rgba(226, 75, 75, 0.12));
  border: 1px solid rgba(24, 98, 69, 0.08);
}

.consumption-meter-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f7a53, #4db37d);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid #ebf0ea;
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7b8e7f;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}

.pill.green {
  background: var(--primary-soft);
  color: var(--primary);
}

.pill.amber {
  background: #fff0c9;
  color: #8b6200;
}

.pill.blue-soft {
  background: #e7f0ff;
  color: #2356a7;
}

.pill.red {
  background: #ffe1e1;
  color: #b22929;
}

.actions-row,
.form-grid,
.inline-form {
  display: grid;
  gap: 12px;
}

.actions-row {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.session-card .actions-row button {
  min-height: 50px;
}

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

.inline-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.user-update-form {
  grid-template-columns: minmax(220px, 1.2fr) minmax(110px, 0.55fr) minmax(120px, 0.7fr) minmax(150px, 0.7fr) minmax(130px, 0.55fr);
}

.user-password-form {
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.5fr);
}

.api-key-update-form {
  grid-template-columns: minmax(130px, 0.6fr) minmax(260px, 1.6fr) minmax(120px, 0.5fr);
}

.user-actions-stack {
  display: grid;
  gap: 10px;
  min-width: 420px;
}

.users-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(160px, 0.7fr) minmax(160px, 0.7fr);
  gap: 12px;
  margin-bottom: 14px;
}

.form-section {
  display: grid;
  gap: 8px;
}

.form-actions {
  display: flex;
  align-items: end;
}

.form-actions button {
  min-width: 180px;
}

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

.mini-stat {
  min-width: 220px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(24, 98, 69, 0.1), rgba(55, 125, 247, 0.08));
  border: 1px solid var(--line);
}

.mini-stat .label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #77917f;
  font-weight: 700;
}

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

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

.users-table-card table {
  min-width: 1020px;
}

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

.docs-endpoint-grid {
  display: grid;
  gap: 16px;
}

.docs-endpoint-card,
.docs-subpanel {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  padding: 18px;
}

.doc-block {
  margin-top: 14px;
}

.docs-checklist {
  display: grid;
  gap: 12px;
}

.docs-checklist.compact {
  gap: 10px;
}

.docs-check-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
}

.docs-check-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e7f0ff;
  color: #2356a7;
  font-weight: 800;
}

.docs-check-item p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.docs-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.docs-note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.doc-pre {
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 16px;
  background: #f4f8f6;
  border: 1px solid var(--line);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}

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

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

.send-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: stretch;
}

.send-hero-copy h2 {
  margin: 0 0 10px;
  font-size: 36px;
}

.send-hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.send-mini-metric {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(235, 245, 238, 0.9));
}

.send-mini-metric .label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #73907b;
  font-weight: 700;
}

.send-mini-metric strong {
  font-size: 28px;
  line-height: 1;
}

.send-module {
  display: grid;
  gap: 16px;
  align-content: start;
}

.send-tip-card {
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid #dfe8e0;
  background: linear-gradient(180deg, #fbfdfb, #f1f8f3);
}

.send-tip-card strong {
  display: block;
  margin-bottom: 6px;
}

.send-tip-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.send-module-head,
.template-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.send-module-head h2,
.template-head h3 {
  margin: 0 0 6px;
}

.send-info-band {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.send-form-pro {
  gap: 16px;
}

.send-form-pro label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #274737;
}

.send-form-pro input,
.send-form-pro select,
.send-form-pro textarea {
  width: 100%;
  background: #fff;
}

.send-form-pro textarea {
  min-height: 132px;
  resize: vertical;
}

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

.form-actions-inline {
  display: flex;
  justify-content: flex-start;
}

.form-actions-inline button {
  min-width: 210px;
}

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

.template-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 246, 0.96)),
    linear-gradient(135deg, rgba(24, 98, 69, 0.04), rgba(55, 125, 247, 0.03));
  box-shadow: 0 16px 34px rgba(26, 54, 40, 0.08);
}

.template-body {
  min-height: 120px;
}

.compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.compact-actions button {
  min-width: 88px;
}

.session-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  display: grid;
  gap: 14px;
}

.session-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.session-qr {
  min-height: 210px;
  border-radius: 18px;
  border: 2px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #f5fbf5);
}

.session-qr img {
  width: min(100%, 230px);
  height: auto;
}

.session-progress {
  display: grid;
  gap: 8px;
}

.session-progress small {
  color: #5b7767;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.session-progress-bar {
  position: relative;
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34, 107, 73, 0.12), rgba(126, 180, 149, 0.2));
  border: 1px solid rgba(45, 105, 75, 0.08);
}

.session-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f7a53, #4db37d);
  box-shadow: 0 10px 20px rgba(31, 122, 83, 0.22);
  transition: width 0.35s ease;
}

.session-stage-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 246, 0.96));
}

.session-stage-card strong {
  display: block;
  margin-bottom: 6px;
}

.session-stage-card.success {
  border-color: rgba(31, 122, 83, 0.2);
  background: linear-gradient(180deg, rgba(221, 246, 230, 0.92), rgba(245, 251, 247, 0.98));
}

.session-stage-card.info {
  border-color: rgba(45, 124, 246, 0.16);
  background: linear-gradient(180deg, rgba(231, 240, 255, 0.92), rgba(248, 250, 255, 0.98));
}

.session-stage-card.error {
  border-color: rgba(217, 64, 64, 0.2);
  background: linear-gradient(180deg, rgba(255, 236, 236, 0.95), rgba(255, 249, 249, 0.98));
}

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

.session-step {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid #e5ece5;
  background: #fbfdfb;
  min-height: 96px;
}

.session-step strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.session-step p {
  margin: 0;
  color: #6b7d72;
  font-size: 12px;
  line-height: 1.45;
}

.session-step-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-top: 2px;
  background: #d9e4db;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.9);
}

.session-step.done {
  border-color: rgba(31, 122, 83, 0.14);
  background: linear-gradient(180deg, rgba(239, 251, 244, 0.96), rgba(251, 254, 252, 1));
}

.session-step.done .session-step-dot {
  background: #1f7a53;
}

.session-step.active {
  border-color: rgba(45, 124, 246, 0.18);
  background: linear-gradient(180deg, rgba(237, 244, 255, 0.96), rgba(251, 253, 255, 1));
  box-shadow: 0 12px 24px rgba(45, 124, 246, 0.08);
}

.session-step.active .session-step-dot {
  background: #2d7cf6;
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.94),
    0 0 0 6px rgba(45, 124, 246, 0.12);
}

.session-step.error {
  border-color: rgba(217, 64, 64, 0.18);
  background: linear-gradient(180deg, rgba(255, 238, 238, 0.96), rgba(255, 251, 251, 1));
}

.session-step.error .session-step-dot {
  background: #d94040;
}

.session-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 320px;
  text-align: left;
}

.session-waiting strong {
  display: block;
  margin-bottom: 4px;
  color: #163a2a;
}

.session-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(31, 122, 83, 0.12);
  border-top-color: #1f7a53;
  border-right-color: #6cc792;
  animation: session-spin 0.9s linear infinite;
  flex: 0 0 auto;
}

.toast-stack {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 60;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 30px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #163a2a;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 40px rgba(15, 42, 28, 0.18);
  backdrop-filter: blur(14px);
  animation: toast-enter 0.28s ease;
}

.toast.success {
  border-left: 5px solid #1f7a53;
}

.toast.error {
  border-left: 5px solid #d94040;
  color: #5d1f1f;
}

.toast.info {
  border-left: 5px solid #2d7cf6;
}

.public-shell .auth-brand {
  justify-content: flex-start;
  gap: 26px;
}

.auth-public-link-card {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid #dce8df;
  background: linear-gradient(180deg, rgba(245, 250, 247, 0.96), rgba(255, 255, 255, 0.98));
}

.auth-public-link-card strong {
  display: block;
  margin-bottom: 6px;
  color: #163a2a;
}

.public-docs-shell .auth-panel {
  align-items: stretch;
}

.public-docs-content {
  width: min(100%, 860px);
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  padding-right: 8px;
  scroll-behavior: smooth;
}

.public-docs-content .auth-card {
  width: 100%;
  max-width: none;
}

.public-docs-nav-panel {
  display: grid;
  gap: 16px;
  align-self: start;
  position: sticky;
  top: 22px;
  background: linear-gradient(180deg, rgba(250, 253, 251, 0.98), rgba(241, 248, 243, 0.96));
  box-shadow: 0 18px 34px rgba(15, 50, 35, 0.12);
}

.public-docs-nav {
  display: grid;
  gap: 10px;
}

.public-docs-nav a {
  display: block;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #d9e7df;
  background: linear-gradient(180deg, #ffffff, #f4faf6);
  color: #204434;
  text-decoration: none;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.public-docs-nav a:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #ffffff, #eef8f1);
  border-color: #c8ddd2;
  box-shadow: 0 10px 18px rgba(22, 67, 48, 0.08);
}

.public-docs-nav a.active {
  background: linear-gradient(135deg, rgba(24, 98, 69, 0.96), rgba(58, 141, 102, 0.92));
  border-color: rgba(24, 98, 69, 0.7);
  color: #ffffff;
  box-shadow: 0 16px 28px rgba(18, 77, 53, 0.2);
}

.public-docs-quick-meta {
  display: grid;
  gap: 12px;
}

.public-docs-copy-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.public-docs-copy-row button {
  min-height: 46px;
  background: linear-gradient(180deg, #ffffff, #f3f8f5);
  color: #204434;
  border: 1px solid #d9e6dd;
}

.public-docs-section {
  scroll-margin-top: 24px;
}

.public-docs-content::-webkit-scrollbar {
  width: 10px;
}

.public-docs-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(24, 98, 69, 0.55), rgba(58, 141, 102, 0.75));
  border-radius: 999px;
  border: 2px solid rgba(244, 249, 246, 0.95);
}

.public-docs-content::-webkit-scrollbar-track {
  background: rgba(232, 240, 235, 0.9);
  border-radius: 999px;
}

.public-docs-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.public-docs-summary-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid #e1ebe4;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 247, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.public-docs-summary-card span {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6d877a;
  font-weight: 800;
}

.public-docs-summary-card strong {
  display: block;
  margin-bottom: 8px;
  color: #163a2a;
  font-size: 20px;
  line-height: 1.2;
}

.public-docs-summary-card p {
  margin: 0;
  color: #587164;
  line-height: 1.55;
}

.public-docs-language-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.public-shell .dashboard-highlight {
  border-color: rgba(23, 86, 61, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 248, 243, 0.94));
}

.public-shell .dashboard-highlight strong,
.public-shell .public-docs-panel h2,
.public-shell .public-docs-panel h3,
.public-shell .public-docs-panel .label,
.public-shell .public-docs-panel strong,
.public-shell .public-cta-card h2,
.public-shell .public-cta-card strong {
  color: #163a2a;
}

.public-shell .dashboard-highlight p,
.public-shell .public-docs-panel p,
.public-shell .public-docs-panel .muted,
.public-shell .public-cta-card p,
.public-shell .public-cta-card .muted {
  color: #587164;
}

.public-shell .public-docs-panel .doc-pre {
  color: #244536;
  background: rgba(245, 250, 247, 0.96);
}

.public-docs-panel {
  margin-top: 10px;
}

.public-cta-card {
  gap: 22px;
}

.public-action-stack {
  display: grid;
  gap: 12px;
}

.doc-block-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.doc-copy-btn {
  padding: 8px 12px;
  min-width: 92px;
  border-radius: 999px;
  background: #eef4ff;
  color: #24456a;
  border: 1px solid #d8e4ff;
  font-size: 12px;
  font-weight: 700;
}

.public-cta-grid {
  display: grid;
  gap: 14px;
}

.campaign-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  min-height: 240px;
}

.campaign-bar-group {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.campaign-bar-stack {
  width: 100%;
  min-height: 170px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(244, 249, 246, 0.96), rgba(252, 254, 253, 1));
  border: 1px solid #e2ece5;
}

.campaign-bar {
  width: 32px;
  min-height: 12px;
  border-radius: 14px 14px 8px 8px;
  display: block;
}

.campaign-bar-campaign {
  background: linear-gradient(180deg, #2d7cf6, #88b7ff);
}

.campaign-bar-message {
  background: linear-gradient(180deg, #1f7a53, #6cc792);
}

.campaign-bar-group strong {
  color: #183827;
  font-size: 13px;
}

.campaign-bar-group span {
  color: #698173;
  font-size: 12px;
}

.campaign-session-grid {
  display: grid;
  gap: 14px;
}

.scheduled-grid {
  display: grid;
  gap: 16px;
}

.scheduled-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid #dce7db;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 248, 0.98));
  box-shadow: 0 14px 30px rgba(26, 61, 43, 0.08);
}

.scheduled-card.sent,
.scheduled-card.sent_partial {
  border-color: rgba(31, 122, 83, 0.2);
}

.scheduled-card.failed {
  border-color: rgba(217, 64, 64, 0.2);
  background: linear-gradient(180deg, rgba(255, 250, 250, 0.98), rgba(255, 244, 244, 0.98));
}

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

.scheduled-card-head h3 {
  margin: 0 0 4px;
}

.scheduled-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.scheduled-meta-grid > div {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #e7efea;
  background: rgba(247, 251, 248, 0.9);
}

.scheduled-meta-grid .label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6c8479;
}

.scheduled-body-preview {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px dashed #d6e6da;
  background: #fbfdfb;
  color: #345446;
  margin-bottom: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.scheduled-progress-band {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.summary-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary-mini-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #e2ece4;
  background: rgba(247, 251, 248, 0.9);
}

.summary-mini-card strong {
  color: #163a2a;
}

.summary-mini-card span {
  color: #5f796c;
  font-size: 13px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #dbe7dd;
  background: rgba(247, 251, 248, 0.92);
  cursor: pointer;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
  accent-color: #1f7a53;
  flex: 0 0 auto;
}

.checkbox-line span {
  color: #244536;
  font-weight: 600;
  line-height: 1.4;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #ebf1e8;
  background: #fbfdfb;
}

.empty-box {
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 1180px) {
  .stats-grid,
  .card-grid,
  .form-grid,
  .profile-grid,
  .split-grid,
  .dashboard-bottom-grid,
  .docs-layout,
  .user-admin-layout,
  .send-grid,
  .send-hero,
  .public-cta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .send-hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .dashboard-highlight-grid,
  .docs-note-grid,
  .scheduled-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #dce7db;
  }
}

@media (max-width: 720px) {
  .stats-grid,
  .card-grid,
  .form-grid,
  .profile-grid,
  .split-grid,
  .dashboard-bottom-grid,
  .docs-layout,
  .inline-form,
  .user-create-form,
  .hint-grid,
  .dashboard-highlight-grid,
  .docs-note-grid,
  .scheduled-meta-grid,
  .user-admin-layout,
  .users-filters,
  .send-grid,
  .send-hero,
  .send-hero-metrics,
  .public-cta-grid {
    grid-template-columns: 1fr;
  }

  .auth-brand-grid {
    grid-template-columns: 1fr;
  }

  .auth-brand,
  .auth-panel,
  .content {
    padding: 18px;
  }

  .public-docs-nav-panel {
    position: static;
    top: auto;
  }

  .public-docs-content {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .public-docs-copy-row,
  .public-docs-summary-grid {
    grid-template-columns: 1fr;
  }

  .panel-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .mini-stat {
    min-width: 0;
    width: 100%;
  }

  .form-actions button {
    width: 100%;
  }

  .send-module-head,
  .template-head,
  .auth-card-header,
  .scheduled-card-head {
    flex-direction: column;
  }

  .auth-code-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .session-timeline {
    grid-template-columns: 1fr;
  }

  .form-actions-inline button {
    width: 100%;
  }

  .toast-stack {
    top: 16px;
    right: 16px;
    left: 16px;
    width: auto;
  }

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

@keyframes session-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
