/* ═══════════════════════════════════════════════════════════════════════════
   UI/UX & ANIMATION SYSTEM — GRAPHITE TECH & LIQUID GLASS
   Directly inspired by mtips5s_motions
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hidden states ─────────────────────────────────────────────────────── */
.login-view[hidden],
.ig-shell[hidden],
.tab-page[hidden],
[hidden] {
  display: none !important;
}

/* ── Keyframes & Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes drawer-slide-in {
  from { opacity: 0; transform: translateX(20px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes modal-scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes apl-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.85); }
}

@keyframes stat-focus-pulse {
  0%   { box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.45); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

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

.lq-spin {
  display: inline-block;
  animation: lq-spin 0.8s linear infinite;
}

/* ── Login View ────────────────────────────────────────────────────────── */
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 0.4s var(--spring);
}

.login-card {
  width: min(380px, 100%);
  display: grid;
  gap: 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  background: var(--glass-bg-solid);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: var(--glass-edge), var(--shadow-modal);
  padding: 28px;
  animation: modal-scale-in 0.35s var(--spring);
}

.login-card .ig-brand {
  margin-bottom: 6px;
}

.ig-brand div strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.ig-brand div span {
  display: block;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 12px;
}

.login-method-nav {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
}

.login-method-tab {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2, #94a3b8);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.login-method-tab:hover {
  color: var(--ink, #ffffff);
}

.login-method-tab.active {
  background: var(--accent, #e56a4a);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(229, 106, 74, 0.35);
}

.login-checkpoint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: -4px;
  margin-bottom: 2px;
}

.checkpoint-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-2, #94a3b8);
  cursor: pointer;
  user-select: none;
}

.checkpoint-toggle input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent, #e56a4a);
  width: 14px;
  height: 14px;
  margin: 0;
}

.clear-checkpoint-link {
  background: none;
  border: none;
  color: #f87171;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.clear-checkpoint-link:hover {
  opacity: 1;
  color: #ef4444;
}

/* ── Socket & Status indicator badge ───────────────────────────────────── */
#socketBadge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#socketBadge::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: apl-pulse-dot 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP LAYOUT & LIQUID GLASS SIDEBAR (Icon Rail with Spring Auto-Expansion)
   Strictly matched with mtips5s_motions Shell v3
   ═══════════════════════════════════════════════════════════════════════════ */

.app-layout {
  position: fixed;
  inset: 0;
  display: flex;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  background: var(--background);
}

.app-layout[hidden] {
  display: none !important;
}

/* ── Left Sidebar: Modern Fixed-Width macOS / Linear Dark Style ── */
.lq-sidebar,
.app-sidebar {
  position: relative;
  z-index: 40;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  height: 100%;
  background: #0d121f;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  user-select: none;
}

/* Sidebar Brand Header */
.sidebar-brand {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-brand-text strong {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f8fafc;
  line-height: 1.2;
}

.sidebar-brand-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.sidebar-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
  display: inline-block;
  flex-shrink: 0;
}

.sidebar-brand-text small {
  font-size: 11px;
  color: #94a3b8;
}

/* Sidebar CTA button (Tạo ảnh mới) */
.sidebar-cta {
  padding: 12px 12px 6px;
  flex-shrink: 0;
}

.sidebar-cta-btn {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0 14px;
}

.sidebar-cta-btn:hover {
  background: linear-gradient(135deg, #7175f3 0%, #5d55e8 100%);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

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

.sidebar-cta-btn .cta-icon {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.sidebar-cta-btn .cta-label {
  display: inline;
  font-size: 13px;
  font-weight: 600;
}

/* Section Header */
.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  padding: 14px 16px 6px;
  user-select: none;
}

/* Sidebar Navigation Items */
.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-item {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
  box-sizing: border-box;
}

.sidebar-nav-item .nav-icon {
  font-size: 15px;
  line-height: 1;
  width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #64748b;
  transition: color 0.16s ease;
}

.sidebar-nav-item .nav-label {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav-item .sidebar-badge {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-weight: 600;
  margin-left: auto;
  transition: all 0.16s ease;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
}

.sidebar-nav-item:hover .nav-icon {
  color: #cbd5e1;
}

.sidebar-nav-item.active {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.32);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.sidebar-nav-item.active .nav-icon {
  color: #818cf8;
}

.sidebar-nav-item.active .sidebar-badge {
  background: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

/* Quick System Stats Widget in Sidebar */
.sidebar-quick-stats {
  margin: 8px 12px 10px;
  padding: 8px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
}

.sidebar-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sidebar-stat-item .stat-lbl {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 500;
}

.sidebar-stat-item strong {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
}

/* Sidebar Footer (User info & quick actions) */
.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.sidebar-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.18s ease;
}

.sidebar-user-pill:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  font-size: 10.5px;
  color: #94a3b8;
}

.sidebar-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ── Main Canvas Layout ────────────────────────────────────────────────── */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.app-main .ig-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  padding: 0 24px;
  border-radius: 0;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  flex-shrink: 0;
}

.ig-page-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ig-page-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.app-main-content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .lq-sidebar {
    position: fixed;
    inset-y: 0;
    left: 0;
    width: 264px;
    transform: translateX(-100%);
    transition: transform 300ms var(--spring);
    box-shadow: var(--shadow-island-lg);
  }
  .lq-sidebar.mobile-open {
    transform: translateX(0);
  }
}

/* ── Topbar Actions & Navigation Tabs ──────────────────────────────────── */
.top-actions,
.panel-actions,
.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Segmented Tabs (Linear / Apple Liquid Glass style) */
.tabs {
  margin: 18px 0;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  display: inline-flex;
  gap: 3px;
  backdrop-filter: blur(14px);
}

.tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s var(--spring);
  user-select: none;
}

.tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.tab.active {
  background: rgba(94, 106, 210, 0.16);
  border-color: rgba(94, 106, 210, 0.4);
  color: var(--primary-dark);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tab:active {
  transform: scale(0.97);
}

/* ── Tab Pages ─────────────────────────────────────────────────────────── */
.tab-page {
  animation: fadeIn 0.25s var(--spring);
}

.generate-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
}

.dashboard-page,
#sessionsTab {
  display: grid;
  gap: 18px;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.dashboard-grid .ig-table td:first-child {
  max-width: 460px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Stat Cards ────────────────────────────────────────────────────────── */
.stat-card {
  width: 100%;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--glass-edge);
  transition: all 0.2s var(--spring);
  position: relative;
  overflow: hidden;
}

.stat-card:hover,
.stat-card:focus-visible {
  border-color: rgba(94, 106, 210, 0.5);
  background: rgba(94, 106, 210, 0.08);
  transform: translateY(-2px);
  box-shadow: var(--glass-edge), 0 8px 24px rgba(0, 0, 0, 0.45);
}

.stat-card:focus-visible {
  outline: 2px solid rgba(94, 106, 210, 0.35);
  outline-offset: 2px;
}

.stat-card:active {
  transform: scale(0.98);
}

.stat-focus-row {
  background: rgba(94, 106, 210, 0.12) !important;
}

.stat-focus-pulse {
  animation: stat-focus-pulse 900ms ease-out;
}

/* ── Form & Inputs ─────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.manual-prompt-field {
  grid-column: 1 / -1;
}

.manual-prompt-field textarea {
  min-height: 120px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.checkbox-field {
  align-items: center;
  display: flex;
  gap: 10px;
  cursor: pointer;
}

.checkbox-field input {
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
  padding: 0;
  accent-color: var(--primary);
  border-radius: 4px;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-3);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3.5px rgba(94, 106, 210, 0.22);
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 9px 16px;
  white-space: nowrap;
  transition: all 0.18s var(--spring);
  box-sizing: border-box;
}

.btn-primary {
  background: linear-gradient(180deg, #6B76E5 0%, #5E6AD2 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #7883EE 0%, #6B76E5 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), var(--shadow-pill);
  transform: translateY(-1px);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-2);
  color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-secondary:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Progress bar ──────────────────────────────────────────────────────── */
.progress-wrap {
  height: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

#progressBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #5E6AD2, #9AA2F2);
  transition: width 0.25s var(--spring);
  box-shadow: 0 0 10px rgba(94, 106, 210, 0.6);
}

/* ── Status line & text highlights ─────────────────────────────────────── */
.status-line {
  min-height: 18px;
  color: var(--ink-2);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.ok-text { color: var(--color-success) !important; }
.bad-text { color: var(--color-danger) !important; }
.warn-text { color: var(--color-warning) !important; }

.empty {
  color: var(--ink-3);
  text-align: center;
  padding: 32px 16px;
  font-size: 13px;
}

/* ── Tables ────────────────────────────────────────────────────────────── */
.ig-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ig-table th,
.ig-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
}

.ig-table th {
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.015);
}

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

.ig-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

/* ── User & Filters Rows ───────────────────────────────────────────────── */
.user-filter-row,
.user-create-row {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.user-filter-row {
  grid-template-columns: minmax(0, 1fr) 160px 160px;
}

.user-create-row {
  grid-template-columns: minmax(180px, 1.2fr) minmax(140px, .9fr) minmax(130px, .8fr) 120px 120px 92px 112px;
}

/* ── Logs View ─────────────────────────────────────────────────────────── */
.log-list {
  max-height: 540px;
  overflow: auto;
}

.log-entry {
  display: grid;
  grid-template-columns: 72px 120px minmax(0, 1fr) 180px;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  font-size: 12px;
  animation: msg-in 0.2s var(--spring);
}

.log-entry:hover {
  background: rgba(255, 255, 255, 0.02);
}

.log-entry small {
  color: var(--ink-3);
  font-family: var(--font-mono);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* ── Image Results & Thumbnails ────────────────────────────────────────── */
.image-result {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.image-result.compact {
  display: inline-grid;
  grid-template-columns: 64px;
  min-width: 64px;
}

.thumb-button {
  width: 74px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s var(--spring);
}

.thumb-button:hover {
  border-color: rgba(94, 106, 210, 0.6);
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.image-result.compact .thumb-button {
  width: 64px;
}

.result-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.result-meta strong {
  color: var(--ink);
  font-size: 12px;
}

.result-meta span {
  color: var(--ink-3);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-badge {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-3);
  font: 700 10px/1 var(--font-mono);
  vertical-align: text-bottom;
}

.source-badge.extension {
  border-color: rgba(94, 106, 210, 0.4);
  background: rgba(94, 106, 210, 0.12);
  color: var(--primary-dark);
}

.source-badge.cockpit {
  border-color: rgba(242, 201, 76, 0.4);
  background: rgba(242, 201, 76, 0.12);
  color: var(--color-warning);
}

/* ── Modal Dialogs (Preview Modal) ─────────────────────────────────────── */
.image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 0.25s var(--spring);
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.preview-dialog {
  position: relative;
  z-index: 1;
  width: min(1000px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  background: var(--glass-bg-solid);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: var(--glass-edge), var(--shadow-modal);
  overflow: hidden;
  animation: modal-scale-in 0.28s var(--spring);
}

.preview-stage {
  display: grid;
  place-items: center;
  min-height: 300px;
  background: #09090B;
  overflow: auto;
  padding: 16px;
}

.preview-stage img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.preview-path {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font: 11px/1.4 var(--font-mono);
  overflow-wrap: anywhere;
}

/* ── Agent Chat Drawer (Fluid Glass slide-in) ───────────────────────────── */
.ig-chat-drawer {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 45;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(440px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 110px));
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xl);
  background: var(--glass-bg-solid);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: var(--glass-edge), var(--shadow-modal);
  overflow: hidden;
  animation: drawer-slide-in 0.3s var(--spring);
}

.ig-chat-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.ig-chat-head strong {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.agent-tools {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.agent-tool {
  white-space: nowrap;
  cursor: pointer;
  font-size: 11px;
}

.agent-messages {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding: 16px;
}

.agent-message {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  animation: msg-in 0.25s var(--spring);
}

.agent-message.user {
  grid-template-columns: minmax(0, 1fr) 32px;
}

.agent-message.user .agent-avatar {
  grid-column: 2;
  grid-row: 1;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.agent-message.user .agent-bubble {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  border-color: rgba(94, 106, 210, 0.45);
  background: rgba(94, 106, 210, 0.12);
  color: var(--ink);
}

.agent-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(180deg, #6B76E5 0%, #5E6AD2 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-pill);
}

.agent-bubble {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  padding: 11px 14px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.ig-chat-input {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
}

.ig-chat-input textarea {
  min-height: 42px;
  max-height: 120px;
  resize: none;
  border-radius: var(--radius-md);
}

.agent-tool-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.agent-tool-results details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.agent-tool-results summary {
  cursor: pointer;
  padding: 8px 10px;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
}

.agent-tool-results pre {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding: 10px;
  color: var(--ink-2);
  font: 11px/1.45 var(--font-mono);
  background: rgba(0, 0, 0, 0.3);
}

/* ── Toast Notifications Stack ─────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  z-index: 2000;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-2);
  border-left-width: 4px;
  background: var(--glass-bg-solid);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: var(--glass-edge), var(--shadow-island-lg);
  animation: toast-in 0.3s var(--spring);
  transition: all 0.25s var(--spring);
}

.toast-item.toast-leaving {
  opacity: 0;
  transform: translateX(100%) scale(0.95);
}

.toast-item.toast-success { border-left-color: var(--color-success); }
.toast-item.toast-error   { border-left-color: var(--color-danger); }
.toast-item.toast-warning { border-left-color: var(--color-warning); }
.toast-item.toast-info    { border-left-color: var(--primary); }

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-success .toast-icon { background: var(--color-success-light); color: var(--color-success); }
.toast-error   .toast-icon { background: var(--color-danger-light); color: var(--color-danger); }
.toast-warning .toast-icon { background: var(--color-warning-light); color: var(--color-warning); }
.toast-info    .toast-icon { background: var(--primary-light); color: var(--primary-dark); }

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.toast-message {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.4;
  margin-top: 2px;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s ease;
}

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

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Drawer Backdrop ───────────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  animation: fadeIn 0.2s var(--spring);
}

/* ── Responsive adjustments ────────────────────────────────────────────── */
@media (max-width: 980px) {
  .generate-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .log-entry {
    grid-template-columns: 1fr;
  }
  .user-filter-row,
  .user-create-row {
    grid-template-columns: 1fr;
  }
  .ig-chat-drawer {
    inset: 0;
    width: auto;
    height: auto;
    border-radius: 0;
  }
}

/* ── Chrome Profile Scanner & Headless Options ────────────────────────── */
.ig-panel-subtitle {
  font-size: 11px;
  color: var(--text-muted, #8e8e93);
  margin-top: 2px;
  font-weight: 400;
}

.ig-panel-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-scanner-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Chrome Profile Launcher UI (Exact mtips5s_scan_profile Design)
   ═══════════════════════════════════════════════════════════════════════════ */
.cpl-window {
  background-color: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  margin-bottom: 20px;
}

/* Header & Brand */
.cpl-header {
  height: 52px;
  min-height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cpl-header .header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cpl-header .brand-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cpl-header .brand-title {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: -0.2px;
}

.cpl-header .header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-count {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  background: #131b2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 10px;
  border-radius: 9999px;
}

.btn-icon-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  background: #131b2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-text:hover {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.2);
}

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

.btn-icon-text.btn-import-all {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #fff;
  font-weight: 600;
}

.btn-icon-text.btn-import-all:hover:not(:disabled) {
  background: linear-gradient(135deg, #9333ea 0%, #4338ca 100%);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.45);
  border-color: rgba(167, 139, 250, 0.7);
}

.btn-icon-text.btn-import-all:disabled {
  background: #252e3d;
  border-color: transparent;
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.spin-icon {
  animation: spin 0.8s linear infinite;
}

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

/* Search Bar Section */
.search-section {
  padding: 10px 16px;
  background-color: #090d16;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}

.search-icon-prefix {
  position: absolute;
  left: 14px;
  color: #64748b;
  pointer-events: none;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  height: 38px;
  padding: 0 85px 0 38px;
  background-color: #131b2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #f8fafc;
  font-size: 13px;
  outline: none;
  transition: all 0.15s ease;
}

.search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background-color: #162035;
}

.search-input::placeholder {
  color: #64748b;
}

.search-controls {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-kbd {
  font-size: 11px;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  color: #64748b;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
}

.btn-clear-search {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-clear-search:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #f8fafc;
}

/* Filter Dropdown */
.filter-dropdown-container {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-dropdown-icon {
  position: absolute;
  left: 11px;
  color: #64748b;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.filter-select {
  height: 38px;
  padding: 0 28px 0 32px;
  background-color: #131b2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.15s ease;
  min-width: 175px;
}

.filter-select:hover {
  background-color: #1e293b;
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.filter-select option {
  background-color: #131b2e;
  color: #f8fafc;
}

.filter-dropdown-arrow {
  position: absolute;
  right: 12px;
  color: #64748b;
  pointer-events: none;
  font-size: 9px;
}

/* Headless Switch Toggle */
.cpl-headless-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: #131b2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.cpl-headless-toggle:hover {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.2);
}

.cpl-headless-toggle input {
  display: none;
}

.cpl-headless-toggle .toggle-slider {
  width: 30px;
  height: 16px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  position: relative;
  transition: background 0.2s ease;
}

.cpl-headless-toggle .toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.cpl-headless-toggle input:checked + .toggle-slider {
  background: #f59e0b;
}

.cpl-headless-toggle input:checked + .toggle-slider::after {
  transform: translateX(14px);
}

.cpl-headless-toggle .toggle-label {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
}

.cpl-headless-toggle input:checked ~ .toggle-label {
  color: #fbbf24;
  font-weight: 600;
}

/* Main Content Area */
.cpl-table-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #090d16;
}

/* Table Header */
.table-header {
  display: grid;
  grid-template-columns: 56px minmax(160px, 1.2fr) minmax(180px, 1.4fr) 115px 105px 95px 185px;
  align-items: center;
  padding: 8px 16px;
  background: #0d1322;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

.th-sortable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
  padding: 2px 4px;
  border-radius: 4px;
  margin-left: -4px;
}

.th-sortable:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.th-sort-icon {
  display: inline-flex;
  font-size: 9px;
  opacity: 0.35;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.th-sortable:hover .th-sort-icon {
  opacity: 0.75;
}

.th-sortable.is-sorted {
  color: #3b82f6;
}

.th-sortable.is-sorted .th-sort-icon {
  opacity: 1;
  color: #3b82f6;
}

/* Profiles Scrollable List */
.profile-list-viewport {
  min-height: 240px;
  max-height: min(640px, 70vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 8px;
  background-color: #090d16;
}

.profile-row {
  display: grid;
  grid-template-columns: 56px minmax(160px, 1.2fr) minmax(180px, 1.4fr) 115px 105px 95px 185px;
  align-items: center;
  padding: 7px 8px;
  margin-bottom: 2px;
  border-radius: 6px;
  background-color: transparent;
  border: 1px solid transparent;
  transition: background-color 0.1s ease, border-color 0.1s ease;
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 52px;
}

.profile-row:hover {
  background-color: #1e293b;
}

.profile-row.is-selected {
  background-color: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
}

/* Avatar Column */
.col-avatar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  background: #334155;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  text-transform: uppercase;
  overflow: hidden;
}

/* Profile Info Column */
.col-name {
  display: flex;
  flex-direction: column;
  padding-right: 12px;
  overflow: hidden;
}

.profile-primary-name {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.default-pill {
  font-size: 10px;
  font-weight: 600;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.2);
  padding: 1px 6px;
  border-radius: 4px;
}

.profile-gaia-name {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Email Column */
.col-email {
  font-size: 12px;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}

.email-muted {
  color: #64748b;
  font-style: italic;
  font-size: 11px;
}

/* Directory Column */
.col-dir {
  display: flex;
  align-items: center;
}

.dir-pill {
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Size Column */
.col-size {
  display: flex;
  align-items: center;
}

.size-pill {
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.size-pill.size-heavy {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
}

.size-loading {
  font-size: 11px;
  color: #64748b;
  font-style: italic;
}

/* Status Column */
.col-status {
  display: flex;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 9999px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge.status-ready {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.status-badge.status-ready .status-dot {
  background-color: #10b981;
}

.status-badge.status-missing {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.status-badge.status-missing .status-dot {
  background-color: #ef4444;
}

/* Action Column */
.col-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-veo3,
.btn-import-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 600;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #fff;
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-veo3:hover:not(:disabled),
.btn-import-row:hover:not(:disabled) {
  background: linear-gradient(135deg, #9333ea 0%, #4338ca 100%);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.45);
  border-color: rgba(167, 139, 250, 0.7);
  transform: translateY(-1px);
}

.btn-veo3:disabled,
.btn-import-row:disabled {
  background: #252e3d;
  border-color: transparent;
  color: #64748b;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-open:hover:not(:disabled) {
  background: #2563eb;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.btn-open:disabled {
  background: #252e3d;
  color: #64748b;
  cursor: not-allowed;
}

.enter-hint {
  font-size: 10px;
  opacity: 0.75;
}

/* Empty & Loading States */
.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  text-align: center;
  height: 100%;
}

.state-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.7;
}

.state-title {
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 6px;
}

.state-description {
  font-size: 13px;
  color: #94a3b8;
  max-width: 360px;
  margin-bottom: 16px;
}

/* Pagination Bar */
.pagination-bar {
  height: 40px;
  min-height: 40px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #0b101c;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
}

.pagination-info {
  color: #94a3b8;
  font-size: 11px;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-page-nav {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  background: #131b2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-page-nav:hover:not(:disabled) {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-page-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 3px;
}

.btn-page-number {
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-page-number:hover {
  background: #131b2e;
  color: #f8fafc;
}

.btn-page-number.is-active {
  background: #3b82f6;
  color: #fff;
  font-weight: 600;
}

.page-ellipsis {
  padding: 0 3px;
  color: #64748b;
}

.pagination-size {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
}

.page-size-select {
  background: #131b2e;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  outline: none;
  cursor: pointer;
}

.page-size-select:focus {
  border-color: #3b82f6;
}

/* Footer / Status Bar Hints */
.app-footer {
  height: 32px;
  min-height: 32px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #131b2e;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: #64748b;
}

.footer-hints {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-hint-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-kbd {
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  padding: 0 4px;
  color: #94a3b8;
}

/* Manual Account Box & Helpers */
.manual-account-box {
  margin-bottom: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.manual-account-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

