/* ==========================================================================
   AI PRICE TRACKER — ADMIN THEME (NÂU CAM / WARM BROWN-ORANGE)
   Font: Be Vietnam Pro | Icon: Font Awesome 6
   ========================================================================== */

:root {
  /* Nền tông nâu ấm (dark mode sáng vừa phải) */
  --bg-base: #1c130c;
  --bg-sidebar: #241a11;
  --bg-card: #2d2115;
  --bg-card-hover: #362a1a;
  --bg-elevated: #352819;
  --bg-input: #211810;

  --border-subtle: rgba(255, 226, 196, 0.11);
  --border-strong: rgba(255, 226, 196, 0.18);
  --border-focus: rgba(238, 146, 73, 0.55);

  /* Cam nhấn chính */
  --accent: #ee9249;
  --accent-strong: #e07f33;
  --accent-deep: #b95f22;
  --accent-soft: rgba(238, 146, 73, 0.15);
  --accent-soft-2: rgba(238, 146, 73, 0.26);
  --accent-text: #f5ae72;
  --accent-gradient: linear-gradient(135deg, #f0a05c 0%, #d9742e 100%);

  /* Chữ tông ấm */
  --text-main: #fbf5ed;
  --text-secondary: #d2c2b0;
  --text-muted: #a89680;
  --text-dim: #86745f;

  /* Trạng thái */
  --success: #57c78a;
  --success-bg: rgba(87, 199, 138, 0.13);
  --success-border: rgba(87, 199, 138, 0.3);
  --warning: #f5b043;
  --warning-bg: rgba(245, 176, 67, 0.13);
  --warning-border: rgba(245, 176, 67, 0.3);
  --danger: #f07a6a;
  --danger-bg: rgba(240, 122, 106, 0.13);
  --danger-border: rgba(240, 122, 106, 0.3);
  --purple: #c39be0;
  --purple-bg: rgba(195, 155, 224, 0.13);

  --font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-width: 262px;
  --shadow-card: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scrollbar-color: #5a4430 var(--bg-base);
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image:
    radial-gradient(1000px 500px at 85% -10%, rgba(238, 146, 73, 0.09) 0%, transparent 55%),
    radial-gradient(800px 500px at -10% 110%, rgba(185, 95, 34, 0.08) 0%, transparent 55%);
  background-attachment: fixed;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #5a4430; border-radius: 999px; border: 2px solid var(--bg-base); }
::-webkit-scrollbar-thumb:hover { background: #6f5540; }

i.fa-solid, i.fa-brands, i.fa-regular { line-height: 1; }

/* ==========================================================================
   BỐ CỤC TỔNG: SIDEBAR + NỘI DUNG
   ========================================================================== */

.admin-shell {
  display: flex;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   SIDEBAR
-------------------------------------------------------------------------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.4rem 1.35rem 1.2rem;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff7ee;
  box-shadow: 0 6px 18px -6px rgba(224, 127, 51, 0.6);
}

.brand-text h1 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  white-space: nowrap;
}

.brand-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar-user {
  margin: 0.35rem 1.1rem 0.9rem;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.user-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-meta strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.user-pro-badge {
  color: var(--accent-text);
  font-size: 0.8rem;
  opacity: 0.85;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.9rem 1rem;
}

.nav-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 1rem 0.6rem 0.45rem;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.68rem 0.85rem;
  margin-bottom: 0.2rem;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  text-align: left;
  white-space: nowrap;
  text-decoration: none;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-item:hover {
  background: rgba(255, 226, 196, 0.07);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

.nav-item.active i { color: var(--accent-text); }

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(238, 146, 73, 0.8);
}

.nav-badge {
  margin-left: auto;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 226, 196, 0.08);
  color: var(--text-muted);
}

.nav-item.active .nav-badge {
  background: var(--accent-soft-2);
  color: var(--accent-text);
}

.sidebar-foot {
  padding: 0.9rem 0.9rem 1.1rem;
  border-top: 1px solid var(--border-subtle);
}

.nav-logout { color: var(--danger); }
.nav-logout i { color: var(--danger); }
.nav-logout:hover { background: var(--danger-bg); color: var(--danger); }
.nav-logout:hover i { color: var(--danger); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14, 9, 5, 0.6);
  backdrop-filter: blur(3px);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* --------------------------------------------------------------------------
   KHU VỰC CHÍNH + TOPBAR
-------------------------------------------------------------------------- */

.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(28, 19, 12, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.95rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar-heading h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.topbar-heading p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sidebar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.85rem;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--success);
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulseAnimation 2s infinite;
  flex-shrink: 0;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.content {
  padding: 1.75rem 2rem 3.5rem;
  width: 100%;
}

/* ==========================================================================
   NÚT BẤM
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff7ee;
  box-shadow: 0 6px 18px -8px rgba(224, 127, 51, 0.7);
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 22px -8px rgba(224, 127, 51, 0.85);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-text);
  border-color: var(--accent-soft-2);
}

.btn-ghost:hover { background: var(--accent-soft); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-danger:hover { background: rgba(240, 122, 106, 0.22); }

.btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-ghost-danger:hover { background: var(--danger-bg); }

.btn-icon-danger {
  padding: 0.38rem 0.6rem;
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-icon-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.btn-sm {
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
}

/* ==========================================================================
   THẺ SỐ LIỆU THỐNG KÊ
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 1.05rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--accent-soft-2);
  transform: translateY(-2px);
}

.stat-icon {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-meta { flex: 1; min-width: 0; }

.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 0.1rem;
}

.stat-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

/* ==========================================================================
   PANEL & BẢNG DỮ LIỆU
   ========================================================================== */

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active { display: block; }

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

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 1.25rem;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.overview-grid .panel-card { margin-bottom: 0; }

.panel-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-title h2 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.panel-title h2 i {
  color: var(--accent-text);
  font-size: 0.95rem;
}

.panel-title p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.panel-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* --------------------------------------------------------------------------
   TAB CON TRONG PANEL (VD: Đang theo dõi / Tất cả)
-------------------------------------------------------------------------- */

.sub-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 1.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.sub-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.05rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.sub-tab i { font-size: 0.85rem; }

.sub-tab:hover { color: var(--text-main); }

.sub-tab.active {
  color: var(--accent-text);
  border-bottom-color: var(--accent);
}

.sub-badge {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 226, 196, 0.09);
  color: var(--text-muted);
}

:root[data-theme="light"] .sub-badge {
  background: rgba(96, 71, 47, 0.09);
  color: var(--text-secondary);
}

.sub-tab.active .sub-badge {
  background: var(--accent-soft-2);
  color: var(--accent-text);
}

.search-box > i {
  position: absolute;
  left: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem 0.55rem 2.2rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
  min-width: 230px;
}

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

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(238, 146, 73, 0.12);
}

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--border-focus);
}

.filter-select option {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th {
  background: rgba(255, 226, 196, 0.05);
  padding: 0.8rem 1.25rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid rgba(255, 226, 196, 0.07);
  vertical-align: middle;
}

.data-table tbody tr { transition: background 0.15s ease; }

.data-table tbody tr:hover { background: rgba(255, 226, 196, 0.04); }

.table-loading {
  text-align: center;
  padding: 2.2rem !important;
  color: var(--text-muted);
}

.model-name-cell {
  display: flex;
  flex-direction: column;
  min-width: 180px;
}

.model-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.85rem;
  word-break: break-all;
}

.model-sub {
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* Cột "Mô hình" trong bảng Danh sách model: thu gọn một dòng, tràn hiện ... */
th.col-model, td.col-model { width: 170px; }

/* Cột "Thao tác" — co theo nội dung (width:1% = shrink-to-fit) */
th.col-actions, td.col-actions {
  width: 1%;
  white-space: nowrap;
  padding-left: 0.9rem;
  padding-right: 0.5rem;
}

td.col-model .model-name-cell {
  min-width: 140px;
  max-width: 170px;
}

td.col-model .model-id,
td.col-model .model-sub {
  display: block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.price-origin {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Cột chọn dòng + nhóm nút hành động */
.col-check {
  width: 42px;
  text-align: center;
}

.row-check {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

/* --------------------------------------------------------------------------
   BADGE TRẠNG THÁI
-------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge i { font-size: 0.68rem; }

.badge-qubax {
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--accent-soft-2);
}

.badge-nous {
  background: var(--purple-bg);
  color: var(--purple);
  border: 1px solid rgba(195, 155, 224, 0.28);
}

.badge-free {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-discount {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
  font-weight: 700;
}

.badge-status-online {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-status-offline {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.badge-status-unknown {
  background: rgba(150, 130, 110, 0.13);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* Cột "KiraAI Model" — model khớp bên KiraAI (trang Nhà cung cấp → Danh sách model) */
.kiraai-cell { white-space: nowrap; }

.kiraai-badge {
  background: var(--purple-bg);
  color: var(--purple);
  border: 1px solid rgba(195, 155, 224, 0.3);
}

.kiraai-none {
  color: var(--text-muted);
  opacity: 0.55;
}

/* Cột giá: hiện giá gốc (gạch ngang) cạnh giá đã giảm */
.price-original {
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 400;
  margin-right: 0.4rem;
}

.price-cell { white-space: nowrap; }

/* Dòng dưới trong ô giá: quy đổi VNĐ (và cache ở ô Giá input) */
.price-usd, .price-vnd { display: block; }

.price-vnd {
  font-size: 0.74rem;
  margin-top: 2px;
}

.price-vnd strong { color: var(--text-main); }

.cache-price {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.cache-price::before { content: '· '; }

/* Cột "KiraAI Model": badge + giá KiraAI (gốc → sau giảm) */
.kiraai-match {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.kiraai-price-row {
  font-size: 0.74rem;
  white-space: nowrap;
}

.kiraai-price strong { color: var(--text); }

/* Dòng giá phụ trong cột KiraAI: đầu ra & cache */
.kiraai-sub-price {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.kiraai-sub-price strong {
  color: var(--text-main);
  font-weight: 600;
}

.kiraai-disc {
  color: var(--success);
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.25rem;
}

/* Cột "So sánh giá gốc": giá gốc tracker ⇔ giá gốc KiraAI */
.price-compare-cell { white-space: nowrap; }

.price-compare {
  display: inline-block;
  font-size: 0.78rem;
}

/* Phần "(bằng nhau / rẻ hơn X% / đắt hơn X%)" xuống dòng dưới cặp giá */
.price-compare em {
  display: block;
  font-style: normal;
  font-weight: 700;
  margin-top: 1px;
}

.price-compare.cmp-cheaper { color: var(--success); }
.price-compare.cmp-dearer { color: var(--danger); }
.price-compare.cmp-equal { color: var(--text-muted); }

/* Cột "Thao tác" */
.model-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.model-actions .btn { padding: 0.3rem 0.5rem; }

.model-actions .btn:disabled { opacity: 0.55; cursor: wait; }

/* Modal "Thêm model vào KiraAI" (form rộng) */
#global-modal-box.modal-wide { max-width: 900px; }

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

.km-grid .form-label {
  font-size: 0.72rem;
  margin-bottom: 3px;
  display: block;
}

.km-grid .form-control {
  font-size: 0.82rem;
  padding: 0.4rem 0.55rem;
}

.km-grid textarea.form-control { resize: vertical; }

.km-span-2 { grid-column: span 2; }
.km-span-4 { grid-column: span 4; }

.km-section-title {
  grid-column: span 4;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.km-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.76rem;
}

.km-checks label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.km-ai-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}


/* --------------------------------------------------------------------------
   CÔNG TẮC THEO DÕI GIÁ
-------------------------------------------------------------------------- */

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 226, 196, 0.18);
  transition: 0.3s;
  border-radius: 24px;
}

.slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #d8c6b2;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--accent-gradient);
  box-shadow: 0 0 10px rgba(238, 146, 73, 0.45);
}

input:checked + .slider::before {
  transform: translateX(20px);
  background-color: #fff7ee;
}

/* ==========================================================================
   FORM CẤU HÌNH
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-label i {
  color: var(--accent-text);
  font-size: 0.8rem;
  width: 16px;
  text-align: center;
}

.form-hint {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-control::placeholder { color: var(--text-dim); }

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(238, 146, 73, 0.12);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.switch-label {
  font-size: 0.85rem;
  color: var(--text-main);
}

.form-actions {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.85rem;
  background: rgba(255, 226, 196, 0.04);
}

/* ==========================================================================
   PHÂN TRANG
   ========================================================================== */

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  gap: 0.5rem;
}

/* ==========================================================================
   TOAST & MODAL (KHÔNG DÙNG ALERT MẶC ĐỊNH)
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: rgba(53, 40, 25, 0.97);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-show { opacity: 1; transform: translateX(0); }
.toast-hide { opacity: 0; transform: translateX(30px); }

.toast-item.toast-success { border-left: 4px solid var(--success); }
.toast-item.toast-error { border-left: 4px solid var(--danger); }
.toast-item.toast-warning { border-left: 4px solid var(--warning); }
.toast-item.toast-info { border-left: 4px solid var(--accent); }

.toast-icon { font-size: 1.1rem; display: flex; }

.toast-item.toast-success .toast-icon { color: var(--success); }
.toast-item.toast-error .toast-icon { color: var(--danger); }
.toast-item.toast-warning .toast-icon { color: var(--warning); }
.toast-item.toast-info .toast-icon { color: var(--accent); }

.toast-content {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.45;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
  transition: var(--transition);
}

.toast-close:hover { color: var(--text-main); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 8, 4, 0.72);
  backdrop-filter: blur(8px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden { display: none; }
.modal-overlay.visible { opacity: 1; }

.modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.75);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.visible .modal-box { transform: scale(1); }

.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}

.modal-close-btn:hover { color: var(--text-main); }

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.9rem;
  color: var(--text-main);
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: rgba(255, 226, 196, 0.04);
}

.modal-confirm-text { color: var(--text-secondary); line-height: 1.6; }

/* ==========================================================================
   TRANG ĐĂNG NHẬP
   ========================================================================== */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(45, 33, 21, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 1rem;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff7ee;
  box-shadow: 0 10px 25px -8px rgba(224, 127, 51, 0.7);
}

.login-title h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.login-title p {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.login-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 247, 238, 0.3);
  border-radius: 50%;
  border-top-color: #fff7ee;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

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

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

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

  .sidebar-backdrop.show { display: block; opacity: 1; }

  .main-wrap { margin-left: 0; }

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

@media (max-width: 640px) {
  .topbar { padding: 0.85rem 1.1rem; }
  .content { padding: 1.25rem 1.1rem 3rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .panel-header { padding: 1.05rem 1.1rem; }
  .data-table th, .data-table td { padding: 0.75rem 0.9rem; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1; }
  .live-pill span:last-child { display: none; }
  .live-pill { padding: 0.42rem 0.6rem; }
  .providers-grid { grid-template-columns: 1fr; }
}

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

/* ==========================================================================
   LIGHT MODE (GIAO DIỆN SÁNG - TÔN KEM NÂU CAM)
   Bật/tắt qua nút theme-toggle, lưu lựa chọn trong localStorage
   ========================================================================== */

:root[data-theme="light"] {
  --bg-base: #f3ebdd;
  --bg-sidebar: #eaddc6;
  --bg-card: #fffcf5;
  --bg-card-hover: #fbf3e4;
  --bg-elevated: #fffcf5;
  --bg-input: #ffffff;

  --border-subtle: rgba(96, 71, 47, 0.16);
  --border-strong: rgba(96, 71, 47, 0.26);
  --border-focus: rgba(217, 116, 46, 0.55);

  --accent: #d9742e;
  --accent-strong: #c96a2e;
  --accent-deep: #a85420;
  --accent-soft: rgba(217, 116, 46, 0.12);
  --accent-soft-2: rgba(217, 116, 46, 0.24);
  --accent-text: #b0601f;
  --accent-gradient: linear-gradient(135deg, #f0a05c 0%, #d9742e 100%);

  --text-main: #33261a;
  --text-secondary: #66523b;
  --text-muted: #8a755c;
  --text-dim: #a3906f;

  --success: #1e8e5a;
  --success-bg: rgba(30, 142, 90, 0.11);
  --success-border: rgba(30, 142, 90, 0.35);
  --warning: #b45309;
  --warning-bg: rgba(180, 83, 9, 0.12);
  --warning-border: rgba(180, 83, 9, 0.35);
  --danger: #c2452f;
  --danger-bg: rgba(194, 69, 47, 0.11);
  --danger-border: rgba(194, 69, 47, 0.35);
  --purple: #7d4ba0;
  --purple-bg: rgba(125, 75, 160, 0.12);

  --shadow-card: 0 6px 18px -8px rgba(96, 71, 47, 0.2);
}

:root[data-theme="light"] body {
  background-image:
    radial-gradient(1000px 500px at 85% -10%, rgba(217, 116, 46, 0.08) 0%, transparent 55%),
    radial-gradient(800px 500px at -10% 110%, rgba(185, 95, 34, 0.07) 0%, transparent 55%);
}

:root[data-theme="light"] {
  scrollbar-color: #cbb59a var(--bg-base);
}

:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cbb59a; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #b49c7d; }

:root[data-theme="light"] .topbar {
  background: rgba(243, 235, 221, 0.88);
}

:root[data-theme="light"] .nav-item:hover {
  background: rgba(96, 71, 47, 0.07);
}

:root[data-theme="light"] .nav-badge {
  background: rgba(96, 71, 47, 0.09);
  color: var(--text-secondary);
}

:root[data-theme="light"] .data-table th {
  background: rgba(96, 71, 47, 0.055);
}

:root[data-theme="light"] .data-table td {
  border-bottom: 1px solid rgba(96, 71, 47, 0.09);
}

:root[data-theme="light"] .data-table tbody tr:hover {
  background: rgba(96, 71, 47, 0.045);
}

:root[data-theme="light"] .slider {
  background-color: rgba(96, 71, 47, 0.24);
}

:root[data-theme="light"] input:checked + .slider {
  box-shadow: 0 0 8px rgba(217, 116, 46, 0.35);
}

:root[data-theme="light"] .toast-item {
  background: rgba(255, 252, 245, 0.98);
  box-shadow: 0 12px 30px rgba(96, 71, 47, 0.25);
}

:root[data-theme="light"] .modal-overlay {
  background: rgba(70, 52, 34, 0.42);
}

:root[data-theme="light"] .modal-box {
  box-shadow: 0 25px 60px -12px rgba(70, 52, 34, 0.4);
}

:root[data-theme="light"] .modal-footer,
:root[data-theme="light"] .form-actions {
  background: rgba(96, 71, 47, 0.05);
}

:root[data-theme="light"] .login-card {
  background: rgba(255, 252, 245, 0.94);
  box-shadow: 0 25px 60px rgba(96, 71, 47, 0.25);
}

:root[data-theme="light"] .sidebar-backdrop {
  background: rgba(70, 52, 34, 0.35);
}

:root[data-theme="light"] .spinner {
  border: 2px solid rgba(96, 71, 47, 0.25);
  border-top-color: var(--accent-strong);
}

/* Nút chuyển đổi theme */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent-text);
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
}

.login-theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
}

/* Khối nội dung code trong modal (theo theme) */
.code-block {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-main);
}

.empty-note {
  text-align: center;
  padding: 2rem;
  background: var(--bg-input);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   THẺ NHÀ CUNG CẤP
-------------------------------------------------------------------------- */

.providers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  padding: 1.5rem;
}

.provider-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.provider-card:hover { border-color: var(--border-strong); }

.provider-card.provider-disabled { opacity: 0.6; }

.provider-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Khối quản lý API key */
.provider-keys {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.keys-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.keys-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.keys-title i { color: var(--accent-text); }

.add-key-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 420px;
}

.key-input {
  flex: 1;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  outline: none;
  transition: var(--transition);
}

.key-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(238, 146, 73, 0.12);
}

.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.key-row-disabled {
  opacity: 0.55;
  background: transparent;
  border-style: dashed;
}

.key-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  min-width: 0;
}

.key-masked {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--text-main);
}

.key-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.key-balance {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--success);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.key-balance i { font-size: 0.7rem; }

.key-balance-none {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.72rem;
}

.key-checked {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.key-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.keys-empty {
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 0.35rem 0;
}

.provider-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.provider-info {
  flex: 1;
  min-width: 0;
}

.provider-info strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}

.provider-key {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-top: 0.1rem;
}

.provider-slug-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.provider-slug-row > i {
  color: var(--accent-text);
  font-size: 0.75rem;
}

.slug-input {
  width: 150px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  outline: none;
  transition: var(--transition);
}

.slug-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(238, 146, 73, 0.12);
}

.slug-input + .btn { padding: 0.25rem 0.5rem; }

.provider-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.provider-stats i {
  color: var(--accent-text);
  margin-right: 0.3rem;
  font-size: 0.7rem;
}

/* Thanh công cụ danh sách model theo nhà cung cấp */
.model-list-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 226, 196, 0.02);
}

:root[data-theme="light"] .model-list-toolbar {
  background: rgba(96, 71, 47, 0.04);
}

.toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.toolbar-group label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toolbar-group label i { color: var(--accent-text); font-size: 0.75rem; }

.release-date { white-space: nowrap; }

/* --------------------------------------------------------------------------
   ĐỒNG BỘ KIRAAI
-------------------------------------------------------------------------- */

.sync-config {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.sync-note {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.5;
}

.sync-note i { color: var(--accent-text); margin-top: 0.15rem; }

.sync-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.sync-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 220px;
}

.sync-field-wide { width: 100%; }

.endpoint-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
}

.endpoint-box code {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  color: var(--accent-text);
  word-break: break-all;
}

.sync-keys-block {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sync-keys-block .keys-header { margin-bottom: 0.2rem; }

.sync-last-request {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sync-last-request i { color: var(--accent-text); }
