:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0ea5a5;
  --accent-2: #f59e0b;
  --accent-3: #3b82f6;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.06);
  --radius: 14px;
}

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

body.portal-body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
}

.portal-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(40% 30% at 15% 10%, rgba(14, 165, 165, 0.18), transparent 60%),
    radial-gradient(30% 40% at 85% 20%, rgba(245, 158, 11, 0.18), transparent 60%),
    radial-gradient(35% 35% at 70% 80%, rgba(59, 130, 246, 0.12), transparent 60%);
  z-index: 0;
}

.portal-layout {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.portal-sidebar {
  width: 260px;
  background: #0b1220;
  color: #e2e8f0;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
  padding: 8px 6px 12px;
}

.brand-logo-wrap {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 18px 30px rgba(14, 165, 165, 0.24),
    inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-subtitle {
  color: #f8fafc;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 14px;
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-nav .nav-item {
  margin-bottom: 6px;
}

.navbar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #cbd5f5;
  text-decoration: none;
  transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
  background: rgba(14, 165, 165, 0.15);
  color: #f8fafc;
}

.sidebar-nav .nav-item {
  margin-bottom: 6px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-section + .nav-section {
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.nav-section-title {
  color: #7dd3fc;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  margin: 2px 8px 4px;
  font-weight: 700;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #cbd5f5;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(56, 189, 248, 0.16);
  color: #f8fafc;
  transform: translateX(2px);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(14, 165, 165, 0.38), rgba(59, 130, 246, 0.34));
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.portal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.portal-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 0;
  z-index: 2;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
}

.spacer {
  flex: 1;
}

.user-chip {
  padding: 6px 10px;
  background: #eef2ff;
  border-radius: 999px;
  font-size: 13px;
  color: #4338ca;
}

.portal-content {
  padding: 24px;
}

.icon-btn {
  border: 0;
  background: var(--panel);
  padding: 8px;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.icon-line {
  width: 18px;
  height: 2px;
  background: #334155;
  display: block;
}

.portal-card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

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

.portal-title {
  margin: 0;
  font-size: 20px;
}

.portal-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.btn {
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-light {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.portal-table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.portal-table th,
.portal-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.portal-table thead th {
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
}

.text-right {
  text-align: right;
}

.inline-form {
  display: inline;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

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

.form-field input,
.form-field textarea,
.form-field select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 14px;
}

.form-field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.form-hint {
  font-size: 12px;
  color: var(--muted);
}

.form-actions {
  margin-top: 18px;
  display: flex !important;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.form-actions .btn {
  min-width: 120px;
}

.save-btn {
  background: var(--accent) !important;
  color: #fff !important;
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.help-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px 0;
}

.help-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.help-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  font-size: 13px;
  color: var(--muted);
}

.details-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  font-size: 14px;
}

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

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 165, 165, 0.3);
}

.btn-outline {
  background: #fff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.35);
}

.btn-outline:hover {
  border-color: #0f172a;
  color: #0f172a;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
}

.btn-primary {
  background: var(--accent-3);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-secondary {
  background: #334155;
  color: #fff;
}

.btn-info {
  background: #0ea5a5;
  color: #fff;
}

.dropdown-menu {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 6px;
  min-width: 180px;
  box-shadow: var(--shadow-soft);
}

.dropdown-item {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: #0f172a;
  text-decoration: none;
}

.dropdown-item:hover {
  background: rgba(14,165,165,0.12);
  color: #0f172a;
}

/* Ensure button variants override the global .btn block below */
.btn-light {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-primary {
  background: var(--accent-3);
  color: #fff;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -12px;
  margin-right: -12px;
}

.row > [class*="col-"] {
  padding-left: 12px;
  padding-right: 12px;
}

.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.3333%; }
.col-3 { width: 25%; }

@media (min-width: 768px) {
  .col-md-6 { width: 50%; }
  .col-md-4 { width: 33.3333%; }
  .col-md-3 { width: 25%; }
}

@media (min-width: 1200px) {
  .col-xl-3 { width: 25%; }
  .col-xl-4 { width: 33.3333%; }
  .col-xl-6 { width: 50%; }
  .col-xl-12 { width: 100%; }
}

.card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 23, 42, 0.06);
  overflow: hidden;
  animation: rise 0.35s ease;
}

.card-header {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: var(--panel-2);
  font-weight: 600;
}

.card-body {
  padding: 16px 18px;
}

.card-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin: 0 0 6px;
}

.card-stats {
  box-shadow: var(--shadow-soft);
}

.header {
  padding: 24px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(14, 165, 165, 0.2), rgba(59, 130, 246, 0.2));
  margin-bottom: 20px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  vertical-align: middle;
}

.table td .btn {
  margin-right: 6px;
  margin-bottom: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(14, 165, 165, 0.15);
  color: var(--accent);
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  color: #991b1b;
  margin-bottom: 12px;
}

.alert-danger { background: rgba(239, 68, 68, 0.12); color: #991b1b; }
.alert-success { background: rgba(34, 197, 94, 0.12); color: #166534; }
.alert-info { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.alert-dismissible { position: relative; }

.alert .close {
  float: right;
  font-size: 18px;
  text-decoration: none;
  color: inherit;
}

.container-fluid {
  width: 100%;
  padding-left: 16px;
  padding-right: 16px;
}

.bg-white { background: #fff; }
.border-0 { border: 0; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.small { font-size: 12px; }

.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-outline-primary { border: 1px solid rgba(59,130,246,0.5); color: var(--accent-3); background: transparent; }
.btn-outline-success { border: 1px solid rgba(34,197,94,0.5); color: var(--success); background: transparent; }
.btn-outline-info { border: 1px solid rgba(14,165,165,0.5); color: var(--accent); background: transparent; }
.btn-outline-danger { border: 1px solid rgba(239,68,68,0.5); color: var(--danger); background: transparent; }

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-info:hover,
.btn-outline-danger:hover {
  background: rgba(15,23,42,0.06);
}

.card-img-top {
  width: 100%;
  display: block;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

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

.navbar-heading {
  font-size: 11px;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 16px 0 8px;
}

.docs-normal { font-weight: 600; }

.mt--6 { margin-top: -1.5rem; }
.mt--9 { margin-top: -2.25rem; }
.mt--3 { margin-top: -0.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.pb-8 { padding-bottom: 2rem; }
.pt-5 { padding-top: 1.25rem; }
.pt-md-8 { padding-top: 2rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-uppercase { text-transform: uppercase; }
.font-weight-bold { font-weight: 700; }
.text-nowrap { white-space: nowrap; }

.shadow { box-shadow: var(--shadow-soft); }
.shadow-lg { box-shadow: var(--shadow); }
.rounded-circle { border-radius: 999px; }

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-shape {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(14, 165, 165, 0.18);
  color: #0f766e;
}

.bg-gradient-info { background: linear-gradient(135deg, rgba(59,130,246,0.25), rgba(14,165,165,0.35)); }
.bg-gradient-success { background: linear-gradient(135deg, rgba(34,197,94,0.25), rgba(14,165,165,0.2)); }
.bg-secondary { background: var(--panel-2); }

.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }

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

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-sub {
  color: var(--muted);
  margin-bottom: 16px;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-primary { color: var(--accent-3); }
.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.text-orange { color: var(--accent-2); }
.text-white { color: #ffffff; }

.bg-gradient-primary {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(14, 165, 165, 0.2));
}

.bg-secondary {
  background: var(--panel-2);
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: #fff;
}

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

@keyframes rise {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 1024px) {
  .portal-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    transition: left 0.2s ease;
  }

  .portal-layout.sidebar-open .portal-sidebar {
    left: 0;
  }

  .portal-main {
    width: 100%;
  }

  .brand-title {
    font-size: 24px;
  }
}
.btn.btn-primary,
.btn-primary {
  background: var(--accent-3) !important;
  color: #fff !important;
  border-color: var(--accent-3) !important;
}

.btn.btn-success,
.btn-success {
  background: var(--success) !important;
  color: #fff !important;
  border-color: var(--success) !important;
}

.btn.btn-danger,
.btn-danger {
  background: var(--danger) !important;
  color: #fff !important;
  border-color: var(--danger) !important;
}

.btn.btn-secondary,
.btn-secondary {
  background: #334155 !important;
  color: #fff !important;
  border-color: #334155 !important;
}

.btn {
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 600;
}

.btn:not(.btn-outline):not(.btn-light):not(.btn-secondary):not(.btn-success):not(.btn-danger):not(.btn-primary) {
  background: var(--accent-3);
  color: #fff;
  border: 1px solid var(--accent-3);
}

.btn.btn-light,
.btn-light {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #cbd5f5 !important;
}

.btn.btn-outline,
.btn-outline {
  background: #fff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.35) !important;
}

.contacts-premium {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

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

.contacts-premium-stat {
  border: 1px solid rgba(14, 165, 165, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(120deg, rgba(59, 130, 246, 0.08), rgba(14, 165, 165, 0.08));
}

.contacts-premium-stat__label {
  display: block;
  font-size: 12px;
  color: #475569;
  margin-bottom: 4px;
}

.contacts-premium-stat__value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

.contacts-bulk-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px dashed rgba(59, 130, 246, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
}

.contacts-selected-indicator {
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

.contacts-name {
  font-weight: 700;
  color: #0f172a;
}

.contacts-phone {
  font-weight: 600;
  color: #334155;
}

.contact-action-btn {
  margin-right: 6px;
  margin-bottom: 6px;
  min-width: 84px;
  justify-content: center;
}

.contacts-empty {
  text-align: center;
  padding: 24px 8px;
}

.contacts-empty__title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.contacts-empty__desc {
  margin-top: 6px;
  color: #64748b;
}

.portal-modal {
  display: none;
  background: rgba(15, 23, 42, 0.42);
}

.portal-modal.show {
  display: block;
}

/* Keep Bootstrap modal markup hidden unless explicitly shown */
.modal {
  display: none;
}

.modal.show {
  display: block;
}

.portal-modal .modal-dialog {
  margin-top: 10vh;
}

.portal-modal .modal-content {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.25);
}

/* UX polish layer */
.portal-content {
  animation: fadeInUp 240ms ease-out;
}

.nav-link i {
  width: 16px;
  font-size: 14px;
  text-align: center;
  opacity: 0.95;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.card-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.table td,
.table th {
  vertical-align: middle;
}

.table thead th {
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #475569;
}

.table tbody tr:hover {
  background: rgba(14, 165, 165, 0.06);
}

.btn {
  font-weight: 600;
  border-radius: 12px;
  padding: 9px 14px;
}

.btn-sm {
  border-radius: 10px;
}

.btn-outline {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.2);
}

.btn-outline:hover {
  border-color: rgba(15, 23, 42, 0.35);
}

.badge {
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .portal-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-110%);
    transition: transform 0.24s ease;
    z-index: 10;
  }

  .portal-layout.sidebar-open .portal-sidebar {
    transform: translateX(0);
  }

  .portal-main {
    width: 100%;
  }

  .portal-content {
    padding: 16px;
  }

  .portal-topbar {
    padding: 12px 14px;
  }

  .user-chip {
    display: none;
  }

  .card .btn {
    margin-top: 6px;
  }
}

/* Auth redesign */
.auth-body {
  background:
    radial-gradient(35% 40% at 15% 12%, rgba(14, 165, 165, 0.2), transparent 65%),
    radial-gradient(40% 35% at 85% 10%, rgba(59, 130, 246, 0.18), transparent 65%),
    #f1f5f9;
}

.auth-wrap--split {
  width: min(1080px, 96vw);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 18px;
}

.auth-side-panel {
  background: linear-gradient(155deg, #0b1220 0%, #13263f 45%, #11457e 100%);
  border-radius: 20px;
  padding: 28px;
  color: #e2e8f0;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-side-logo {
  width: 66px;
  height: 66px;
  border-radius: 16px;
  background: #fff;
  padding: 8px;
  object-fit: contain;
  margin-bottom: 14px;
}

.auth-brand-block h1 {
  margin: 0 0 8px;
  font-size: 28px;
  color: #fff;
}

.auth-brand-block p {
  margin: 0;
  color: #bfdbfe;
}

.auth-feature-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.auth-feature-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.auth-card--wide {
  max-width: 100%;
  padding: 28px;
}

.auth-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.auth-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(14, 165, 165, 0.2), rgba(59, 130, 246, 0.2));
  color: #0f172a;
}

.auth-form label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 600;
}

.auth-links a {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dashboard cards */
.dashboard-quick-actions {
  margin-top: 12px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px dashed rgba(59, 130, 246, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.dashboard-quick-actions__title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-right: 4px;
}

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

.dashboard-stat-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.dashboard-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-stat-title {
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}

.dashboard-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1d4ed8;
}

.dashboard-stat-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
}

.dashboard-stat-sub {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.dashboard-stat-action {
  margin-top: 10px;
}

.dashboard-empty {
  border: 1px dashed rgba(100, 116, 139, 0.5);
  border-radius: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.dashboard-empty h3 {
  margin: 0;
  font-size: 16px;
}

.dashboard-empty p {
  margin: 6px 0 0;
  color: #64748b;
}

/* Plans */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.plan-option-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.plan-option-card.active {
  border-color: rgba(14, 165, 165, 0.7);
  box-shadow: 0 10px 28px rgba(14, 165, 165, 0.14);
}

.plan-option-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.plan-option-card__head h3 {
  margin: 0;
  font-size: 18px;
}

.plan-option-price {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 700;
  color: #0f172a;
}

.plan-feature-list {
  margin: 10px 0;
  padding-left: 18px;
  color: #334155;
  font-size: 13px;
  display: grid;
  gap: 4px;
}

.plan-request-form {
  margin-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 10px;
}

.plan-admin-form {
  min-width: 240px;
}

@media (max-width: 900px) {
  .auth-wrap--split {
    grid-template-columns: 1fr;
  }

  .auth-side-panel {
    order: 2;
  }

  .auth-card--wide {
    order: 1;
  }
}

/* Admin dashboard refinement */
.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.admin-metric-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.admin-metric-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.admin-metric-card__label {
  font-size: 12px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.admin-metric-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
}

.admin-metric-card__value {
  font-size: 30px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.admin-metric-card__hint {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
}

/* Settings page */
.settings-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.settings-kpi {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: linear-gradient(160deg, #fff 0%, #f8fafc 100%);
  padding: 12px;
}

.settings-kpi span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 3px;
}

.settings-kpi strong {
  font-size: 24px;
  color: #0f172a;
}

/* Plan timeline + usage meter */
.usage-meter-row {
  margin-bottom: 14px;
}

.usage-meter-row__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  margin-bottom: 6px;
}

.usage-meter-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.usage-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(120deg, #22c55e, #0ea5a5);
}

.usage-meter-fill.warning {
  background: linear-gradient(120deg, #f59e0b, #ef4444);
}

.plan-timeline {
  display: grid;
  gap: 12px;
}

.plan-timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
}

.plan-timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 6px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.2);
}

.plan-timeline-dot.ok {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.plan-timeline-dot.bad {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

.plan-timeline-content {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.plan-timeline-title {
  font-weight: 700;
  color: #0f172a;
}

.plan-timeline-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

/* Billing support */
.ticket-thread {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.ticket-bubble {
  max-width: 75%;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.ticket-bubble.mine {
  margin-left: auto;
  background: linear-gradient(140deg, #dbeafe, #e0f2fe);
}

.ticket-bubble.other {
  margin-right: auto;
}

.ticket-bubble__meta {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}

/* WhatsApp-like chat */
.wa-chat-panel {
  background: #e6edf4;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.wa-chat-header {
  background: #f8fafc;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.wa-chat-messages {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.6), transparent 30%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.5), transparent 35%),
    #d8e3ec;
}

.wa-chat-day-divider {
  background: #e2e8f0;
  color: #475569;
  border-radius: 8px;
  padding: 5px 8px;
}

.wa-message-bubble {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.wa-message-bubble.from-contact {
  background: #ffffff;
}

.wa-message-bubble.from-agent {
  background: #dcf8c6;
}

.wa-chat-tools {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.wa-chat-conversations__header {
  background: #f8fafc;
}

.wa-chat-list-item {
  border: 1px solid transparent;
  border-radius: 12px;
  transition: all 0.18s ease;
}

.wa-chat-list-item:hover {
  border-color: rgba(14, 165, 165, 0.22);
  background: rgba(255, 255, 255, 0.8);
}

.wa-chat-list-item.is-active {
  border-color: rgba(14, 165, 165, 0.4);
  background: linear-gradient(140deg, rgba(14, 165, 165, 0.14), rgba(59, 130, 246, 0.14));
}

.wa-chat-contact-title {
  text-decoration: none;
  color: inherit;
}
