/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f1f5f9;
  --surface:      #ffffff;
  --sidebar-bg:   #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-hover:#1e293b;
  --sidebar-active:#6366f1;
  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --primary-light:#eef2ff;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --border:       #e2e8f0;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:    0 4px 12px rgba(0,0,0,.10);

  --pending:      #f59e0b;
  --pending-bg:   #fffbeb;
  --active:       #10b981;
  --active-bg:    #ecfdf5;
  --error:        #ef4444;
  --error-bg:     #fef2f2;
  --processing:   #3b82f6;
  --processing-bg:#eff6ff;
}

html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; border: none; background: none; }
input, select, textarea { font: inherit; }

/* ── Layout ────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 100vh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  border-bottom: 1px solid #1e293b;
}
.sidebar-logo i { color: var(--primary); width: 20px; height: 20px; }

.sidebar-search {
  padding: 12px 14px 4px;
}
.sidebar-search-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  transition: border-color .2s;
}
.sidebar-search-inner:focus-within { border-color: var(--primary); }
.sidebar-search-inner > i,
.sidebar-search-inner > svg {
  width: 15px !important;
  height: 15px !important;
  color: #475569;
  flex-shrink: 0;
  pointer-events: none;
}
.sidebar-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f8fafc;
  padding: 8px 0;
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.sidebar-search input::placeholder { color: #475569; }
.clear-search {
  display: flex;
  align-items: center;
  color: #475569;
  flex-shrink: 0;
}
.clear-search:hover { color: #94a3b8; }
.clear-search i,
.clear-search svg { width: 14px !important; height: 14px !important; }

.filter-group { padding: 16px 14px 8px; border-bottom: 1px solid #1e293b; }
.filter-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #475569;
  margin-bottom: 10px;
}
.filter-title i { width: 14px; height: 14px; }

.filter-options { display: flex; flex-direction: column; gap: 2px; }

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}
.filter-option:hover { background: var(--sidebar-hover); }
.filter-option input[type="checkbox"],
.filter-option input[type="radio"] { accent-color: var(--primary); width: 14px; height: 14px; }
.filter-label { flex: 1; font-size: 13px; color: #cbd5e1; }
.filter-option input:checked ~ .filter-label { color: #f8fafc; font-weight: 600; }
.filter-badge {
  background: #1e293b;
  color: #64748b;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}
.filter-option input:checked ~ .filter-badge { background: var(--primary); color: #fff; }
.filter-empty { font-size: 12px; color: #475569; padding: 4px 8px; }

.filter-verified .filter-label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.filter-verified .filter-label i,
.filter-verified .filter-label svg { width: 14px !important; height: 14px !important; color: #3b82f6; }

.filter-favorite .filter-label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.filter-favorite .filter-label i,
.filter-favorite .filter-label svg { width: 14px !important; height: 14px !important; color: #f59e0b; }

.filter-no-image .filter-label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.filter-no-image .filter-label i,
.filter-no-image .filter-label svg { width: 14px !important; height: 14px !important; color: #ef4444; }

/* Dropdown custom de status */
.status-dd { position: relative; }

.status-dd-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.status-dd-trigger:hover { background: #273449; }
.status-dd.open .status-dd-trigger { border-color: var(--primary); }

.status-dd-label { flex: 1; text-align: left; }
.status-dd-arrow { transition: transform .2s; color: #64748b; }
.status-dd-arrow svg { width: 14px !important; height: 14px !important; }
.status-dd.open .status-dd-arrow { transform: rotate(180deg); }

.status-dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  z-index: 50;
  overflow: hidden;
  padding: 4px;
}
.status-dd.open .status-dd-menu { display: block; }

.status-dd-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  color: #cbd5e1;
  text-align: left;
  background: transparent;
  border-radius: var(--radius-sm);
  transition: background .12s;
}
.status-dd-option:hover { background: #334155; color: #f8fafc; }
.status-dd-option.active { background: var(--primary); color: #fff; }
.status-dd-option span:not(.status-dot) { flex: 1; }
.status-dd-check svg { width: 14px !important; height: 14px !important; }

/* Bolinhas coloridas do status */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}
.status-dot-active     { background: var(--active); box-shadow: 0 0 0 2px rgba(16,185,129,.25); }
.status-dot-pending    { background: var(--pending); box-shadow: 0 0 0 2px rgba(245,158,11,.25); }
.status-dot-processing { background: var(--processing); box-shadow: 0 0 0 2px rgba(59,130,246,.25); }
.status-dot-error      { background: var(--error); box-shadow: 0 0 0 2px rgba(239,68,68,.25); }

.filter-options-scroll {
  max-height: 210px;
  overflow-y: scroll;
  scrollbar-width: none;
}
.filter-options-scroll::-webkit-scrollbar { display: none; }

.filter-search {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0 8px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  padding: 0 10px;
}
.filter-search i,
.filter-search svg { width: 13px !important; height: 13px !important; color: #475569; flex-shrink: 0; pointer-events: none; }
.filter-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 7px 0;
  font-size: 12px;
  outline: none;
}
.filter-search input::placeholder { color: #475569; }

.sidebar-nav { padding: 8px 14px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13px;
  transition: background .15s, color .15s;
}
.nav-item i { width: 16px; height: 16px; }
.nav-item:hover { background: var(--sidebar-hover); color: #f8fafc; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid #1e293b;
}
.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13px;
  transition: background .15s, color .15s;
}
.btn-logout i { width: 15px; height: 15px; }
.btn-logout:hover { background: #1e293b; color: #f87171; }

/* ── Main content ──────────────────────────────────────────────── */
.main {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-info { display: flex; align-items: center; gap: 16px; }
.topbar-count { font-size: 13px; color: var(--text-muted); }
.topbar-count strong { color: var(--text); }
.topbar-pending {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--pending);
  background: var(--pending-bg);
  padding: 4px 10px;
  border-radius: 20px;
}
.topbar-pending i { width: 13px; height: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.btn.btn-icon-only {
  width: 38px;
  padding: 0;
  background: var(--border);
  color: var(--text);
  border-color: transparent;
}
.btn.btn-icon-only:hover { background: #cbd5e1; }
.btn.btn-icon-only i,
.btn.btn-icon-only svg { width: 20px !important; height: 20px !important; }

.settings-menu { position: relative; }
.settings-menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  z-index: 50;
  padding: 4px;
}
.settings-menu.open .settings-menu-panel { display: block; }
.settings-menu-panel form { margin: 0; }
.settings-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s;
  text-decoration: none;
}
.settings-menu-item:hover { background: var(--primary-light); color: var(--primary-dark); }
.settings-menu-item i, .settings-menu-item svg { width: 15px !important; height: 15px !important; flex-shrink: 0; }

/* ── Cards grid ────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  padding: 24px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card { position: relative; }

.card-busy-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(2px);
  border-radius: var(--radius);
  z-index: 10;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}
.card-busy-overlay i,
.card-busy-overlay svg { width: 28px !important; height: 28px !important; }

.card-thumb {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #f8fafc;
  flex-shrink: 0;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.card-thumb-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}
.card-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity .2s;
  backdrop-filter: blur(2px);
}
.card-thumb-overlay i,
.card-thumb-overlay svg { width: 18px !important; height: 18px !important; }
.card-thumb-link:hover .card-thumb-overlay { opacity: 1; }

.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.card-thumb-placeholder i { width: 28px; height: 28px; opacity: .5; }
.placeholder-pending  { background: #fefce8; color: var(--pending); }
.placeholder-pending i { opacity: .6; }
.placeholder-processing { background: #eff6ff; color: var(--processing); }
.placeholder-error    { background: #fef2f2; color: var(--error); }

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.card-domain { font-weight: 700; font-size: 14px; color: var(--text); }
.card-url {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.card-url a { color: var(--primary); transition: opacity .15s; }
.card-url a:hover { opacity: .75; }
.card-url-icon { display: flex; color: #3730a3; opacity: .8; transition: opacity .15s; }
.card-url-icon:hover { opacity: 1; }
.card-url-icon i, .card-url-icon svg { width: 15px !important; height: 15px !important; flex-shrink: 0; }

.card-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  line-height: 1.5;
}
.badge i,
.badge svg { width: 10px !important; height: 10px !important; }

.verify-chip,
.fav-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  color: #cbd5e1;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.verify-chip:hover { background: #dbeafe; color: #3b82f6; }
.verify-chip.is-verified { color: #1d4ed8; }
.verify-chip.is-verified:hover { background: #bfdbfe; }

.fav-chip:hover { background: #fef3c7; color: #f59e0b; }
.fav-chip.is-favorite { color: #f59e0b; }
.fav-chip.is-favorite svg { fill: #f59e0b; }
.fav-chip.is-favorite:hover { background: #fde68a; }

.verify-chip i, .verify-chip svg,
.fav-chip i, .fav-chip svg { width: 16px !important; height: 16px !important; }
.badge-segment { background: var(--primary-light); color: var(--primary-dark); }
.badge-active     { background: var(--active-bg);     color: var(--active); }
.badge-pending    { background: var(--pending-bg);    color: var(--pending); }
.badge-processing { background: var(--processing-bg); color: var(--processing); }
.badge-error      { background: var(--error-bg);      color: var(--error); }

.card-error-msg {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 11px;
  color: var(--error);
  background: var(--error-bg);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}
.card-error-msg i { width: 13px; height: 13px; flex-shrink: 0; margin-top: 1px; }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.card-footer-left,
.card-footer-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.btn-icon i,
.btn-icon svg { width: 16px !important; height: 16px !important; color: #64748b; stroke: #64748b; }
.btn-icon:hover { background: var(--border); color: var(--text); }
.btn-icon:hover svg, .btn-icon:hover i { color: var(--text) !important; stroke: var(--text) !important; }
.btn-danger:hover svg, .btn-danger:hover i { color: var(--error) !important; stroke: var(--error) !important; }
.btn-danger:hover { background: var(--error-bg); color: var(--error); }
.delete-form { display: inline; }
.upload-form { display: inline; }
.upload-form label { cursor: pointer; }

/* Menu de refazer com opções */
.refresh-menu { position: relative; display: inline-block; }
.refresh-menu-options {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 50;
  padding: 4px;
  gap: 2px;
}
.refresh-menu.open .refresh-menu-options { display: flex; }
.refresh-menu-options form { display: inline; }
.refresh-menu-options button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: transparent;
  transition: background .12s, color .12s;
}
.refresh-menu-options button:hover { background: var(--primary-light); color: var(--primary-dark); }
.refresh-menu-options button i,
.refresh-menu-options button svg { width: 15px !important; height: 15px !important; }

/* ── Sentinela de infinite scroll ──────────────────────────────── */
.infinite-sentinel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}
.infinite-sentinel i,
.infinite-sentinel svg { width: 18px !important; height: 18px !important; }

/* ── Empty state ───────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state i { width: 48px; height: 48px; opacity: .3; }
.empty-state p { font-size: 15px; }

/* ── Toast ─────────────────────────────────────────────────────── */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 24px 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
}
.toast i { width: 16px; height: 16px; flex-shrink: 0; }
.toast button { margin-left: auto; color: inherit; opacity: .6; display: flex; }
.toast button:hover { opacity: 1; }
.toast-success { background: var(--active-bg); color: var(--active); }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, opacity .15s, transform .1s;
  white-space: nowrap;
  box-sizing: border-box;
}
.btn i { width: 15px; height: 15px; }
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-full { width: 100%; justify-content: center; }

/* ── Alerts ────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert i { width: 16px; height: 16px; flex-shrink: 0; }
.alert-error { background: var(--error-bg); color: var(--error); }

/* ── Form page ─────────────────────────────────────────────────── */
.form-page {
  padding: 32px 24px;
  display: flex;
  justify-content: center;
}
.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  width: 100%;
  max-width: 560px;
}
.form-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}
.form-title i { width: 22px; height: 22px; color: var(--primary); }
.form-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text); }
.required { color: var(--error); }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 12px;
  transition: border-color .2s, box-shadow .2s;
}
.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
.input-wrap > i,
.input-wrap > svg {
  width: 16px !important;
  height: 16px !important;
  color: var(--text-muted);
  flex-shrink: 0;
  pointer-events: none;
}
.input-wrap input,
.input-wrap select {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  color: var(--text);
  font-size: 14px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
}
.input-wrap input::placeholder { color: #94a3b8; }

.input-wrap-textarea { align-items: flex-start; padding-top: 10px; padding-bottom: 6px; }
.input-wrap-textarea > svg,
.input-wrap-textarea > i { margin-top: 2px; }
.input-wrap textarea {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0 0 4px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  resize: none;
  line-height: 1.6;
  font-family: inherit;
  min-width: 0;
}
.input-wrap textarea::placeholder { color: #94a3b8; }

.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; display: block; }
.field-hint code { background: var(--border); padding: 1px 4px; border-radius: 3px; font-size: 11px; }
.input-wrap select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 20px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── Página de Segmentos ───────────────────────────────────────── */
.seg-page { padding: 24px; max-width: 760px; margin: 0 auto; width: 100%; }

.seg-add-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 20px;
}
.seg-add-form { display: flex; gap: 10px; align-items: stretch; }
.seg-add-form .input-wrap { flex: 1; }

.seg-search-bar { margin-bottom: 14px; }

.seg-list-wrap { display: flex; flex-direction: column; gap: 8px; }

.seg-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 8px 12px;
  transition: box-shadow .15s;
}
.seg-row:hover { box-shadow: var(--shadow-md); }
.seg-row-form { display: flex; align-items: center; gap: 8px; flex: 1; }
.seg-row-input { flex: 1; }

.seg-count {
  min-width: 36px;
  text-align: center;
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.nav-active {
  background: var(--sidebar-hover) !important;
  color: #f8fafc !important;
}

/* ── Login page ────────────────────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}
.login-container { width: 100%; max-width: 400px; padding: 24px; }
.login-box {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  padding: 36px;
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 28px;
}
.login-logo i { width: 26px; height: 26px; color: var(--primary); }
.login-form .form-group { margin-bottom: 18px; }

/* ── Dropdown segmento customizado ────────────────────────────── */
.seg-dropdown { position: relative; }

.seg-trigger {
  cursor: pointer;
  user-select: none;
  justify-content: space-between;
  min-height: 42px;
}
.seg-trigger span { flex: 1; font-size: 14px; color: var(--text); }
.seg-placeholder { color: #94a3b8 !important; }
.seg-arrow { flex-shrink: 0; transition: transform .2s; }
.seg-arrow svg { width: 15px !important; height: 15px !important; color: var(--text-muted); }

.seg-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
  overflow: hidden;
}
.seg-panel.open { display: block; }

.seg-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
}
.seg-search-wrap i,
.seg-search-wrap svg { width: 14px !important; height: 14px !important; color: var(--text-muted); flex-shrink: 0; }
.seg-search-wrap input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 0;
  font-size: 13px;
  color: var(--text);
  background: transparent;
}
.seg-search-wrap input::placeholder { color: #94a3b8; }

.seg-list {
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: none;
}
.seg-list::-webkit-scrollbar { display: none; }

.seg-item {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background .12s;
}
.seg-item:hover { background: var(--primary-light); color: var(--primary-dark); }

.seg-create {
  border-top: 1px solid var(--border);
  padding: 8px;
}
.seg-create button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  transition: background .15s;
}
.seg-create button:hover { background: #ddd6fe; }
.seg-create button i,
.seg-create button svg { width: 14px !important; height: 14px !important; }

/* ── Modal adicionar link ──────────────────────────────────────── */
.add-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.add-modal.open { display: flex; }
.add-modal-inner {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 520px;
  padding: 28px;
}
.add-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.add-modal-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
}
.add-modal-header h2 i,
.add-modal-header h2 svg { width: 20px !important; height: 20px !important; color: var(--primary); }

/* ── Modal screenshot ──────────────────────────────────────────── */
.ss-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 1000;
  flex-direction: column;
}
.ss-modal.open { display: flex; }

.ss-modal-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 1536px;
  max-width: 100%;
  height: 100%;
  margin: 0 auto;
}

.ss-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.6);
  color: #fff;
  z-index: 10;
  transition: background .15s;
}
.ss-close:hover { background: rgba(0,0,0,.9); }
.ss-close i { width: 18px; height: 18px; }

.ss-modal-body {
  flex: 1;
  overflow-y: scroll;
  background: #000;
  scrollbar-width: none;
}
.ss-modal-body::-webkit-scrollbar { display: none; }
.ss-modal-body img { width: 100%; display: block; }

/* ── Spinner ───────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; display: inline-block; }
