/* ═══════════════════════════════════════════════════════════
   Pincloud — Main Stylesheet
   Inspired by Dohko Technology (dohkotechnology.com.br)
   Font: Outfit | Accent: #ff6a00 | Dark bg: #0f172a
   ═══════════════════════════════════════════════════════════ */

/* ── Google Font ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables (Default: Light Mode - Botconversa style) ──────────────── */
:root {
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-dim: rgba(234, 88, 12, 0.12);
  --primary-gradient: linear-gradient(135deg, #ea580c 0%, #ff7e1f 100%);

  --dohko-blue: #0f52ba;
  --dohko-blue-hover: #0a3d8f;
  --dohko-blue-light: #eff6ff;

  --bg: #f8f9fa;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;

  --border: #cbd5e1;
  --border-focus: #0f52ba;

  --text: #0f172a;
  --text-muted: #334155;
  --text-light: #475569;

  --success: #059669;
  --success-bg: #d1fae5;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --warning: #d97706;
  --warning-bg: #fef3c7;

  --sidebar-width: 260px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.2s ease;

  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --glow: 0 0 15px rgba(234, 88, 12, 0.2);
}

/* ── Dark Mode Override ────────────────────────────────────── */
[data-theme="dark"] {
  --primary: #ff6a00;
  --primary-hover: #ff7e1f;
  --primary-dim: rgba(255, 106, 0, 0.18);
  --primary-gradient: linear-gradient(135deg, #ff6a00 0%, #ff9d6c 100%);

  --dohko-blue: #3b82f6;
  --dohko-blue-hover: #60a5fa;
  --dohko-blue-light: rgba(59, 130, 246, 0.15);

  --bg: #0b1120;
  --bg-sidebar: #0f1729;
  --bg-card: #151f35;
  --bg-card-hover: #1d2a45;
  --bg-input: rgba(255,255,255,0.05);

  --border: rgba(255,255,255,0.12);
  --border-focus: rgba(255,106,0,0.5);

  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #cbd5e1;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);

  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
}

/* ── 2FAuth Theme (Dark Charcoal: #1a1a1a, #242424, #363636) ──── */
[data-theme="2fauth"] {
  --primary: #ea580c;
  --primary-hover: #ff7e1f;
  --primary-dim: rgba(234, 88, 12, 0.18);
  --primary-gradient: linear-gradient(135deg, #ea580c 0%, #ff7e1f 100%);

  --dohko-blue: #60a5fa;
  --dohko-blue-hover: #93c5fd;
  --dohko-blue-light: rgba(96, 165, 250, 0.15);

  --bg: #1a1a1a;
  --bg-sidebar: #242424;
  --bg-card: #242424;
  --bg-card-hover: #363636;
  --bg-input: #1a1a1a;

  --border: #363636;
  --border-focus: #ea580c;

  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --text-light: #d1d5db;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);

  --shadow: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-card: 0 2px 10px rgba(0,0,0,0.4);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
code { font-family: 'Courier New', monospace; }

/* ── Layout ───────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.logo-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
}
.logo-link:hover { color: var(--text); }
.logo-img { width: 32px; height: 32px; flex-shrink: 0; }
.logo-text { font-size: 1.15rem; font-weight: 800; }
.logo-badge {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
.nav-item:hover {
  background: var(--bg-card);
  color: var(--text);
}
.nav-item.active {
  background: var(--primary-dim);
  color: var(--primary);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--primary-gradient);
  border-radius: 0 3px 3px 0;
}
.nav-item svg { flex-shrink: 0; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.admin-avatar { background: linear-gradient(135deg, #6366f1, #818cf8); }
.user-details { flex: 1; min-width: 0; overflow: hidden; }
.user-name { display: block; font-size: 0.85rem; font-weight: 700; color: var(--text); word-wrap: break-word; line-height: 1.25; }
.user-tenant { display: block; font-size: 0.75rem; color: var(--text-muted); }

/* Global code/pre — themed to match light/dark context */
code, pre {
  font-family: 'Courier New', monospace;
  font-size: 0.88rem;
  border-radius: 4px;
}
pre {
  background: #1e293b;
  color: #f8fafc;
  padding: 0.75rem 1rem;
}
pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
/* Inline code — auto-adapts to theme */
:not(pre) > code {
  background: var(--bg-card-hover);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.15em 0.35em;
}


.btn-theme-toggle {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 0.9rem;
}
.btn-theme-toggle:hover { background: var(--border); }
.theme-icon-light, .theme-icon-dark, .theme-icon-2fauth { display: none; }
[data-theme="light"] .theme-icon-light { display: inline-block; }
[data-theme="dark"] .theme-icon-dark { display: inline-block; }
[data-theme="2fauth"] .theme-icon-2fauth { display: inline-block; }

/* ── Settings Theme Selector ──────────────────────────────── */
.theme-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.theme-option-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}
.theme-option-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.theme-option-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.theme-preview-box {
  height: 70px;
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(128,128,128,0.2);
}
.theme-preview-header {
  height: 8px;
  width: 50%;
  border-radius: 4px;
  background: currentColor;
  opacity: 0.4;
}
.theme-preview-cards {
  display: flex;
  gap: 0.4rem;
}
.theme-preview-card-item {
  height: 24px;
  flex: 1;
  border-radius: 4px;
  border: 1px solid rgba(128,128,128,0.2);
}
.theme-option-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.theme-option-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.theme-option-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--primary-dim);
  color: var(--primary);
  display: none;
}
.theme-option-card.active .theme-option-badge {
  display: inline-block;
}

.logout-btn {
  color: var(--text-muted);
  display: flex; align-items: center;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.logout-btn:hover { color: var(--danger); background: var(--danger-bg); }

/* ── Main content ──────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  min-height: 100vh;
  /* No max-width — grid fills available space using auto-fill */
}

/* ── Mobile topbar ────────────────────────────────────────── */
.mobile-topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 56px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  align-items: center;
  gap: 1rem;
}
.mobile-logo {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--text); font-weight: 700; font-size: 1.05rem;
}
.menu-toggle {
  background: none; border: none; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  padding: 0.4rem; border-radius: var(--radius-sm);
}
.menu-toggle:hover { background: var(--bg-card); }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 2px 12px rgba(255,106,0,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255,106,0,0.4);
  color: white;
}
.btn-primary.loading { opacity: 0.7; pointer-events: none; }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-light);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text);
  border-color: rgba(255,255,255,0.15);
}
.btn-full { width: 100%; justify-content: center; }

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}
.btn-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.btn-warning:hover { background: rgba(245,158,11,0.2); color: var(--warning); }
.btn-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.btn-success:hover { background: rgba(34,197,94,0.2); color: var(--success); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.2); color: var(--danger); }
.btn-danger-ghost { background: none; border: none; padding: 0.3rem; border-radius: var(--radius-sm); color: var(--text-muted); }
.btn-danger-ghost:hover { color: var(--danger); background: var(--danger-bg); }
.btn-icon { background: none; border: none; display: inline-flex; align-items: center; padding: 0.35rem; border-radius: var(--radius-sm); color: var(--text-muted); transition: all var(--transition); }
.btn-icon:hover { color: var(--text); background: var(--bg-card-hover); }

/* ── Flash messages ───────────────────────────────────────── */
.flash-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
/* Flash colors — light-mode friendly, high contrast */
.flash-success { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.flash-danger  { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.flash-warning { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; }
.flash-info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }
[data-theme="dark"] .flash-success { background: rgba(5,150,105,0.18);  border-color: rgba(5,150,105,0.4);  color: #34d399; }
[data-theme="dark"] .flash-danger  { background: rgba(220,38,38,0.18);  border-color: rgba(220,38,38,0.4);  color: #f87171; }
[data-theme="dark"] .flash-warning { background: rgba(217,119,6,0.18);  border-color: rgba(217,119,6,0.4);  color: #fcd34d; }
[data-theme="dark"] .flash-info    { background: rgba(59,130,246,0.18); border-color: rgba(59,130,246,0.4); color: #93c5fd; }
.flash-close { background: none; border: none; color: inherit; font-size: 1.2rem; opacity: 0.7; padding: 0 0.2rem; }
.flash-close:hover { opacity: 1; }


/* ── OTP Grid ─────────────────────────────────────────────── */
.otp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
@media (max-width: 640px) {
  .otp-grid { grid-template-columns: 1fr; gap: 0.75rem; }
}
@media (min-width: 1280px) {
  .otp-grid { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
}

/* ── OTP List View ────────────────────────────────────────── */
.otp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.otp-list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.otp-list-row:last-child { border-bottom: none; }
.otp-list-row:hover { background: var(--bg-card-hover); }

.otp-list-row-shared {
  border-left: 3px solid var(--primary);
}

.otp-list-check {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.otp-list-icon {
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--primary-dim);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase;
}
.otp-list-icon-shared {
  background: rgba(234,88,12,0.15);
  color: var(--primary);
}

.otp-list-name {
  flex: 1.8;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.otp-list-tags {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.otp-list-code {
  flex: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.otp-list-code-text {
  font-family: 'Courier New', monospace;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text);
}

.otp-list-timer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.otp-list-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

/* ── View Toggle Group ────────────────────────────────────── */
.view-toggle-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.view-toggle-btn {
  background: var(--bg-card);
  border: none;
  color: var(--text-muted);
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
}
.view-toggle-btn:first-child { border-right: 1px solid var(--border); }
.view-toggle-btn:hover { background: var(--bg-card-hover); color: var(--text); }
.view-toggle-btn.active { background: var(--primary); color: #fff; }

.otp-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.otp-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 18px rgba(234,88,12,0.13), 0 1px 4px rgba(0,0,0,0.06);
}
[data-theme="dark"] .otp-card:hover {
  box-shadow: 0 4px 18px rgba(255,106,0,0.18);
}

/* ── OTP Card Row Layout ──────────────────────────────────── */
.otp-card-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.otp-card-top {
  align-items: center;
}
.otp-card-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.otp-card-title-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.otp-service-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-dim);
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.otp-meta { flex: 1; min-width: 0; }
.otp-service {
  font-weight: 700;
  font-size: 1.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.otp-account {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  margin-top: 0.1rem;
}
.otp-owner {
  font-size: 0.72rem;
  color: var(--dohko-blue);
  font-weight: 600;
}
.otp-actions { display: flex; gap: 0.2rem; flex-shrink: 0; }

/* ── OTP Service Link ─────────────────────────────────────── */
.otp-service-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  text-decoration: none;
}
.otp-service-link:hover { color: var(--primary); text-decoration: underline; }


/* ── Shared Pill ──────────────────────────────────────────── */
.shared-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
  white-space: nowrap;
  flex-shrink: 0;
}
[data-theme="dark"] .shared-pill {
  background: rgba(234,88,12,0.2);
  color: #fb923c;
  border-color: rgba(234,88,12,0.4);
}

/* ── Multi-select Toggle ──────────────────────────────────── */
.multi-select-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
  white-space: nowrap;
}
.multi-select-toggle:hover { border-color: var(--primary); }

/* ── Small Button Variant ─────────────────────────────────── */
.btn-sm {
  padding: 0.35rem 0.65rem !important;
  font-size: 0.82rem !important;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── OTP Code Block ───────────────────────────────────────── */
.otp-code-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0 0.5rem 0;
}
.otp-code {
  font-family: 'Courier New', monospace;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text);
  flex: 1;
}
.btn-copy {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.45rem;
  display: flex;
  flex-shrink: 0;
  transition: all var(--transition);
}
.btn-copy:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-dim); }
.btn-copy.copied { color: var(--success); border-color: var(--success); }

/* ── OTP Progress Row ─────────────────────────────────────── */
.otp-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.otp-progress-ring { position: relative; width: 34px; height: 34px; flex-shrink: 0; }
.circular-chart { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.circle-bg { fill: none; stroke: rgba(0,0,0,0.07); stroke-width: 3; }
[data-theme="dark"] .circle-bg { stroke: rgba(255,255,255,0.08); }
.circle {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke: var(--primary);
  transition: stroke-dasharray 1s linear;
}
.ring-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text);
}
.otp-algo { font-size: 0.71rem; color: var(--text-muted); white-space: nowrap; }

/* ── Copy toast ───────────────────────────────────────────── */
.copy-toast {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  background: var(--success);
  color: white;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(34,197,94,0.3);
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition);
  pointer-events: none;
  z-index: 9999;
}
.copy-toast.show { opacity: 1; transform: none; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-icon { color: rgba(255,255,255,0.1); margin-bottom: 1.5rem; }
.empty-state h2 { font-size: 1.4rem; color: var(--text-light); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.95rem; margin-bottom: 2rem; max-width: 400px; margin-left: auto; margin-right: auto; }
.empty-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Forms ────────────────────────────────────────────────── */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 720px;
}
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.88rem; font-weight: 600; color: var(--text-light); margin-bottom: 0.5rem; }
.form-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 0.9rem; color: var(--text-muted); pointer-events: none; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.93rem;
  padding: 0.65rem 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-wrapper .form-input { padding-left: 2.6rem; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select option { background: var(--bg-card); }
.form-textarea { resize: vertical; min-height: 120px; }
.toggle-pass {
  position: absolute; right: 0.9rem;
  background: none; border: none;
  color: var(--text-muted);
  padding: 0.2rem;
  transition: color var(--transition);
}
.toggle-pass:hover { color: var(--text); }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.4rem; line-height: 1.5; }
.field-error { display: block; font-size: 0.8rem; color: var(--danger); margin-top: 0.3rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem; }
.checkbox { width: 16px; height: 16px; accent-color: var(--primary); }
.check-label { font-size: 0.88rem; color: var(--text-muted); }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; flex-wrap: wrap; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-divider {
  display: flex; align-items: center; gap: 1rem;
  color: var(--text-muted); font-size: 0.82rem;
  margin: 1.25rem 0;
}
.form-divider::before, .form-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── File drop zone ───────────────────────────────────────── */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
}
.file-drop-zone:hover, .file-drop-zone.drag-over { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }
.file-drop-zone.has-file { border-color: var(--success); color: var(--success); }
.file-drop-zone svg { opacity: 0.5; }
.file-drop-zone p { font-size: 0.9rem; font-weight: 500; }
.file-hint { font-size: 0.78rem; }
.file-name { font-size: 0.85rem; font-weight: 600; color: var(--success); }

/* ── Tabs ─────────────────────────────────────────────────── */
.import-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.tab-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.tab-btn.active { background: var(--primary-dim); color: var(--primary); border-color: rgba(255,106,0,0.4); }

/* ── Import info banner ───────────────────────────────────── */
.import-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  font-size: 0.88rem;
  color: #a5b4fc;
  margin-bottom: 1.25rem;
}
.import-info-banner svg { flex-shrink: 0; margin-top: 1px; }

/* ── Settings ─────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.settings-section-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.95rem; font-weight: 700;
  color: var(--text); margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.profile-display { display: flex; align-items: center; gap: 1rem; }
.profile-avatar-large {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary-gradient);
  color: white; font-size: 1.4rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.profile-name { font-weight: 700; font-size: 1.05rem; }
.profile-email { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.1rem; }
.profile-badge { display: inline-block; margin-top: 0.4rem; background: var(--primary-dim); color: var(--primary); font-size: 0.78rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px; }

/* ── Admin table ──────────────────────────────────────────── */
.admin-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.admin-table thead { background: rgba(255,255,255,0.03); }
.admin-table th {
  text-align: left;
  padding: 0.9rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr { transition: background var(--transition); }
.admin-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.admin-table tbody tr.row-inactive { opacity: 0.55; }
.tenant-cell { display: flex; align-items: center; gap: 0.75rem; }
.tenant-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  color: white; font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.text-muted { color: var(--text-muted); }
.action-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.2rem 0.65rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600;
}
.badge-neutral { background: var(--bg-card-hover); color: var(--text-light); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }

.code-pill {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.5rem;
  font-size: 0.8rem;
  color: var(--primary);
}

/* ── Admin stats row ──────────────────────────────────────── */
.admin-stats-row { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.stat-mini {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.25rem;
  display: flex; flex-direction: column;
  min-width: 110px;
}
.stat-mini-num { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.stat-mini-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 90%; max-width: 420px;
  box-shadow: var(--shadow);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.5rem;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; }
.modal-close:hover { color: var(--text); }
.modal-subtitle { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1.25rem; }

/* ── Bulk create layout ───────────────────────────────────── */
.form-grid-import { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.form-grid-import .form-card { max-width: none; }

/* ── Results card ─────────────────────────────────────────── */
.results-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  height: 100%;
}
.results-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem;
}
.results-summary { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.results-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; max-height: 400px; overflow-y: auto; }
.result-item {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.result-ok { background: var(--success-bg); color: var(--success); }
.result-ok svg { color: var(--success); }
.result-err { background: var(--danger-bg); color: var(--danger); }
.result-err svg { color: var(--danger); }
.result-email { display: block; font-weight: 600; }
.result-name { display: block; font-size: 0.78rem; opacity: 0.8; }
.result-err-msg { display: block; font-size: 0.78rem; }

/* ── Help card ────────────────────────────────────────────── */
.help-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.help-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-light); }
.code-block {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  font-size: 0.82rem;
  color: var(--primary);
  margin-bottom: 1rem;
  overflow-x: auto;
  white-space: pre;
}
.help-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.help-list li { font-size: 0.87rem; color: var(--text-muted); padding-left: 1rem; position: relative; }
.help-list li::before { content: '·'; position: absolute; left: 0; color: var(--primary); }

/* ── Auth pages ───────────────────────────────────────────── */
body.auth-body {
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}
.auth-bg {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}
.auth-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,106,0,0.25) 0%, transparent 70%);
  top: -200px; right: -100px;
}
.auth-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  bottom: -150px; left: -100px;
}
.auth-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,106,0,0.1) 0%, transparent 70%);
  top: 50%; left: 30%;
  transform: translate(-50%,-50%);
}

.auth-container {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 2rem;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}
.auth-card .form-label {
  color: var(--text);
  font-weight: 700;
}
.auth-card .check-label {
  color: var(--text);
  font-weight: 600;
}
.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-brand {
  font-size: 1.8rem; font-weight: 800;
  color: var(--primary);
  margin: 0.5rem 0 0.25rem;
}
.auth-tagline { font-size: 0.88rem; color: var(--text-muted); font-weight: 500; }
.admin-login-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  font-size: 0.75rem; font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.auth-error {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--danger-bg);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger);
  font-size: 0.88rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-weight: 600;
}
.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: var(--text-muted); }
.auth-footer strong { color: var(--primary); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-topbar { display: flex; }
  .main-content { margin-left: 0; padding: 1rem; padding-top: 72px; }
  .otp-grid { grid-template-columns: 1fr; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .form-grid-import { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .header-actions { width: 100%; }
}
@media (max-width: 480px) {
  .auth-card { padding: 1.75rem; }
  .otp-code { font-size: 1.6rem; }
}

/* ── Single OTP Hero Card ─────────────────────────────────── */
.single-otp-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 1rem;
}
.single-otp-hero-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(255, 106, 0, 0.15);
}
.single-otp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.otp-service-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--dohko-blue);
  text-decoration: none;
  font-weight: 700;
  transition: color var(--transition);
}
.otp-service-link:hover {
  color: var(--dohko-blue-hover);
  text-decoration: underline;
}

/* ── Theme Switcher Button ────────────────────────────────── */
.btn-theme-toggle {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.btn-theme-toggle:hover {
  background: var(--primary-dim);
}
[data-theme="dark"] .theme-icon-light { display: inline; }
[data-theme="dark"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: inline; }
html:not([data-theme]) .theme-icon-light { display: none; }
html:not([data-theme]) .theme-icon-dark { display: inline; }

/* ── Badge Warnings ───────────────────────────────────────── */
.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.otp-card {
  cursor: pointer;
}
.otp-actions button, .otp-actions form {
  cursor: pointer;
}

/* ── Method Cards (Onboarding / Add Account Options) ─────── */
.add-method-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.add-method-grid.has-3 {
  grid-template-columns: repeat(3, 1fr);
}
.add-method-grid.has-2 {
  grid-template-columns: repeat(2, 1fr);
}

.method-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  width: 100%;
}
.method-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 18px rgba(234,88,12,0.1);
}
.method-card.active {
  border-color: var(--primary);
  background: var(--primary-dim);
  box-shadow: 0 0 0 3px rgba(234,88,12,0.12);
}
.method-card-exclusive.active {
  border-color: #059669;
  background: rgba(5,150,105,0.07);
  box-shadow: 0 0 0 3px rgba(5,150,105,0.12);
}
.method-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.method-card-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  background: var(--primary-dim);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.method-card-radio {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: all var(--transition);
  position: relative;
}
.method-card-radio.active {
  border-color: var(--primary);
  background: var(--primary);
}
.method-card-radio.active::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
}
.method-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.2rem;
}
.method-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.3rem 0;
}
.method-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

/* ── Form helpers ─────────────────────────────────────────── */
.form-optional {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 0.2rem;
}
/* .inline-code inherits from :not(pre)>code global rule above */
.inline-code {
  font-family: monospace;
  font-size: 0.88em;
}

/* ── Info Banner ──────────────────────────────────────────── */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  color: #1e40af;
  padding: 0.65rem 0.9rem;
  font-size: 0.83rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
[data-theme="dark"] .info-banner {
  background: rgba(59,130,246,0.12);
  border-color: rgba(59,130,246,0.3);
  color: #93c5fd;
}

/* ── Advanced Settings Disclosure ─────────────────────────── */
.advanced-settings {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.advanced-settings-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  background: var(--bg-card-hover);
  transition: color var(--transition);
}
.advanced-settings-toggle:hover { color: var(--text); }
.advanced-settings-toggle::-webkit-details-marker { display: none; }
.advanced-settings-body {
  padding: 0.9rem;
  border-top: 1px solid var(--border);
}

/* ── File Drop Zone improvements ──────────────────────────── */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card-hover);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  padding: 1.5rem 1rem;
  text-align: center;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.file-drop-zone:hover, .file-drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-dim);
}
.file-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}
.file-drop-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.file-drop-link { color: var(--primary); text-decoration: underline; }
.file-drop-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}
.file-selected-state {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.file-selected-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.file-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
}
.file-clear-btn:hover { color: var(--danger); }
.file-drop-zone.has-file {
  border-color: var(--success);
  background: rgba(5,150,105,0.06);
}

/* ── Shared OTP Card Highlight ────────────────────────────── */
.otp-card-shared {
  border-left: 3px solid var(--primary) !important;
  background: var(--bg-card) !important;
}

/* ── Bulk Action Bar ──────────────────────────────────────── */
.bulk-action-bar {
  position: sticky;
  top: 0.75rem;
  z-index: 200;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 24px rgba(234,88,12,0.12), 0 2px 8px rgba(0,0,0,0.06);
  animation: bulkBarIn 0.18s cubic-bezier(.2,.8,.3,1);
}
[data-theme="dark"] .bulk-action-bar { background: var(--bg-card); }
@keyframes bulkBarIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }

.bulk-action-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bulk-cancel-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  transition: all var(--transition);
}
.bulk-cancel-btn:hover { color: var(--text); border-color: var(--text-muted); }

.bulk-count-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.bulk-count-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bulk-count-label {
  color: var(--text-muted);
  font-weight: 500;
}

.bulk-select-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bulk-link-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.85;
}
.bulk-link-btn:hover { color: var(--primary); opacity: 1; }

.bulk-divider {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.bulk-action-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.15s;
}

/* ── Checkboxes: hidden by default, shown only in bulk mode ── */
.otp-card-check-wrap,
.otp-list-check {
  display: none;
}
.bulk-mode-active .otp-card-check-wrap,
.bulk-mode-active .otp-list-check {
  display: flex;
  align-items: center;
}

.card-select-check {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── Card selected state (bulk mode) ─────────────────────── */
.card-selected.otp-card {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-dim) !important;
}
.card-selected.otp-list-row {
  background: var(--primary-dim) !important;
}

/* ── In bulk mode, entire card is a selection toggle ─────── */
.bulk-mode-active .otp-card,
.bulk-mode-active .otp-list-row {
  user-select: none;
}

/* ── Domain & Service Tag Badges ──────────────────────────── */
.tag-bitrix { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; font-weight: 700; }
.tag-google { background: #e8f0fe; color: #1a73e8; border: 1px solid #d2e3fc; font-weight: 700; }
.tag-github { background: #f6f8fa; color: #24292e; border: 1px solid #d1d5da; font-weight: 700; }
.tag-aws { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; font-weight: 700; }
.tag-cloudflare { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; font-weight: 700; }
.tag-dohko { background: #ffedd5; color: #ea580c; border: 1px solid #fed7aa; font-weight: 700; }
.tag-domain { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; font-weight: 700; }
.tag-default { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; font-weight: 700; }

[data-theme="dark"] .tag-bitrix { background: rgba(2, 132, 199, 0.2); color: #38bdf8; border-color: rgba(2, 132, 199, 0.4); }
[data-theme="dark"] .tag-google { background: rgba(66, 133, 244, 0.2); color: #60a5fa; border-color: rgba(66, 133, 244, 0.4); }
[data-theme="dark"] .tag-github { background: rgba(255, 255, 255, 0.1); color: #e2e8f0; border-color: rgba(255, 255, 255, 0.2); }
[data-theme="dark"] .tag-aws { background: rgba(217, 119, 6, 0.2); color: #fbbf24; border-color: rgba(217, 119, 6, 0.4); }
[data-theme="dark"] .tag-cloudflare { background: rgba(249, 115, 22, 0.2); color: #fb923c; border-color: rgba(249, 115, 22, 0.4); }
[data-theme="dark"] .tag-dohko { background: rgba(234, 88, 12, 0.2); color: #ff8c3a; border-color: rgba(234, 88, 12, 0.4); }
[data-theme="dark"] .tag-domain { background: rgba(79, 70, 229, 0.2); color: #818cf8; border-color: rgba(79, 70, 229, 0.4); }
[data-theme="dark"] .tag-default { background: rgba(255, 255, 255, 0.08); color: #94a3b8; border-color: rgba(255, 255, 255, 0.15); }

/* ── Help Card & Code Block Styling ──────────────────────── */
.help-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.help-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 1rem 0;
}

.code-block {
  background: var(--bg-secondary);
  color: var(--primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0 0 1.25rem 0;
  overflow-x: auto;
}

.help-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.help-list li {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-list li::before {
  content: "•";
  color: var(--primary);
  font-weight: bold;
}

.help-list code {
  background: var(--bg-secondary);
  color: var(--text);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
}

/* ── Tag Smart Suggestions Dropdown ───────────────────────── */
.tag-suggestions-box {
  margin-top: 0.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem;
  box-shadow: var(--shadow-md);
  max-height: 160px;
  overflow-y: auto;
}

.tag-suggestions-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.tag-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-suggestion-chip:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

/* ── Modal Backdrop & Fixed Positioning ────────────────────── */
.modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999 !important;
  padding: 1rem;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
