/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  background: var(--bg-canvas);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8);
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(119, 48, 229, 0.08) 0%, transparent 70%);
  top: -150px; right: -150px; pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 350px; height: 350px; border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.05) 0%, transparent 70%);
  bottom: -100px; left: -80px; pointer-events: none;
}

.login-card {
  width: 100%; max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 24px;
  padding: var(--sp-10);
  position: relative; z-index: 1;
}
.login-card-wide { max-width: 960px; }

.login-logo {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-8);
}
.login-logo-icon {
  width: 42px; height: 42px; border-radius: var(--r-lg);
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.login-logo-icon svg { width: 21px; height: 21px; }
.login-logo-text { font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }

.login-kicker {
  display: inline-flex; align-items: center;
  min-height: 28px; padding: 0 10px;
  border-radius: var(--r-full);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent-hover);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: var(--sp-4);
}

.login-title {
  font-size: var(--text-2xl); font-weight: 700;
  color: var(--text-primary); letter-spacing: -0.025em;
  margin-bottom: var(--sp-2);
}
.login-subtitle {
  font-size: var(--text-sm); color: var(--text-muted);
  margin-bottom: var(--sp-8);
}

.login-form { display: flex; flex-direction: column; gap: var(--sp-5); }

.login-alert {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  display: flex; align-items: center; gap: var(--sp-2);
}
.login-alert.error {
  background: var(--color-danger-dim);
  border: 1px solid var(--status-inactive-border);
  color: var(--color-danger);
}
.login-alert.success {
  background: var(--status-active-dim);
  border: 1px solid var(--status-active-border);
  color: var(--status-active);
}
.login-alert svg { width: 14px; height: 14px; flex-shrink: 0; }

.alert {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; }

.alert-success {
  background: var(--status-active-dim);
  border: 1px solid var(--status-active-border);
  color: var(--status-active);
}
.alert-danger {
  background: var(--color-danger-dim);
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
}
.alert-warning {
  background: var(--color-warning-dim);
  border: 1px solid var(--color-warning);
  color: var(--color-warning);
}

.login-remember {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--text-sm); color: var(--text-secondary);
  cursor: pointer; user-select: none;
}
.login-remember input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--accent); cursor: pointer;
}

.login-split {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: var(--sp-5); align-items: stretch;
}
.login-panel {
  border-radius: var(--r-xl);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  padding: var(--sp-6);
}
.login-panel-highlight {
  background:
    radial-gradient(circle at top left, rgba(119, 48, 229, 0.08), transparent 34%),
    var(--bg-surface-2);
}

.setup-points { display: flex; flex-direction: column; gap: var(--sp-4); }
.setup-point {
  display: flex; gap: var(--sp-4); padding: var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-faint);
  background: var(--bg-surface-2);
}
.setup-point strong { display: block; color: var(--text-primary); margin-bottom: 3px; }
.setup-point p { font-size: var(--text-sm); color: var(--text-secondary); }
.setup-point-icon {
  width: 38px; height: 38px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-dim); border: 1px solid var(--accent-border);
  color: var(--accent-hover); flex-shrink: 0;
}
.setup-point-icon svg { width: 17px; height: 17px; }

/* ══════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.dashboard-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.dashboard-row.full,
.dashboard-row--single { grid-template-columns: 1fr; }

.dashboard-page-header {
  align-items: flex-end;
  margin-bottom: var(--sp-6);
}

.dashboard-page-intro {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: min(100%, 320px);
  padding-bottom: var(--sp-3);
}

.dashboard-page-intro .page-title {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dashboard-title-divider {
  display: block;
  width: 100%;
  max-width: 320px;
  height: 1px;
  background: linear-gradient(90deg, var(--text-muted) 0%, var(--border-default) 100%);
}

.status-overview {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}
.status-overview-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  transition: border-color var(--t-base);
}
.status-overview-item:hover { border-color: var(--border-default); }

.dashboard-card-header {
  align-items: flex-start;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.dashboard-inline-subtitle {
  margin-top: var(--sp-1);
  margin-bottom: 0;
}

.dashboard-card-filters {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-left: auto;
}

.dashboard-inline-select {
  min-width: 180px;
}

.dashboard-top-list {
  display: flex;
  flex-direction: column;
}

.dashboard-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border-faint);
}

.dashboard-top-row:last-child {
  border-bottom: none;
}

.dashboard-top-main {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
  flex: 1;
}

.dashboard-top-rank {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  color: var(--accent-hover);
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.dashboard-top-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dashboard-top-title-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}

.dashboard-top-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-platform-emoji {
  font-size: 16px;
  line-height: 1;
}

.estrelinha-star {
  color: #f5a623;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.dashboard-top-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.dashboard-top-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.dashboard-top-row.is-loading {
  padding: var(--sp-3) 0;
}

.dashboard-top-row-skeleton {
  width: 100%;
  height: 54px;
  border-radius: var(--r-lg);
  background: var(--bg-surface-2);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-ov-icon {
  width: 34px; height: 34px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.status-ov-icon svg { width: 15px; height: 15px; }

.status-ov-info { flex: 1; min-width: 0; }
.status-ov-count { font-size: var(--text-xl); font-weight: 700; color: var(--text-primary); line-height: 1; }
.status-ov-label { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }

/* ══════════════════════════════════════════
   INFLUENCER PROFILE PAGE
══════════════════════════════════════════ */
.profile-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-6) var(--sp-8);
  margin-bottom: var(--sp-5);
  position: relative; overflow: hidden;
}
.profile-hero::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--color-violet));
}

.profile-hero-inner {
  display: flex; align-items: flex-start; gap: var(--sp-6);
}

.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar-wrap .star-badge {
  position: absolute; bottom: -2px; right: -2px;
  width: 21px; height: 21px;
  background: var(--bg-surface-2); border: 2px solid var(--bg-surface);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.profile-avatar-wrap .star-badge svg { width: 11px; height: 11px; }

.profile-info { flex: 1; min-width: 0; }
.profile-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
}
.profile-info-main {
  min-width: 0;
  flex: 1;
}
.profile-name {
  font-size: var(--text-2xl); font-weight: 700;
  color: var(--text-primary); letter-spacing: -0.025em; line-height: 1.15;
}
.profile-handle { font-size: var(--text-base); color: var(--text-muted); margin-top: var(--sp-1); }
.profile-meta {
  display: flex; align-items: center; gap: var(--sp-3);
  flex-wrap: wrap; margin-top: var(--sp-3);
}

.profile-platform-badge {
}

.profile-platform-badge .platform-badge-label {
  color: var(--text-primary);
}
.profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.profile-action-danger {
  color: var(--color-danger) !important;
}

.profile-stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-4); margin-top: var(--sp-5); padding-top: var(--sp-5);
  border-top: 1px solid var(--border-subtle);
}
.profile-stat { display: flex; flex-direction: column; gap: 2px; }
.profile-stat-value { font-size: var(--text-xl); font-weight: 700; color: var(--text-primary); }
.profile-stat-label { font-size: var(--text-xs); color: var(--text-muted); font-weight: 500; }
.profile-stat-wide { min-width: 0; }
.profile-stat-value-text { font-size: var(--text-md); line-height: 1.35; word-break: break-word; }

.platform-sync-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.platform-sync-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, var(--bg-surface-2), var(--bg-raised));
}

.platform-sync-kicker {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.platform-sync-value {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-top: var(--sp-2);
}

.platform-sync-caption {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--sp-2);
}

.platform-sync-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.platform-sync-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-3);
  border-radius: var(--r-lg);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-faint);
}

.platform-sync-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.platform-sync-text {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.platform-sync-note,
.platform-sync-error {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.platform-sync-note {
  color: var(--text-secondary);
}

.platform-sync-error {
  color: var(--color-danger);
}

.platform-sync-proof {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-faint);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.platform-sync-proof-link {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.platform-sync-proof-link:hover {
  text-decoration: underline;
}

.platform-sync-proof-dl {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color .15s;
}

.platform-sync-proof-dl:hover {
  color: var(--accent);
}

@media (max-width: 900px) {
  .profile-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-actions {
    justify-content: flex-start;
  }
}

/* Tabs */
.tabs {
  display: flex; align-items: center; gap: 2px;
  border-bottom: 1px solid var(--border-subtle); margin-bottom: var(--sp-6);
}
.tab-btn {
  padding: 9px var(--sp-5);
  font-size: var(--text-sm); font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap; display: flex; align-items: center; gap: var(--sp-2);
  cursor: pointer;
}
.tab-btn svg { width: 13px; height: 13px; }
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.is-active { color: var(--text-primary); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.is-active { display: block; }
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--status-inactive); color: #fff;
  border-radius: 999px; font-size: 10px; font-weight: 700;
  line-height: 1; margin-left: 4px;
}

/* Contact grid */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.contact-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface-2); border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
}
.contact-icon {
  width: 30px; height: 30px; border-radius: var(--r-md);
  background: var(--accent-dim); color: var(--accent-hover);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.contact-icon svg { width: 13px; height: 13px; }
.contact-label { font-size: var(--text-xs); color: var(--text-muted); }
.contact-value { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
.contact-value a { color: var(--accent-hover); }

/* ══════════════════════════════════════════
   NOTES PAGE
══════════════════════════════════════════ */
.note-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-5) var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-4);
  transition: border-color var(--t-base);
  position: relative;
}
.note-card:hover { border-color: var(--border-default); }
.note-card.is-archived { opacity: 0.5; }
.note-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4);
}
.note-card-title { font-size: var(--text-base); font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.note-card-body { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.75; white-space: pre-wrap; }
.note-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--sp-3); border-top: 1px solid var(--border-faint);
}
.note-meta { font-size: var(--text-xs); color: var(--text-muted); display: flex; align-items: center; gap: var(--sp-3); }

/* ══════════════════════════════════════════
   BOT PAGE
══════════════════════════════════════════ */
.bot-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--sp-5); margin-bottom: var(--sp-5);
}
.bot-feature-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.bot-feature-item {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-lg);
}
.bot-feature-icon {
  width: 26px; height: 26px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bot-feature-icon svg { width: 12px; height: 12px; }
.bot-feature-icon.ok { background: var(--status-active-dim); color: var(--status-active); }
.bot-feature-icon.no { background: var(--status-inactive-dim); color: var(--color-danger); }
.bot-feature-text { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.5; }

.edge-case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.edge-case-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl); padding: var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-4);
  transition: border-color var(--t-base);
}
.edge-case-card:hover { border-color: var(--border-default); }
.edge-case-icon {
  width: 38px; height: 38px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.edge-case-icon svg { width: 17px; height: 17px; }
.edge-case-title  { font-size: var(--text-base); font-weight: 600; color: var(--text-primary); }
.edge-case-desc   { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.6; }
.edge-case-solution {
  padding: var(--sp-3); background: var(--bg-surface-2);
  border-radius: var(--r-md); font-size: var(--text-xs);
  color: var(--text-secondary); border-left: 2px solid var(--accent); line-height: 1.6;
}

/* ══════════════════════════════════════════
   DRIVE PAGE
══════════════════════════════════════════ */
.drive-folder {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg); cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.drive-folder:hover { background: var(--bg-surface-2); border-color: var(--border-subtle); }
.drive-folder-icon { color: var(--color-amber); }
.drive-folder-icon svg { width: 17px; height: 17px; }
.drive-folder-name { font-size: var(--text-sm); color: var(--text-primary); font-weight: 500; }

.drive-files-stack { display: flex; flex-direction: column; gap: var(--sp-2); }

.drive-file {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border-subtle); border-radius: var(--r-lg);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.drive-file:hover { background: var(--bg-surface-2); border-color: var(--border-default); }
.drive-file-icon { color: var(--color-sky); flex-shrink: 0; }
.drive-file-icon svg { width: 17px; height: 17px; }
.drive-file-info { flex: 1; min-width: 0; }
.drive-file-name { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
.drive-file-meta { font-size: var(--text-xs); color: var(--text-muted); margin-top: 1px; }
.drive-file-actions { display: flex; align-items: center; gap: var(--sp-2); opacity: 0; transition: opacity var(--t-fast); }
.drive-file:hover .drive-file-actions { opacity: 1; }

/* ══════════════════════════════════════════
   LOGS PAGE
══════════════════════════════════════════ */
.log-row {
  display: flex; align-items: flex-start; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-faint);
  transition: background var(--t-fast);
}
.log-row:hover { background: var(--bg-surface-2); }
.log-action-badge {
  padding: 2px 8px; border-radius: var(--r-sm);
  font-size: var(--text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap; flex-shrink: 0;
  min-width: 76px; text-align: center;
}
.log-action-create  { background: var(--status-active-dim);   color: var(--status-active); }
.log-action-update  { background: var(--accent-dim);          color: var(--accent-hover); }
.log-action-delete  { background: var(--status-inactive-dim); color: var(--color-danger); }
.log-action-archive { background: var(--status-archived-dim); color: var(--status-archived); }
.log-action-restore { background: var(--status-trusted-dim);  color: var(--status-trusted); }
.log-action-login   { background: var(--accent-dim);          color: var(--accent-hover); }
.log-action-logout  { background: var(--bg-surface-3);        color: var(--text-secondary); }
.log-action-upload  { background: var(--color-info-dim);      color: var(--color-info); }
.log-action-success { background: var(--status-active-dim);   color: var(--status-active); }
.log-action-failed  { background: var(--status-inactive-dim); color: var(--color-danger); }
.log-action-pending { background: var(--status-irregular-dim);color: var(--status-irregular); }

.log-content { flex: 1; min-width: 0; }
.log-desc     { font-size: var(--text-sm); color: var(--text-secondary); }
.log-inf-link { color: var(--accent-hover); font-weight: 500; }
.log-meta     { font-size: var(--text-xs); color: var(--text-muted); margin-top: 3px; display: flex; align-items: center; gap: var(--sp-3); }

/* ══════════════════════════════════════════
   SETTINGS PAGE
══════════════════════════════════════════ */
.settings-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  overflow: hidden; margin-bottom: var(--sp-5);
}
.settings-section-header {
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: var(--sp-3);
}
.settings-section-title {
  font-size: var(--text-base); font-weight: 600; color: var(--text-primary);
}
.settings-section-desc {
  font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-6); padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--border-faint);
  transition: background var(--t-fast);
}
.settings-row:last-child { border-bottom: none; }
.settings-row:hover { background: var(--bg-surface-2); }
.settings-row-info { flex: 1; min-width: 0; }
.settings-row-label { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
.settings-row-desc  { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.settings-row-control { flex-shrink: 0; }

.config-form { display: flex; flex-direction: column; gap: var(--sp-5); }
.config-form-actions {
  display: flex; justify-content: flex-end;
  padding-top: var(--sp-3); border-top: 1px solid var(--border-faint);
}

.config-data-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.config-data-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg);
  background: var(--bg-surface-2); border: 1px solid var(--border-faint);
}
.config-data-row span {
  font-size: var(--text-xs); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
}
.config-data-row strong {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 600;
}

/* ══════════════════════════════════════════
   DRIVE
══════════════════════════════════════════ */
.drive-summary-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-3) var(--sp-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  color: var(--text-muted);
  flex-wrap: wrap;
}
.drive-summary-bar i, .drive-summary-bar svg { width: 14px; height: 14px; }
.drive-summary-bar span { display: inline-flex; align-items: center; gap: var(--sp-2); }
.drive-summary-bar strong { color: var(--text-primary); }

/* GEO accordion */
.drive-geo-group { padding: 0; overflow: hidden; }
.drive-geo-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-6);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  transition: background var(--t-fast);
  text-align: left;
}
.drive-geo-header:hover { background: var(--bg-surface-2); }
.drive-geo-title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 600;
  font-size: var(--text-base);
}
.drive-geo-title i, .drive-geo-title svg { width: 16px; height: 16px; color: var(--color-amber); }
.drive-geo-chevron { width: 16px; height: 16px; color: var(--text-muted); transition: transform var(--t-base); }

.drive-geo-body {
  display: none;
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-4) var(--sp-6) var(--sp-5);
}
.drive-geo-group.is-open .drive-geo-body { display: block; }
.drive-geo-group.is-open .drive-geo-chevron { transform: rotate(180deg); }

/* Month section */
.drive-month-section { margin-bottom: var(--sp-5); }
.drive-month-section:last-child { margin-bottom: 0; }
.drive-month-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}
.drive-month-label i, .drive-month-label svg { width: 12px; height: 12px; }

/* File row */
.drive-file-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.drive-file {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.drive-file:hover { border-color: var(--border-default); background: var(--bg-surface-3); }
.drive-file-icon {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.drive-file-icon i, .drive-file-icon svg { width: 15px; height: 15px; color: var(--color-violet); }
.drive-file-info { flex: 1; min-width: 0; }
.drive-file-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  display: flex; align-items: center; gap: var(--sp-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drive-file-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drive-file-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

.storage-upload-grid { align-items: start; }
.storage-upload-grid .form-field { justify-content: flex-start; }
.storage-upload-grid .custom-select { display: flex !important; width: 100% !important; }
.storage-upload-grid .custom-select-trigger { width: 100% !important; height: 40px; }

/* Upload zone */
.drive-upload-zone {
  border: 2px dashed var(--border-default);
  border-radius: var(--r-lg);
  padding: var(--sp-8) var(--sp-6);
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: var(--sp-1);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.drive-upload-zone:hover, .drive-upload-zone.is-drag {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.btn-inline-link {
  background: none; border: none; padding: 0;
  color: var(--accent); cursor: pointer;
  font-size: inherit; text-decoration: underline;
}
.btn-inline-link:hover { color: var(--accent-hover); }

/* Spinner animation */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; }

/* ══════════════════════════════════════════
   CHATBOT PAGE
══════════════════════════════════════════ */
.chatbot-page {
  display: flex !important;
  flex-direction: column !important;
  height: calc(100vh - var(--nav-height));
  width: 100%;
  max-width: calc(var(--content-max) + (var(--content-padding) * 2)) !important;
  margin: 0 auto !important;
  padding: var(--sp-6) var(--content-padding) 0 !important;
  overflow: hidden;
  gap: var(--sp-4);
}

/* ── Left sidebar ── */
.chatbot-sidebar {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  overflow: hidden;
}

/* Profile card */
.chatbot-profile-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.chatbot-profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.chatbot-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  object-fit: cover;
  background: var(--accent-dim);
  border: 2px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.chatbot-profile-avatar--fallback {
  color: var(--accent);
  font-size: 22px;
}
.chatbot-avatar-upload-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
}
.chatbot-avatar-upload-btn svg { width: 11px; height: 11px; }
.chatbot-profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chatbot-profile-name-input {
  font-size: var(--text-sm);
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  padding: 3px 8px;
  color: var(--text-primary);
  width: 100%;
}
.chatbot-profile-name-input:focus { outline: none; border-color: var(--accent); }
.chatbot-profile-name { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.chatbot-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Search */
.chatbot-search-wrap {
  position: relative;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.chatbot-search-icon {
  position: absolute;
  left: calc(var(--sp-4) + 10px);
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}
.chatbot-search-input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  background: var(--bg-surface-2);
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.chatbot-search-input:focus { outline: none; border-color: var(--accent); }

/* Conversations list */
.chatbot-conv-list {
  flex: 1;
  overflow-y: auto;
}
.chatbot-empty-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-10) var(--sp-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-align: center;
}
.chatbot-empty-list svg { width: 32px; height: 32px; opacity: 0.4; }

.chatbot-conv-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px var(--sp-4);
  cursor: pointer;
  border-bottom: 1px solid var(--border-faint);
  transition: background var(--t-fast);
  position: relative;
}
.chatbot-conv-item:hover { background: var(--bg-surface-2); }
.chatbot-conv-item.is-active { background: var(--accent-dim); }
.chatbot-conv-item.has-unread .conv-name { font-weight: 700; }
.chatbot-conv-item.has-unread .conv-preview { font-weight: 500; color: var(--text-primary); }

.conv-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  overflow: hidden;
}
.conv-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.conv-avatar-fallback {
  width: 100%;
  height: 100%;
  background: var(--bg-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.conv-avatar-fallback svg { width: 18px; height: 18px; }
.conv-body { flex: 1; min-width: 0; }
.conv-header-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.conv-name { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: var(--text-xs); color: var(--text-muted); flex-shrink: 0; }
.conv-preview { font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-unread-badge {
  min-width: 18px;
  height: 18px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

/* ── Chat main area ── */
.chatbot-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-canvas);
}
.chatbot-empty-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  color: var(--text-muted);
  text-align: center;
  padding: var(--sp-8);
}
.chatbot-empty-chat svg { width: 56px; height: 56px; opacity: 0.3; }
.chatbot-empty-chat h3 { color: var(--text-primary); }
.chatbot-empty-chat p { font-size: var(--text-sm); max-width: 340px; }

.chatbot-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Chat header */
.chatbot-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
}
.chatbot-window-identity { display: flex; align-items: center; gap: var(--sp-3); }
.chatbot-window-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  overflow: hidden;
  flex-shrink: 0;
}
.chatbot-window-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.chatbot-window-name { font-size: var(--text-base); font-weight: 600; color: var(--text-primary); }
.chatbot-window-meta { font-size: var(--text-xs); color: var(--text-muted); }

/* Messages area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-5) var(--sp-5) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.chatbot-no-msgs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  margin: auto;
  color: var(--text-muted);
  font-size: var(--text-sm);
  opacity: 0.6;
}
.chatbot-no-msgs svg { width: 32px; height: 32px; }

.chat-msg { display: flex; flex-direction: column; max-width: 70%; }
.chat-msg--in { align-self: flex-start; }
.chat-msg--out { align-self: flex-end; align-items: flex-end; }

.chat-msg-bubble {
  padding: 9px 14px;
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg--in .chat-msg-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: var(--r-xs);
  color: var(--text-primary);
}
.chat-msg--out .chat-msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: var(--r-xs);
}
.chat-msg-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  padding: 0 4px;
}

/* Input bar */
.chatbot-input-bar {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
}
.chatbot-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 10px 14px;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 42px;
  max-height: 120px;
  transition: border-color var(--t-fast);
}
.chatbot-input:focus { outline: none; border-color: var(--accent); }
.chatbot-send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t-fast);
}
.chatbot-send-btn:hover { background: var(--accent-hover); }
.chatbot-send-btn svg { width: 18px; height: 18px; }

/* ══════════════════════════════════════════
   NOTIFICATION BELL
══════════════════════════════════════════ */
.notif-bell-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}
.notif-bell-btn:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.notif-bell-btn svg { width: 16px; height: 16px; }
.notif-bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  border-radius: var(--r-full);
  background: var(--color-rose);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
  border: 2px solid var(--bg-topbar);
}

/* Dropdown */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: var(--bg-dropdown);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  z-index: 200;
  overflow: hidden;
  display: none;
}
.notif-dropdown.is-open { display: block; }
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
}
.notif-dropdown-title { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.notif-mark-all-btn {
  font-size: var(--text-xs);
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.notif-mark-all-btn:hover { color: var(--accent-hover); }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-faint);
  cursor: pointer;
  transition: background var(--t-fast);
  text-decoration: none;
}
.notif-item:hover { background: var(--bg-surface-2); }
.notif-item.is-unread { background: var(--accent-dim); }
.notif-item.is-unread:hover { background: var(--accent-muted); }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-text { font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.notif-item-time { font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.notif-empty {
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.notif-bell-wrap { position: relative; }

/* ══════════════════════════════════════════
   DRIVE VIEW (CARDS)
══════════════════════════════════════════ */
.drive-view-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.drive-view-header .table-header-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
}
.drive-view-header .table-count {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.drive-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--sp-4);
}

.drive-view-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  box-shadow: var(--shadow-xs);
}
html[data-theme="dark"] .drive-view-card {
  background: var(--bg-surface-2);
  border-color: var(--border-default);
}
.drive-view-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-sm);
}
html[data-theme="dark"] .drive-view-card:hover {
  border-color: var(--border-strong);
}

.drive-view-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}

.drive-view-card-file {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
}
html[data-theme="dark"] .drive-view-card-file {
  background: var(--bg-surface-3);
  border-color: var(--border-default);
}

.drive-view-file-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.drive-view-file-icon i, .drive-view-file-icon svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.drive-view-file-info {
  flex: 1;
  min-width: 0;
}

.drive-view-file-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drive-view-file-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.drive-view-file-actions {
  flex-shrink: 0;
}

.drive-view-card-footer {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-faint);
}

.drive-view-dates {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drive-view-date-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.drive-view-date-item i, .drive-view-date-item svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.drive-view-last-msg {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-surface-2);
  border-radius: var(--r-md);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}
.drive-view-last-msg i, .drive-view-last-msg svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-muted);
}

.drive-filter-slot {
  min-width: 160px;
}
.drive-filter-slot .custom-select {
  width: 100%;
}

.drive-view-filters-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.inf-row-identity {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.inf-row-identity .avatar {
  flex-shrink: 0;
}
.inf-row-handle {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .drive-view-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════
   DRIVE VIEW — CARDS REDESIGN
══════════════════════════════════════════ */

.drive-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-4);
}

.dv-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  box-shadow: var(--shadow-xs);
}
html[data-theme="dark"] .dv-card {
  background: var(--bg-surface-2);
  border-color: var(--border-default);
}
.dv-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* Header */
.dv-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}
.dv-influencer {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  min-width: 0;
}
.dv-influencer-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.dv-influencer-heading {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}
.dv-influencer-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dv-platform-inline {
  flex-shrink: 0;
}
.dv-influencer-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.dv-card-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
html[data-theme="dark"] .dv-card-count {
  background: var(--bg-surface-3);
  border-color: var(--border-default);
}
.dv-file-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* File row */
.dv-file-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
}

.dv-file-row-body {
  flex: 1;
  min-width: 0;
}
html[data-theme="dark"] .dv-file-row {
  background: var(--bg-surface-3);
  border-color: var(--border-default);
}

.dv-file-icon-wrap {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dv-file-icon-wrap svg,
.dv-file-icon-wrap i {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.dv-file-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dv-file-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dv-file-info {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.dv-file-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}
.dv-file-actions .dropdown {
  display: inline-flex;
}
.dv-file-actions .dropdown-menu {
  min-width: 170px;
}

.dv-recent-details {
  border-top: 1px solid var(--border-faint);
  padding-top: var(--sp-3);
}
.dv-recent-summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  list-style: none;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
}
.dv-recent-summary::-webkit-details-marker {
  display: none;
}
.dv-recent-summary::after {
  content: '+';
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.dv-recent-details[open] .dv-recent-summary::after {
  content: '-';
}
.dv-recent-summary-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 6px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
}
html[data-theme="dark"] .dv-recent-summary::after,
html[data-theme="dark"] .dv-recent-summary-count {
  background: var(--bg-surface-3);
  border-color: var(--border-default);
}
.dv-recent-list {
  margin-top: var(--sp-3);
}

.dv-card-empty {
  margin: 0;
  padding: var(--sp-3);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--r-lg);
  color: var(--text-muted);
  font-size: var(--text-sm);
  background: var(--bg-surface-2);
}

/* Footer */
.dv-card-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-faint);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.dv-card-footer svg,
.dv-card-footer i {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* ── Preview Modal ───────────────────────── */
.dv-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}
.dv-preview-backdrop.is-open {
  opacity: 1;
  pointer-events: all;
}

.dv-preview-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transform: scale(0.96);
  transition: transform var(--t-base);
}
html[data-theme="dark"] .dv-preview-modal {
  background: var(--bg-surface-2);
}
.dv-preview-backdrop.is-open .dv-preview-modal {
  transform: scale(1);
}

.dv-preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.dv-preview-modal-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dv-preview-modal-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.dv-preview-modal-body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-canvas);
  min-height: 300px;
}

.dv-preview-img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  display: block;
  border-radius: var(--r-md);
}

.dv-preview-video {
  max-width: 100%;
  width: 100%;
  max-height: 76vh;
  display: block;
  object-fit: contain;
  border-radius: var(--r-md);
  background: #000;
}

.dv-preview-iframe {
  width: 100%;
  height: 76vh;
  border: none;
  display: block;
}

@media (max-width: 768px) {
  .drive-view-grid { grid-template-columns: 1fr; }
  .dv-card-header { flex-direction: column; }
  .dv-card-count { align-self: flex-start; }
  .dv-influencer-heading { width: 100%; }
  .dv-file-row { align-items: flex-start; }
  .dv-file-actions { margin-left: 0; }
  .dv-preview-modal { max-height: 95vh; }
  .dv-preview-img { max-height: 70vh; }
  .dv-preview-video { max-height: 70vh; }
  .dv-preview-iframe { height: 70vh; }
}

.theme-toggle[hidden] { display: none !important; }
