/* ============================================
   APPLE LIQUID GLASS DESIGN SYSTEM
   Translucent · Luminous · Fluid · Layered
   ============================================ */

:root {
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-bg-thick: rgba(255, 255, 255, 0.62);
  --glass-bg-thin: rgba(255, 255, 255, 0.28);
  --glass-bg-hover: rgba(255, 255, 255, 0.58);
  --glass-bg-active: rgba(255, 255, 255, 0.72);
  --glass-blur: 40px;
  --glass-blur-heavy: 60px;
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-border-subtle: rgba(255, 255, 255, 0.25);
  --glass-shadow: 0 2px 20px rgba(0, 0, 0, 0.06), 0 0 0 0.5px rgba(255, 255, 255, 0.5) inset;
  --glass-shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(255, 255, 255, 0.55) inset;
  --glass-highlight: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );

  --accent: #007aff;
  --accent-hover: #0a84ff;
  --accent-soft: rgba(0, 122, 255, 0.12);
  --accent-text: #0055d4;
  --accent-gradient: linear-gradient(135deg, #007aff 0%, #5856d6 100%);

  --red: #ff3b30;
  --orange: #ff9500;
  --green: #34c759;
  --teal: #5ac8fa;
  --purple: #af52de;
  --pink: #ff2d55;

  --color-primary: var(--accent);
  --color-success: var(--green);
  --color-warning: var(--orange);
  --color-danger: var(--red);

  --text-primary: rgba(0, 0, 0, 0.85);
  --text-secondary: rgba(0, 0, 0, 0.55);
  --text-tertiary: rgba(0, 0, 0, 0.35);
  --text-on-accent: #ffffff;

  --sidebar-width: 260px;
  --topbar-height: 56px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 100px;

  --transition-spring: 0.5s cubic-bezier(0.32, 0.72, 0, 1);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;

  background: linear-gradient(160deg, #ffffff 0%, #faf8f5 30%, #f5f0eb 60%, #f0ece6 100%);
  background-attachment: fixed;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
  outline: none;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ============================================
   LAYOUT
   ============================================ */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ============================================
   SIDEBAR — Frosted Navigation Rail
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--glass-bg-thick);
  backdrop-filter: blur(var(--glass-blur-heavy)) saturate(1.8);
  -webkit-backdrop-filter: blur(var(--glass-blur-heavy)) saturate(1.8);
  border-right: 0.5px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100;
  transition: transform var(--transition-spring);
}

.sidebar-header {
  padding: 20px 18px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.logo-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.logo-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-text span {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.93rem;
  transition: all var(--transition-normal);
  position: relative;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: all var(--transition-normal);
}

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

.nav-item:hover svg {
  opacity: 1;
}

.nav-item.active {
  color: var(--text-on-accent);
  background: var(--accent-gradient);
  box-shadow:
    0 4px 16px rgba(0, 122, 255, 0.25),
    0 0 0 0.5px rgba(255, 255, 255, 0.2) inset;
}

.nav-item.active svg {
  opacity: 1;
  color: white;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
}

.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.5);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.3);
    opacity: 0.6;
  }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--glass-bg-thin);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.35);
  position: relative;
  z-index: 10;
}

.menu-toggle {
  display: none;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
}

.topbar-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-time {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* ============================================
   PAGE CONTENT
   ============================================ */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 40px;
  position: relative;
  z-index: 1;
}

/* ============================================
   GLASS CARD — Core Surface Element
   ============================================ */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--glass-highlight);
  pointer-events: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.card:hover {
  background: var(--glass-bg-hover);
  box-shadow: var(--glass-shadow-elevated);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.card-header .badge {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* ============================================
   STAT CARDS — Dashboard Metrics
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-spring);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--glass-highlight);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--glass-shadow-elevated);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon.stat-agent,
.stat-icon.stat-security {
  background: rgba(175, 82, 222, 0.15);
  color: var(--purple);
}

.stat-icon.stat-device {
  background: rgba(52, 199, 89, 0.15);
  color: var(--green);
}

.stat-icon.stat-user,
.stat-icon.stat-focus {
  background: rgba(0, 122, 255, 0.12);
  color: var(--accent);
}

.stat-icon.stat-conversation {
  background: rgba(255, 149, 0, 0.15);
  color: var(--orange);
}

.stat-icon.pink {
  background: rgba(255, 45, 85, 0.12);
  color: var(--pink);
}

.stat-icon.cyan {
  background: rgba(90, 200, 250, 0.15);
  color: var(--teal);
}

.stat-info {
  position: relative;
  z-index: 1;
}

.stat-info h4 {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-info .stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

/* ============================================
   TABLE
   ============================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  position: relative;
  z-index: 1;
}

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

th {
  text-align: left;
  padding: 10px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  white-space: nowrap;
}

td {
  padding: 10px 10px;
  font-size: 0.88rem;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
  white-space: nowrap;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-primary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.online {
  background: rgba(52, 199, 89, 0.12);
  color: #1a8038;
}

.status-badge.offline {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-tertiary);
}

.status-badge.active {
  background: rgba(0, 122, 255, 0.1);
  color: var(--accent-text);
}

.status-badge.disabled {
  background: rgba(255, 59, 48, 0.1);
  color: var(--red);
}

/* ============================================
   BUTTONS — Liquid Pill Style
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--transition-normal);
  border: none;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 122, 255, 0.35);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 0.5px solid var(--glass-border-subtle);
  color: var(--text-secondary);
  box-shadow: var(--glass-shadow);
}

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(255, 59, 48, 0.1);
  color: var(--red);
}

.btn-danger:hover {
  background: rgba(255, 59, 48, 0.18);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

td .btn-group {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* ============================================
   FORMS — Frosted Inputs
   ============================================ */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition-normal);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) inset;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(0, 122, 255, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.04) inset;
  background: rgba(255, 255, 255, 0.7);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

textarea.form-input {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-hint {
  font-size: 0.73rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle {
  display: inline-block;
  position: relative;
  width: 46px;
  height: 28px;
  cursor: pointer;
  vertical-align: middle;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  transition: all var(--transition-spring);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: all var(--transition-spring);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

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

.range-wrap input[type='range'] {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.1);
  appearance: none;
  -webkit-appearance: none;
}

.range-wrap input[type='range']::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 6px rgba(0, 122, 255, 0.3);
  cursor: pointer;
}

.range-value {
  font-size: 0.85rem;
  color: var(--accent);
  min-width: 30px;
  text-align: center;
  font-weight: 700;
}

/* ============================================
   MODAL — Floating Glass Panel
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--glass-bg-thick);
  backdrop-filter: blur(var(--glass-blur-heavy)) saturate(1.8);
  -webkit-backdrop-filter: blur(var(--glass-blur-heavy)) saturate(1.8);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.18),
    0 0 0 0.5px rgba(255, 255, 255, 0.5) inset;
  transform: scale(0.92) translateY(12px);
  transition: all var(--transition-spring);
  position: relative;
  overflow: hidden;
}

.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--glass-highlight);
  pointer-events: none;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 1;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 650;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-tertiary);
  background: rgba(0, 0, 0, 0.05);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

.modal-body {
  flex: 1;
  padding: 22px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: relative;
  z-index: 1;
}

/* ============================================
   TOAST — Floating Notification Pill
   ============================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  max-width: 380px;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  animation: toastIn 0.5s cubic-bezier(0.32, 0.72, 0, 1);
  border: 0.5px solid;
}

.toast.success {
  background: rgba(52, 199, 89, 0.18);
  color: #1a8038;
  border-color: rgba(52, 199, 89, 0.2);
}

.toast.error {
  background: rgba(255, 59, 48, 0.18);
  color: #c62828;
  border-color: rgba(255, 59, 48, 0.2);
}

.toast.info {
  background: rgba(0, 122, 255, 0.15);
  color: var(--accent-text);
  border-color: rgba(0, 122, 255, 0.2);
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    transform: translateX(80px) scale(0.8);
    opacity: 0;
  }

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

@keyframes toastOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(80px);
    opacity: 0;
  }
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
  position: relative;
  z-index: 1;
}

.empty-state svg {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  opacity: 0.25;
}

.empty-state h4 {
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.88rem;
}

/* ============================================
   TABS — Segmented Control (Apple style)
   ============================================ */
.tabs {
  display: flex;
  gap: 0;
  padding: 3px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-md);
  margin-bottom: 22px;
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: calc(var(--radius-md) - 2px);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all var(--transition-spring);
  white-space: nowrap;
  flex: 1;
  text-align: center;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: white;
  color: var(--text-primary);
  box-shadow:
    0 1px 6px rgba(0, 0, 0, 0.08),
    0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

/* ============================================
   PROVIDER CARDS
   ============================================ */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.provider-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--glass-shadow);
  transition: all var(--transition-spring);
  position: relative;
  overflow: hidden;
}

.provider-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--glass-highlight);
  pointer-events: none;
}

.provider-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-elevated);
}

.provider-card.selected {
  border-color: var(--accent);
  box-shadow:
    0 4px 20px rgba(0, 122, 255, 0.15),
    0 0 0 0.5px rgba(255, 255, 255, 0.5) inset;
}

.provider-card.selected::after {
  content: '● 当前使用';
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-gradient);
  color: white;
  font-weight: 700;
  z-index: 2;
}

.provider-name {
  font-size: 1rem;
  font-weight: 650;
  position: relative;
  z-index: 1;
}

.provider-type {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.provider-detail {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.provider-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 1;
}

/* ============================================
   AGENT CARDS
   ============================================ */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.agent-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--glass-shadow);
  transition: all var(--transition-spring);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.agent-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--glass-highlight);
  pointer-events: none;
}

.agent-card:hover {
  transform: translateY(-3px) scale(1.005);
  box-shadow: var(--glass-shadow-elevated);
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.agent-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.agent-name {
  font-size: 1rem;
  font-weight: 650;
}

.agent-meta {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.agent-prompt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.agent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.agent-tag {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

/* ============================================
   LOADING
   ============================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-top: 3px;
  font-weight: 500;
}

/* ============================================
   LOG MANAGEMENT — Reuses the device page language
   ============================================ */
.logs-section-header {
  align-items: flex-start;
}

.logs-heading {
  width: 100%;
}

.logs-toolbar {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.logs-toolbar-row,
.logs-custom-time,
.logs-results-bar,
.logs-results-stats,
.logs-results-actions,
.logs-keyword-search,
.level-filters {
  display: flex;
  align-items: center;
}

.logs-toolbar-row {
  gap: 8px;
  flex-wrap: wrap;
}

.logs-type-select {
  width: 230px;
  min-width: 210px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.logs-page .time-presets {
  gap: 8px;
}

.logs-page .time-presets .btn.active,
.logs-page #viewModeGroup .btn.active {
  color: var(--text-on-accent);
  background: var(--accent-gradient);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.22);
}

.logs-toolbar-secondary {
  padding-top: 1px;
}

.level-filters {
  gap: 6px;
  flex-wrap: wrap;
}

.level-filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 11px;
  border: 0.5px solid var(--glass-border-subtle);
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all var(--transition-normal);
}

.level-filters label:hover {
  color: var(--text-primary);
  background: var(--glass-bg-hover);
}

.level-filters label:has(input:checked) {
  color: var(--accent-text);
  background: var(--accent-soft);
  border-color: rgba(0, 122, 255, 0.18);
  box-shadow: none;
}

.level-filters label[data-level='error']:has(input:checked) {
  color: #c92a22;
  background: rgba(255, 59, 48, 0.1);
  border-color: rgba(255, 59, 48, 0.16);
}

.level-filters label[data-level='warn']:has(input:checked) {
  color: #a45d00;
  background: rgba(255, 149, 0, 0.11);
  border-color: rgba(255, 149, 0, 0.18);
}

.level-filters input {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
}

.logs-keyword-search {
  gap: 6px;
}

.logs-keyword-search .form-input {
  width: 250px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 0.8rem;
}

.logs-keyword-search #regexToggleBtn {
  min-width: 88px;
  justify-content: center;
}

.logs-custom-time {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
}

.logs-custom-time label,
.logs-advanced-fields label span {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
}

.logs-custom-time .form-input {
  width: auto;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 0.8rem;
}

.logs-advanced-fields {
  display: none;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.025);
}

.logs-advanced-fields label {
  display: grid;
  gap: 5px;
}

.logs-advanced-fields .form-input {
  width: 180px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 0.8rem;
}

.logs-results-bar {
  display: none;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  min-height: 32px;
  font-size: 0.82rem;
}

.logs-results-stats,
.logs-results-actions {
  gap: 10px;
  flex-wrap: wrap;
}

#matchStats {
  color: var(--text-secondary);
  font-weight: 600;
}

#filesAvailable {
  color: var(--text-tertiary);
  cursor: help;
}

.logs-table-card {
  display: flex;
  flex-direction: column;
  padding: 16px 22px 0;
}

.logs-content {
  flex: 1;
  min-height: 420px;
  max-height: 65vh;
  overflow: auto;
  color: var(--text-primary);
}

.logs-empty-state {
  padding: 50px 20px;
  color: var(--text-tertiary);
  text-align: center;
  font-size: 0.9rem;
}

.logs-load-more {
  display: none;
  padding: 10px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.05);
  color: var(--text-tertiary);
  text-align: center;
  font-size: 0.8rem;
}

.logs-page .log-table {
  width: 100% !important;
  border-collapse: collapse !important;
  color: var(--text-primary) !important;
  background: transparent !important;
  font-size: 0.85rem !important;
}

.logs-page .log-table thead {
  position: sticky !important;
  top: 0;
  z-index: 10;
  background: rgba(250, 249, 247, 0.94) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06) !important;
}

.logs-page .log-table th {
  padding: 10px !important;
  color: var(--text-tertiary) !important;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em;
}

.logs-page .log-table tr {
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.04) !important;
}

.logs-page .log-table td {
  padding: 10px !important;
  border-bottom: none !important;
  color: var(--text-secondary);
}

.logs-page .log-table tbody tr:hover td {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.02) !important;
}

.logs-page .log-structured-table td:nth-child(6) {
  color: var(--text-secondary) !important;
}

.logs-page .log-dialog-table td:nth-child(2),
.logs-page .log-dialog-table td:nth-child(3) {
  color: var(--accent-text) !important;
}

.logs-page .hover-bg-light:hover {
  background: rgba(0, 0, 0, 0.02) !important;
}

@media (max-width: 1100px) {
  .logs-type-select,
  .logs-keyword-search .form-input {
    width: 210px;
  }

  .logs-results-bar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .logs-toolbar-primary,
  .logs-toolbar-secondary,
  .logs-keyword-search {
    align-items: stretch;
  }

  .logs-type-select,
  .logs-keyword-search,
  .logs-keyword-search .form-input {
    width: 100%;
  }

  .logs-table-card {
    padding-inline: 12px;
  }
}

/* ============================================
   CONFIG SECTIONS
   ============================================ */
.config-section {
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 18px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.config-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
}

.config-label {
  font-size: 0.9rem;
  font-weight: 550;
}

.config-desc {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid var(--glass-border-subtle);
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  box-shadow: var(--glass-shadow);
  transition: all var(--transition-fast);
}

.chip .chip-remove {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.06);
  border: 0;
  padding: 0;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip .chip-remove:hover {
  background: var(--red);
  color: white;
}

/* ============================================
   CONFIRM DIALOG
   ============================================ */
.confirm-content {
  text-align: center;
  padding: 20px 0;
  position: relative;
  z-index: 1;
}

.confirm-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

/* ============================================
   FADE-IN ANIMATION
   ============================================ */
.fade-in {
  animation: fadeIn 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.15);
  }

  .menu-toggle {
    display: flex;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .agent-grid,
  .provider-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .page-content {
    padding: 16px;
  }

  .topbar {
    padding: 0 16px;
  }
}

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

/* ============================================
   LOGIN OVERLAY — Pure White Minimalist
   ============================================ */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #ffffff 0%, #faf8f5 30%, #f5f0eb 60%, #f0ece6 100%);
  background-attachment: fixed;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  width: 380px;
  max-width: 90vw;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 44px 36px 36px;
  box-shadow: var(--glass-shadow-elevated);
  position: relative;
  overflow: hidden;
  animation: loginCardIn 0.5s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--glass-highlight);
  pointer-events: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

@keyframes loginCardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.login-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.login-logo-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.login-logo h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.login-logo p {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.login-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.login-field .form-input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.93rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) inset;
  transition: all var(--transition-normal);
}

.login-field .form-input::placeholder {
  color: var(--text-tertiary);
}

.login-field .form-input:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(0, 122, 255, 0.12),
    0 1px 4px rgba(0, 0, 0, 0.04) inset;
  background: rgba(255, 255, 255, 0.7);
}

.login-error {
  font-size: 0.8rem;
  color: var(--red);
  text-align: center;
  min-height: 1.2em;
  font-weight: 500;
}

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  background: var(--accent-gradient);
  color: white;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.25);
  margin-top: 4px;
  letter-spacing: 0.06em;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 122, 255, 0.35);
}

.login-btn:active {
  transform: scale(0.98);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.topbar-logout {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem !important;
  padding: 5px 12px !important;
  color: var(--text-tertiary) !important;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.topbar-logout:hover {
  opacity: 1;
  color: var(--red) !important;
}

.topbar-logout svg {
  width: 14px;
  height: 14px;
}

.battery-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
}

.battery-status.offline {
  opacity: 0.65;
}

.battery-cell {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 11px;
  border: 1.5px solid var(--text-secondary);
  border-radius: 2px;
  padding: 1px;
  box-sizing: border-box;
}

.battery-cell::after {
  content: '';
  position: absolute;
  top: 2px;
  right: -3px;
  width: 1.5px;
  height: 4px;
  background: var(--text-secondary);
  border-top-right-radius: 1px;
  border-bottom-right-radius: 1px;
}

.battery-fill {
  display: block;
  height: 100%;
  border-radius: 0.5px;
  background: #007aff; /* Fallback accent */
  transition:
    width 0.3s ease,
    background-color 0.3s ease;
}

.battery-status.low .battery-cell {
  border-color: #ff3b30;
}
.battery-status.low .battery-cell::after {
  background: #ff3b30;
}
.battery-status.low .battery-fill {
  background: #ff3b30;
}

.battery-status.normal .battery-cell {
  border-color: var(--text-secondary);
}
.battery-status.normal .battery-cell::after {
  background: var(--text-secondary);
}
.battery-status.normal .battery-fill {
  background: #34c759;
}

.battery-status.charging .battery-cell {
  border-color: #34c759;
}
.battery-status.charging .battery-cell::after {
  background: #34c759;
}
.battery-status.charging .battery-fill {
  background: #34c759;
}

.battery-status.high .battery-cell {
  border-color: #34c759;
}
.battery-status.high .battery-cell::after {
  background: #34c759;
}
.battery-status.high .battery-fill {
  background: #34c759;
}

.progress-container-mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.72rem;
  width: 100%;
}

.progress-label-mini {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1;
}

.progress-bar-mini {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-mini span {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.8s cubic-bezier(0.32, 0.72, 0, 1);
}

.status-badge.stage-1 {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
}

.status-badge.stage-2 {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.status-badge.stage-3 {
  background: rgba(6, 182, 212, 0.15);
  color: #0891b2;
}

.status-badge.stage-4 {
  background: rgba(168, 85, 247, 0.15);
  color: #9333ea;
}

.status-badge.stage-5 {
  background: rgba(244, 63, 94, 0.15);
  color: #e11d48;
}

.delta-positive {
  color: #1a8038;
}

.delta-negative {
  color: var(--red);
}

/* ============================================
   ACTIVE MODELS OVERVIEW PANEL (模型供应商顶端生效概览)
   ============================================ */
.active-models-overview {
  background: var(--glass-bg-thick);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: var(--glass-shadow);
}

.active-models-overview .overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
}

.active-models-overview .overview-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.active-models-overview .overview-tip {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.active-models-overview .overview-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

@media (max-width: 1100px) {
  .active-models-overview .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .active-models-overview .overview-grid {
    grid-template-columns: 1fr;
  }
}

.overview-card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--glass-border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100px;
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.overview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-elevated);
  border-color: var(--accent);
}

.overview-card.active-card {
  border-color: rgba(0, 122, 255, 0.35);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(240, 246, 255, 0.85));
}

.overview-card.focused {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2.5px var(--accent-soft),
    var(--glass-shadow-elevated);
}

.overview-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.module-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.module-tag.tag-LLM {
  background: rgba(0, 122, 255, 0.12);
  color: #007aff;
}

.module-tag.tag-TTS {
  background: rgba(52, 199, 89, 0.12);
  color: #28a745;
}

.module-tag.tag-ASR {
  background: rgba(255, 149, 0, 0.12);
  color: #b25e00;
}

.module-tag.tag-VLLLM {
  background: rgba(175, 82, 222, 0.12);
  color: #8e24aa;
}

.module-tag.tag-Embedding {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
}

.module-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.overview-card-body {
  flex: 1;
}

.active-provider-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-provider-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-provider-detail.placeholder {
  color: var(--text-tertiary);
  font-style: italic;
}

.overview-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.05);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--green);
  font-weight: 600;
}

.status-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}
/* ===========================
   DASHBOARD ENHANCED STYLES
   =========================== */

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-kpi-grid .stat-card {
  min-height: 90px;
  cursor: pointer;
}

.dashboard-kpi-grid .stat-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.12);
}

.dashboard-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.dashboard-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  transition:
    border-color 0.3s,
    transform 0.3s,
    box-shadow 0.3s;
}

.dashboard-chart-card.clickable {
  cursor: pointer;
}

.dashboard-chart-card.clickable:hover,
.dashboard-chart-card:hover {
  border-color: var(--color-primary);
}

.dashboard-chart-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--text-primary);
}

.dashboard-chart-card canvas {
  width: 100% !important;
  max-height: 260px;
}

.dashboard-biz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.dashboard-biz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  transition:
    border-color 0.3s,
    transform 0.3s,
    box-shadow 0.3s;
}

.dashboard-biz-card.clickable {
  cursor: pointer;
}

.dashboard-biz-card.clickable:hover,
.dashboard-biz-card:hover {
  border-color: var(--color-primary);
}

.dashboard-biz-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--text-primary);
}

.dashboard-biz-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dashboard-biz-stat:last-child {
  border-bottom: none;
}

.dashboard-biz-stat .label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.dashboard-biz-stat .value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.dashboard-fleet-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
  margin-bottom: 24px;
}

.dashboard-health-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.health-metric {
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  transition: all 0.2s ease;
}

.health-metric:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.health-metric .health-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.health-metric .health-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.health-metric .health-subtext {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.health-metric .health-value.ok {
  color: var(--color-success);
}

.health-metric .health-value.warn {
  color: var(--color-warning);
}

.health-metric .health-value.error {
  color: var(--color-danger);
}

.dashboard-progress {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  margin-top: 6px;
}

.dashboard-progress-bar {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--color-primary), #6c5ce7);
  transition: width 0.6s ease;
}

@media (max-width: 1200px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-charts-row,
  .dashboard-fleet-row {
    grid-template-columns: 1fr;
  }
  .dashboard-biz-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-health-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-health-grid {
    grid-template-columns: 1fr;
  }
}
