/* ════════════════════════════════════════════════════════════
   CONSOLE THEME BRIDGE & CUSTOM STYLES
   Designed for premium enterprise look: glassmorphism, glowing surfaces,
   Space Grotesk modern layout, and clean data presentation.
   ════════════════════════════════════════════════════════════ */

:root {
  --bg-app: var(--bg);
  --bg-elevated: var(--bg-2);
  --panel: var(--surface);
  --panel-2: var(--surface-2);
  --panel-3: var(--surface-3);
  --card: var(--surface);
  --card-soft: var(--surface-2);
  --text-main: var(--text);
  --text-soft: var(--text-muted);
  --text-faint: var(--text-dim);
  --brand: var(--primary);
  --brand-2: var(--primary-2);
  --accent-2: var(--accent);
  --border: var(--line);
  --border-strong: var(--line-2);
  --ok: var(--success);
  --warn: var(--warning);
  --bad: var(--danger);
  --shadow-soft: var(--shadow-md);
  --shadow-strong: var(--shadow-lg);
  --radius-card: 22px;
  --radius-pill: 999px;
  
  /* Shared legacy vars */
  --bg2: var(--bg-2);
  --card2: var(--surface-2);
  --mut: var(--text-muted);
  --blue: var(--primary);
  --blue2: var(--primary-2);
  --green: var(--success);
  --amber: var(--warning);
  --red: var(--danger);
  --shadow: var(--shadow-lg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', -apple-system, system-ui, sans-serif;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 45%),
              radial-gradient(circle at bottom right, rgba(129, 140, 248, 0.08), transparent 45%),
              var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

body.console-admin {
  background: radial-gradient(circle at top center, rgba(56, 189, 248, 0.15), transparent 40%),
              radial-gradient(circle at bottom center, rgba(129, 140, 248, 0.08), transparent 45%),
              var(--bg);
  color: var(--text-main);
}

.wrap {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* App shell layout */
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.side {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.main {
  margin-left: 240px;
  padding: 38px 40px;
  min-width: 0;
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.05em;
  background: linear-gradient(135deg, var(--text-main), var(--text-soft));
  -webkit-background-clip: text;
  color: transparent;
}

.brand span {
  color: var(--blue);
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
}

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

.nav a {
  padding: 12px 16px;
  border-radius: 14px;
  color: var(--mut);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav a:hover,
.nav a.active {
  background: rgba(56, 189, 248, 0.08);
  color: var(--blue);
  border-color: rgba(56, 189, 248, 0.12);
  transform: translateX(4px);
}

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

.title {
  font-size: 38px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -.05em;
  margin: 0 0 6px;
}

.subtitle,
.muted {
  color: var(--mut);
  font-size: 14px;
}

/* Glass Cards */
.card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.65), rgba(8, 17, 31, 0.72)) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
  border-color: var(--border-strong) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

.grid {
  display: grid;
  gap: 20px;
}

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

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

.kpi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.kpi .card {
  min-width: 0;
  margin-bottom: 0;
}

.v {
  font-size: 32px !important;
  font-weight: 900 !important;
  letter-spacing: -.05em;
  color: var(--text-main);
  margin-top: 8px;
}

/* Inputs and Forms */
input,
select,
textarea {
  background: rgba(15, 23, 42, 0.5) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  padding: 14px 16px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  width: 100%;
  outline: none;
  transition: all 0.22s ease;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  background-size: 18px !important;
  padding-right: 40px !important;
  cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
  background: rgba(15, 23, 42, 0.8) !important;
}

/* Premium Buttons */
button,
.btn {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue2), #4f46e5);
  color: #fff;
  font-weight: 800;
  padding: 12px 20px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
  filter: brightness(1.1);
}

button:active,
.btn:active {
  transform: translateY(0);
}

/* Button Utilities */
.btn-sm,
button.btn-sm {
  padding: 6px 12px !important;
  font-size: 11px !important;
  border-radius: 8px !important;
}

.btn-block,
button.btn-block {
  width: 100% !important;
}

button.ghost,
.btn.secondary {
  background: rgba(148, 163, 184, 0.1) !important;
  color: var(--text-main);
  border: 1px solid var(--border) !important;
  box-shadow: none;
}

button.ghost:hover,
.btn.secondary:hover {
  background: rgba(148, 163, 184, 0.18) !important;
  box-shadow: none;
  border-color: var(--border-strong) !important;
}

button.warn {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #000;
}

button.bad {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #fff;
}

button.ok {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #fff;
}

/* Table styling */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  font-size: 11px;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}

td {
  color: var(--text-main);
}

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: rgba(56, 189, 248, 0.04);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge.ok {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.2);
}

.badge.bad {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.2);
}

.badge.unl {
  background: rgba(56, 189, 248, 0.12);
  color: var(--blue);
  border-color: rgba(56, 189, 248, 0.2);
}

code,
pre {
  background: rgba(15, 23, 42, 0.6) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 13px;
}

pre {
  padding: 16px;
  overflow: auto;
}

.hide {
  display: none !important;
}

/* Login Panel Layout */
.login-card {
  max-width: 440px;
  margin: 12vh auto;
  padding: 34px !important;
  box-shadow: var(--shadow-lg) !important;
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(8, 17, 31, 0.9)) !important;
}

.login-card label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
  color: var(--text-soft);
  margin-top: 14px;
}

.login-card input {
  margin-bottom: 4px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* responsive media queries */
/* Sidebar Nav Cursor Fix */
.nav a {
  cursor: pointer;
}

/* Tab Bar Button Hover Micro-interaction */
.tab-bar button:hover {
  color: var(--text-main) !important;
  background: rgba(56, 189, 248, 0.08) !important;
}

/* Page Headers & Titles */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.page-head.split {
  flex-wrap: wrap;
}

.page-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 6px;
}

.page-head h2 {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.05em;
  margin: 0;
  color: var(--text-main);
}

.page-note {
  color: var(--mut);
  font-size: 14px;
  margin: 0;
}

.page-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.toolbar-actions {
  display: flex;
  gap: 12px;
}

/* Glass Card Table Shell */
.table-shell {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.65), rgba(8, 17, 31, 0.72)) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-top: 16px;
  margin-bottom: 24px;
}

.table-wrap {
  overflow-x: auto !important;
  width: 100% !important;
  -webkit-overflow-scrolling: touch;
}

/* KPI Metrics Dashboard Cells */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.kpi-cell {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.65), rgba(8, 17, 31, 0.72)) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow);
  padding: 24px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-cell:hover {
  border-color: var(--border-strong) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

.kpi-cell .label {
  color: var(--mut);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.kpi-cell .val {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -.05em;
  color: var(--text-main);
  margin-top: 8px;
}

/* Product Lini Sections */
.lini-section {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.65), rgba(8, 17, 31, 0.72)) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.lini-section h3 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Create & Admin Form Splitting */
.admin-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

.panel-soft {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.65), rgba(8, 17, 31, 0.72)) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow);
  padding: 24px;
}

.panel-soft label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-soft);
  margin-top: 14px;
  margin-bottom: 6px;
}

/* Flex Toolbar Inputs sizing */
.search-bar input {
  flex: 1;
  width: auto !important;
}

.search-bar select {
  width: auto !important;
}

/* Responsive login card wrapper */
.login-card {
  width: min(100% - 32px, 440px) !important;
}

.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 20px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.mobile-topbar-brand {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.04em;
}

.mobile-topbar-brand span {
  color: var(--blue);
}

.mobile-menu-toggle {
  display: none;
}

.mobile-menu-toggle.inline {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.1);
  color: var(--blue);
  border: 1px solid rgba(56, 189, 248, 0.2);
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(4px);
  z-index: 998;
}

.mobile-overlay.active {
  display: block;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  width: min(90vw, 560px);
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-strong);
  padding: 28px;
  animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.danger-zone {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 16px;
  padding: 18px;
  margin-top: 20px;
}

/* admin specific components */
.providers-page {
  display: grid;
  gap: 20px;
}

.providers-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.providers-eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.providers-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.providers-statcard {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.providers-statcard b {
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.providers-statcard span {
  font-size: 10px;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}

.providers-statcard.success b {
  color: var(--green);
}

.providers-statcard.danger b {
  color: var(--red);
}

.providers-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  padding: 16px 20px;
}

.providers-searchbox {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
  min-width: min(100%, 420px);
  transition: all 0.22s ease;
}

.providers-searchbox:focus-within {
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
  background: rgba(15, 23, 42, 0.8) !important;
}

.providers-searchbox input {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.providers-searchbox input:focus {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

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

.provider-bento-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.015));
  border-radius: 18px;
  border: 1px solid var(--border);
}

.provider-bento-card.is-healthy {
  border-color: rgba(16, 185, 129, 0.22);
}

.provider-bento-card.is-partial {
  border-color: rgba(245, 158, 11, 0.24);
}

.provider-bento-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.16);
}

.provider-bento-name {
  font-size: 16px;
  font-weight: 800;
}

.provider-bento-subname {
  font-size: 12px;
  color: var(--mut);
  margin-top: 2px;
}

.provider-bento-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.provider-bento-stat {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  text-align: center;
}

.provider-bento-stat-value {
  font-size: 18px;
  font-weight: 900;
}

.provider-bento-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--mut);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.tab-bar button {
  background: transparent;
  color: var(--mut);
  border: 1px solid transparent;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: none;
  font-weight: 700;
}

.tab-bar button.active {
  background: rgba(56, 189, 248, 0.12) !important;
  color: var(--blue) !important;
  border-color: rgba(56, 189, 248, 0.22) !important;
  box-shadow: none !important;
}

.tab-bar button:hover {
  transform: none;
  box-shadow: none;
}

.search-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border);
  border-radius: 18px;
}

/* Wizard / Flow steps */
.modal-flow-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.flow-step {
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  color: var(--mut);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.flow-step.active {
  background: rgba(56, 189, 248, 0.12);
  color: var(--blue);
  border-color: rgba(56, 189, 248, 0.2);
}

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

.modal-provider-summary > div {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.4);
}

.modal-provider-summary span {
  display: block;
  font-size: 9px;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
  font-weight: 800;
}

.modal-provider-summary b {
  font-size: 14px;
  color: var(--text-main);
}

/* Side footer elements */
.side-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.side-backlink {
  font-size: 13px;
  color: var(--mut);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}

.side-backlink:hover {
  color: var(--blue);
}

/* Floating Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.9) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  padding: 14px 22px !important;
  color: var(--text-main) !important;
  box-shadow: var(--shadow-strong);
  font-weight: 700;
  font-size: 14px;
  animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: var(--green) !important;
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: var(--red) !important;
}

/* Page visibility toggle */
.page { display: none; }
.page.active { display: block; }

/* Empty state placeholder */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--mut);
  font-size: 14px;
  text-align: center;
  gap: 8px;
}

.empty-state .icon {
  font-size: 36px;
  margin-bottom: 4px;
  opacity: 0.6;
}

/* Additional badge variants */
.badge.info {
  background: rgba(56, 189, 248, 0.12);
  color: var(--blue);
  border-color: rgba(56, 189, 248, 0.2);
}

.badge.warn {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border-color: rgba(245, 158, 11, 0.2);
}

.badge.err {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.2);
}

.badge.off {
  background: rgba(148, 163, 184, 0.1);
  color: var(--mut);
  border-color: rgba(148, 163, 184, 0.15);
}

/* Modal inner sections */
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  justify-content: flex-end;
}

.modal-actions .modal-grow {
  flex: 1;
}

.modal-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.modal-section h4 {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 10px;
}

.modal-provider-head {
  margin-bottom: 16px;
}

.modal-provider-head h3 {
  font-size: 20px;
  font-weight: 900;
  margin: 0;
}

/* Form group for modals/panels */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-soft);
  margin-bottom: 6px;
}

/* Provider Category Layout */
.provider-category {
  margin-bottom: 24px;
}

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

.provider-category-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 0;
}

.provider-category-desc {
  font-size: 13px;
  color: var(--mut);
  margin: 4px 0 0;
}

.provider-category-count {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--mut);
  white-space: nowrap;
}

/* Provider Bento Card inner elements */
.provider-bento-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.provider-bento-info {
  min-width: 0;
}

.provider-bento-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.provider-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(56, 189, 248, 0.08);
  color: var(--blue);
  border: 1px solid rgba(56, 189, 248, 0.14);
}

.provider-chip.muted {
  background: rgba(148, 163, 184, 0.08);
  color: var(--mut);
  border-color: rgba(148, 163, 184, 0.12);
}

.provider-bento-add {
  font-size: 12px;
  color: var(--mut);
  font-weight: 700;
  padding-top: 4px;
}

.provider-more {
  font-size: 11px;
  color: var(--mut);
  font-weight: 700;
  padding: 4px 0;
}

/* Connection pill inside provider cards */
.provider-bento-connections {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.connection-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.connection-pill:hover {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.2);
}

.connection-pill-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.connection-pill-status.active {
  background: var(--green);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.connection-pill-status.error {
  background: var(--red);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.connection-pill-status.unknown {
  background: var(--mut);
}

.connection-pill-name {
  font-size: 12px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-pill-priority {
  font-size: 10px;
  font-weight: 800;
  color: var(--mut);
  letter-spacing: .04em;
}

/* Provider bento card hover cursor */
.provider-bento-card {
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.provider-bento-card:hover {
  border-color: var(--border-strong) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transform: translateY(-2px);
}

/* Providers hero subtitle */
.providers-subtitle {
  color: var(--mut);
  font-size: 13px;
  margin-top: 4px;
}

/* Providers toolbar note */
.providers-toolbar-note {
  font-size: 12px;
  color: var(--mut);
}

/* Login actions spacing */
.login-actions {
  margin-top: 16px;
}

/* Toast fade-out animation */
@keyframes toastFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(12px); }
}

.toast.hide {
  animation: toastFadeOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

/* btn variant for success and danger inline */
button.success,
.btn.success {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #fff;
}

button.danger,
.btn.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #fff;
}

/* Mobile responsive fixes */
@media (max-width: 1023px) {
  .shell {
    display: block;
  }
  .side {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    width: 280px;
    height: 100vh;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.96) !important;
    backdrop-filter: blur(24px);
    border-right: 1px solid var(--border);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .side.active {
    transform: translateX(0);
  }
  .main {
    margin-left: 0 !important;
    padding: 16px;
    padding-top: 84px;
  }
  .table-shell,
  .card,
  .panel-soft,
  .lini-section {
    padding: 16px !important;
    border-radius: 16px !important;
  }
  .mobile-topbar {
    display: flex;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
  }
  .page-head h2 {
    font-size: 28px;
  }
  .kpi,
  .kpi-grid,
  .grid,
  .grid2,
  .grid3,
  .admin-split-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  .provider-bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .search-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-bar input,
  .search-bar select,
  .search-bar button {
    width: 100% !important;
  }
  .provider-category-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 767px) {
  .provider-bento-grid {
    grid-template-columns: 1fr !important;
  }
  .providers-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .modal-provider-summary {
    grid-template-columns: 1fr;
  }
  .v, .kpi-cell .val {
    font-size: 24px !important;
  }
}

@media (max-width: 480px) {
  .providers-stats {
    grid-template-columns: 1fr !important;
  }
  th, td {
    padding: 10px 8px;
    font-size: 12px;
  }
}
