:root {
  --bg-base: #2a1d54;
  --bg-pink: #e25fb8;
  --bg-violet: #6b3eaf;
  --bg-blue: #3a3a8a;

  --surface: rgba(58, 41, 110, 0.55);
  --surface-strong: rgba(46, 30, 92, 0.85);
  --surface-soft: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-soft: rgba(255, 255, 255, 0.06);

  --text: #f6f3ff;
  --text-muted: #c9c2e6;
  --text-dim: #9089b8;

  --accent: #5a8bff;
  --accent-strong: #4a7bff;
  --accent-soft: #91a8ff;
  --good: #5cc97a;
  --bad: #ff5d6c;
  --warn: #ffb547;

  --tg-blue: #229ed9;
  --wa-green: #25d366;
  --vb-purple: #7360f2;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.18);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);

  --header-h: 84px;
  --sidebar-w: 240px;

  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(60% 50% at 0% 0%,   rgba(226, 95, 184, 0.55), transparent 70%),
    radial-gradient(60% 60% at 100% 100%, rgba(58, 58, 138, 0.65), transparent 70%),
    radial-gradient(50% 60% at 100% 0%,  rgba(94, 64, 170, 0.45), transparent 70%),
    var(--bg-base);
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

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

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

a { color: var(--accent); }

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================================================================
   LOGIN
   ========================================================================= */

.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 48px;
  gap: 24px;
}

.login-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(126, 63, 247, 0.25));
}

.login-card {
  width: min(420px, 100%);
  padding: 36px 36px 32px;
  border-radius: var(--radius-lg);
  background: rgba(86, 60, 150, 0.45);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  line-height: 1.25;
}

.login-card p.tag {
  margin: 0 0 26px;
  font-size: 14px;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.5;
}

.login-card .btn-primary,
.login-card .btn-secondary {
  width: 100%;
  margin-bottom: 12px;
}

.login-card .btn-secondary:last-child { margin-bottom: 0; }

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.login-form label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.login-form input {
  margin-top: 6px;
}

.login-form .error {
  color: var(--bad);
  font-size: 13px;
  margin: 4px 0 0;
  min-height: 18px;
}

.social-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.social-block .label {
  font-size: 13px;
  color: var(--text-muted);
}

.social-buttons {
  display: flex;
  gap: 14px;
}

.social-btn {
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  opacity: 0.85;
}

.social-btn.google { background: #b04875; }
.social-btn.facebook { background: #2b66b6; }

/* =========================================================================
   APP SHELL
   ========================================================================= */

.shell {
  flex: 1;
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  min-height: 0;
}

.shell-frame {
  position: absolute;
  inset: 16px;
  border-radius: var(--radius-xl);
  pointer-events: none;
  border: 1px solid var(--border-glass);
}

.app-header {
  position: relative;
  padding: 0 24px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr auto;
  align-items: center;
  gap: 24px;
  margin: 16px 16px 0;
  height: calc(var(--header-h) - 16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.brand img { width: 36px; height: 36px; }

.search-box {
  position: relative;
  height: 44px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  max-width: 720px;
  width: 100%;
  justify-self: center;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
}

.search-box input::placeholder { color: var(--text-dim); }
.search-box .icon { color: var(--text-dim); font-size: 14px; }

.header-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.bell {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-soft);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.bell .dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bad);
  display: none;
  box-shadow: 0 0 0 2px var(--bg-base);
}

.bell.has-unread .dot { display: block; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px 6px 6px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-soft);
}

.user-chip .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7e3ff7, #36c8ff);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.user-chip .avatar.online::after {
  content: "";
  position: absolute;
  bottom: 2px; right: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 2px #2a1d54;
}

.user-chip .who {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-chip .name { font-weight: 600; font-size: 14px; }
.user-chip .role { font-size: 12px; color: var(--text-muted); }

.user-chip .chev { color: var(--text-muted); font-size: 12px; margin-left: 4px; }

.shell-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 0;
  margin: 16px 16px 16px;
  padding: 0;
  min-height: 0;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--border-soft);
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 16px;
  background: transparent;
  border: none;
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 16px;
  position: relative;
}

.sidebar .nav-item .icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.sidebar .nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }

.sidebar .nav-item.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar .nav-item.active::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent-strong);
}

.sidebar .nav-item.active .icon { color: var(--accent-soft); }

.sidebar .spacer { flex: 1; }

.sidebar .logout {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 16px;
  background: transparent;
  border: none;
  text-align: left;
  color: var(--bad);
  font-weight: 600;
  font-size: 15px;
}

.sidebar .logout:hover { background: rgba(255, 93, 108, 0.08); }

.main-area {
  min-height: 0;
  overflow: hidden;
  display: flex;
}

/* =========================================================================
   CHATS
   ========================================================================= */

.chats-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: 0;
}

.chat-list-pane {
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-tabs {
  display: flex;
  gap: 22px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}

.chat-tabs button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  padding: 4px 2px;
}

.chat-tabs button .count {
  color: var(--accent-soft);
  font-weight: 700;
}

.chat-tabs button.active {
  color: var(--text);
}

.chat-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -10px;
  height: 3px;
  background: var(--accent-strong);
  border-radius: 3px;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.chat-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 22px;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.chat-row:hover { background: rgba(255, 255, 255, 0.04); }
.chat-row.active {
  background: rgba(255, 255, 255, 0.07);
  border-left-color: var(--accent-strong);
}

.chat-row .avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7e3ff7, #36c8ff);
  color: #fff;
  font-weight: 700;
  display: grid; place-items: center;
  position: relative;
  overflow: visible;
}

.chat-row .plugin-badge {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--bg-base);
}
.chat-row .plugin-badge img { width: 16px; height: 16px; border-radius: 50%; }

.chat-row .content { min-width: 0; }
.chat-row .who-row {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 14px;
}

.chat-row .preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  margin-top: 4px;
}

.chat-row .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.chat-row .time { font-size: 12px; color: var(--text-dim); }
.chat-row .badge {
  background: var(--accent-strong);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}

.chat-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-empty {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  text-align: center;
  padding: 40px;
  font-size: 14px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-soft);
}

.chat-header .avatar { width: 44px; height: 44px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.chat-header .avatar img { width: 44px; height: 44px; border-radius: 50%; }

.chat-header .who { display: flex; flex-direction: column; }
.chat-header .name { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.chat-header .plugin-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--tg-blue);
  font-weight: 600;
}
.chat-header .plugin-tag.whatsapp { color: var(--wa-green); }
.chat-header .plugin-tag.viber { color: var(--vb-purple); }
.chat-header .plugin-tag img { width: 14px; height: 14px; }

.message-feed {
  flex: 1;
  overflow-y: auto;
  padding: 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.day-divider {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin: 6px 0;
}

.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 78%;
}

.bubble-row.inbound { align-self: flex-start; }
.bubble-row.outbound { align-self: flex-end; flex-direction: row-reverse; }

.bubble-row .av {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7e3ff7, #36c8ff);
  flex: 0 0 28px;
  overflow: hidden;
}
.bubble-row .av.plugin { background: #fff; }
.bubble-row .av.plugin img { width: 28px; height: 28px; border-radius: 50%; }

.bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  word-break: break-word;
}

.bubble.inbound { background: #5b8af7; color: #fff; border-bottom-left-radius: 4px; }
.bubble.inbound.whatsapp { background: var(--wa-green); }
.bubble.inbound.viber { background: var(--vb-purple); }

.bubble.outbound { background: rgba(255, 255, 255, 0.92); color: #1a153b; border-bottom-right-radius: 4px; }

.bubble .meta-time { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.bubble-row .time-col { font-size: 11px; color: var(--text-dim); margin: 0 4px; align-self: flex-end; }

.compose {
  border-top: 1px solid var(--border-soft);
  padding: 14px 22px 18px;
}

.compose form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 10px 14px;
}

.compose input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
}

.compose input::placeholder { color: var(--text-dim); }

.compose .send-btn {
  background: transparent;
  border: none;
  color: var(--accent-soft);
  font-size: 22px;
}

/* =========================================================================
   INTEGRATIONS
   ========================================================================= */

.split-3 {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
}

.split-3 > .col {
  padding: 28px 36px;
  overflow-y: auto;
  min-height: 0;
}

.split-3 > .col + .col { border-left: 1px solid var(--border-soft); }

.col h2 {
  margin: 0 0 8px;
  font-size: 26px;
  text-align: center;
}

.col .col-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 auto 28px;
  max-width: 360px;
  line-height: 1.45;
}

.integration-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 12px;
}

.integration-row .logo {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #fff;
}
.integration-row .logo img { width: 52px; height: 52px; border-radius: 50%; }

.integration-row .name { font-weight: 700; font-size: 22px; }
.integration-row .status { font-size: 13px; margin-top: 2px; font-weight: 600; }
.integration-row .status.connected { color: var(--good); }
.integration-row .status.disconnected { color: var(--bad); }
.integration-row .status.soon { color: var(--warn); }

.integration-row .arrow {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
}

.btn-tiny {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.filter-group { margin-bottom: 22px; }
.filter-group h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 15px;
}

.filter-row .ico {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #fff;
}
.filter-row .ico img { width: 30px; height: 30px; border-radius: 50%; }

.filter-row label.name { flex: 1; cursor: pointer; }

/* checkbox / radio */
.check {
  position: relative;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  display: grid; place-items: center;
}
.check.checked { background: var(--good); border-color: var(--good); }
.check.checked::after {
  content: "✓";
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.radio {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: grid; place-items: center;
}
.radio.selected { border-color: var(--good); }
.radio.selected::after {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--good);
}

.btn-primary {
  background: #16132d;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
}

.btn-primary:hover { background: #221d3f; }

.btn-secondary {
  background: rgba(245, 240, 255, 0.9);
  color: #2a1d54;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
}

.btn-gradient {
  border: none;
  border-radius: 16px;
  background: linear-gradient(90deg, #5b8af7, #8e6df7);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 40px;
}

/* =========================================================================
   PROFILE
   ========================================================================= */

.profile-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}

.profile-center .big-avatar {
  width: 180px; height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7e3ff7, #36c8ff);
  display: grid; place-items: center;
  color: #fff;
  font-size: 56px;
  font-weight: 800;
  position: relative;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.18);
}

.profile-center .big-avatar .edit {
  position: absolute;
  bottom: 6px; right: 8px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  display: grid; place-items: center;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.18);
}

.profile-center .name { font-size: 26px; font-weight: 700; margin-top: 4px; }
.profile-center .role { color: var(--text-muted); font-size: 14px; }
.profile-center .meta { color: var(--text-muted); font-size: 13px; }

.profile-form-row {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.profile-form-row .ico {
  color: var(--text-muted);
  font-size: 18px;
  text-align: center;
}

.profile-form-row input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text);
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 999px;
  width: 100%;
  outline: none;
}

.profile-form-row .pencil {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  font-size: 16px;
}

.toggle-row .ico { font-size: 22px; color: var(--text-muted); width: 28px; text-align: center; }
.toggle-row .label { flex: 1; }

.switch {
  width: 48px; height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  position: relative;
  cursor: pointer;
  flex: 0 0 48px;
  transition: background 0.18s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}
.switch.on { background: var(--good); }
.switch.on::after { transform: translateX(22px); }

.lang-row .opt {
  font-size: 14px;
  color: var(--text-muted);
}
.lang-row .opt.active { color: var(--text); font-weight: 600; }

h3.section {
  margin: 18px 0 12px;
  font-size: 24px;
  text-align: center;
}

/* =========================================================================
   TARIFF
   ========================================================================= */

.tariff-screen {
  flex: 1;
  padding: 28px 40px 32px;
  overflow-y: auto;
  min-height: 0;
}

.tariff-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
}

.tariff-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tariff-header-mark {
  color: var(--accent-soft);
  font-size: 22px;
}

.tariff-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 40px;
  align-items: start;
}

.tariff-card {
  background: rgba(30, 20, 70, 0.55);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px 28px 32px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

.tariff-card-headings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tariff-card-label {
  font-size: 18px;
  color: var(--text);
  font-weight: 500;
}

.tariff-plan-name {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(180deg, #6aa0ff 0%, #4a7bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.tariff-active-pill {
  align-self: flex-start;
  background: #ffffff;
  color: #2a1d54;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 18px;
  border-radius: 999px;
  margin-top: 4px;
}

.tariff-medal {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a7bff, #2f5cd9);
  display: grid;
  place-items: center;
  font-size: 26px;
  box-shadow: 0 6px 18px rgba(74, 123, 255, 0.35);
}

.tariff-card-desc {
  margin: 22px 0 18px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
}

.tariff-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tariff-bullet {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.tariff-bullet .check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 22px;
}

.tariff-limits-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 6px;
}

.tariff-section-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
}

.tariff-limit-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: center;
  padding: 6px 0;
}

.tariff-limit-row .ico {
  font-size: 22px;
  color: var(--text-muted);
  width: 36px;
  text-align: center;
}

.tariff-limit-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tariff-limit-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
}

.tariff-limit-head .label {
  color: var(--text);
  font-weight: 500;
}

.tariff-limit-head .value {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.tariff-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.tariff-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #5b8af7, #4a7bff);
  border-radius: 2px;
}

.tariff-upgrade-card {
  margin-top: 14px;
  background: rgba(30, 20, 70, 0.55);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 22px 26px 26px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.tariff-upgrade-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
}

.tariff-upgrade-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 18px;
}

.tariff-upgrade-btn {
  background: linear-gradient(90deg, #8e6df7, #6a48d6);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 38px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(120, 80, 220, 0.35);
}

.tariff-upgrade-btn:hover { filter: brightness(1.08); }

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

/* =========================================================================
   TARIFFS (pricing page)
   ========================================================================= */

.tariffs-screen {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 40px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tp-back {
  position: absolute;
  top: 24px;
  left: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text);
  font-size: 22px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.tp-back:hover { background: rgba(255, 255, 255, 0.14); }

.tp-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 12px 0 32px;
}

.tp-logo {
  width: 78px;
  height: 78px;
  filter: drop-shadow(0 8px 24px rgba(126, 63, 247, 0.45));
}

.tp-title {
  margin: 0;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-align: center;
}

.tp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 320px));
  gap: 28px;
  align-items: stretch;
  width: 100%;
  max-width: 1080px;
  justify-content: center;
}

.tp-card {
  background: rgba(30, 20, 70, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 26px 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.tp-card-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.tp-plan-name {
  font-size: 44px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tp-card.tone-free .tp-plan-name {
  background-image: linear-gradient(180deg, #6aa0ff 0%, #4a7bff 100%);
}

.tp-card.tone-pro .tp-plan-name {
  background-image: linear-gradient(180deg, #54e08a 0%, #25b863 100%);
}

.tp-card.tone-business .tp-plan-name {
  background-image: linear-gradient(180deg, #c69bff 0%, #9d6cf5 100%);
}

.tp-plan-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.tp-card.tone-free .tp-plan-price { color: #8db4ff; }
.tp-card.tone-pro .tp-plan-price { color: #6ad691; }
.tp-card.tone-business .tp-plan-price { color: #c4a5f7; }

.tp-bullets {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.tp-bullet {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
}

.tp-bullet .check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex: 0 0 18px;
  position: relative;
}

.tp-bullet .check::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.tp-bullet.tone-free .check { background: var(--accent-strong); }
.tp-bullet.tone-pro .check { background: #25b863; }
.tp-bullet.tone-business .check {
  background: transparent;
  border: 1.5px solid #c4a5f7;
}
.tp-bullet.tone-business .check::after { color: #c4a5f7; }

.tp-cta {
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-top: 4px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

.tp-card.tone-free .tp-cta {
  background: linear-gradient(90deg, #5b8af7, #4a7bff);
}

.tp-card.tone-pro .tp-cta {
  background: linear-gradient(90deg, #3edc7a, #25b863);
}

.tp-card.tone-business .tp-cta {
  background: linear-gradient(90deg, #b78bf7, #8e6df7);
}

.tp-cta:hover { filter: brightness(1.08); }

.tp-footer {
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 1000px) {
  .tp-grid { grid-template-columns: 1fr; max-width: 420px; }
}

/* =========================================================================
   STUB / COMING SOON
   ========================================================================= */

.stub-screen {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px;
  text-align: center;
}

.stub-card {
  max-width: 420px;
  padding: 40px;
  background: var(--surface-soft);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
}

.stub-card h2 { margin: 0 0 12px; font-size: 26px; }
.stub-card p { color: var(--text-muted); line-height: 1.5; }

/* =========================================================================
   INPUTS (shared)
   ========================================================================= */

input.text {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text);
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.12s ease;
}

input.text:focus { border-color: var(--accent-soft); }

textarea.text {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text);
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  width: 100%;
  outline: none;
  min-height: 90px;
  resize: vertical;
}

/* =========================================================================
   MODAL
   ========================================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 28, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 1000;
}

.modal {
  width: min(520px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #3a2670 0%, #2a1d54 100%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow);
}

.modal h3 { margin: 0 0 18px; font-size: 20px; }
.modal .field { margin-bottom: 14px; }
.modal label.field-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal .actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 22px;
}

.modal .actions .btn-primary,
.modal .actions .btn-secondary {
  padding: 12px 22px;
  font-size: 14px;
}

.modal .error {
  color: var(--bad);
  font-size: 13px;
  margin: 6px 0 0;
  white-space: pre-wrap;
}

/* =========================================================================
   TOASTS
   ========================================================================= */

#toast-root {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1100;
  pointer-events: none;
}

.toast {
  background: rgba(20, 14, 50, 0.92);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  max-width: 320px;
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}

.toast.success { border-left: 3px solid var(--good); }
.toast.error { border-left: 3px solid var(--bad); }
.toast.info { border-left: 3px solid var(--accent); }

/* =========================================================================
   SMALL UTILITIES
   ========================================================================= */

.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.hidden { display: none !important; }
.center { text-align: center; }
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.pill.vip { background: #f3b441; color: #2a1d54; }
.pill.loyal { background: #ffc97a; color: #4a2e10; }

/* Scrollbar polish */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
