/* ==============================================================
   ÓPTICAS LINKS HUB - PAINEL ADMINISTRATIVO (ADMIN CSS)
   ============================================================== */

:root {
  --admin-bg: #0f172a;
  --admin-sidebar-bg: #1e293b;
  --admin-card-bg: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text-main: #0f172a;
  --admin-text-muted: #64748b;
  --admin-primary: #0284c7;
  --admin-primary-hover: #0369a1;
  --admin-accent: #d4af37;
  
  --whatsapp-color: #25d366;
  --route-color: #2563eb;
  --danger-color: #ef4444;
  --danger-hover: #dc2626;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body.admin-body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background-color: #f1f5f9;
  color: var(--admin-text-main);
  min-height: 100vh;
  display: flex;
}

.admin-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ==================== SIDEBAR ==================== */
.admin-sidebar {
  width: 260px;
  min-width: 70px;
  max-width: 460px;
  flex-shrink: 0;
  background-color: var(--admin-sidebar-bg);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10;
  position: relative;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.brand-info-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.brand-icon {
  font-size: 1.8rem;
  color: #38bdf8;
  flex-shrink: 0;
}

.sidebar-brand h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.brand-tag {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

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

.btn-toggle-sidebar:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Sidebar Recolhida (Collapsed) */
.admin-sidebar.collapsed {
  width: 72px !important;
  min-width: 72px !important;
  padding: 20px 8px;
}

.admin-sidebar.collapsed .brand-text-block,
.admin-sidebar.collapsed .brand-selector-wrapper,
.admin-sidebar.collapsed .nav-item span,
.admin-sidebar.collapsed .sidebar-footer span {
  display: none !important;
}

.admin-sidebar.collapsed .sidebar-brand {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
}

.admin-sidebar.collapsed .brand-info-wrap {
  justify-content: center;
}

.admin-sidebar.collapsed .btn-toggle-sidebar {
  width: 100%;
  height: 28px;
}

.admin-sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px 0;
}

.admin-sidebar.collapsed .nav-item i {
  font-size: 1.25rem;
  margin: 0;
}

.admin-sidebar.collapsed .btn-logout-sidebar,
.admin-sidebar.collapsed .live-preview-link {
  justify-content: center;
  padding: 10px 0;
}

/* Divisores Arrastáveis (Splitters) */
.resizer-divider {
  width: 6px;
  min-width: 6px;
  background: #cbd5e1;
  cursor: col-resize;
  position: relative;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  z-index: 25;
  flex-shrink: 0;
}

.resizer-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 28px;
  background: #94a3b8;
  border-radius: 2px;
}

.resizer-divider:hover,
.resizer-divider.dragging {
  background: var(--admin-primary);
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.4);
}

.resizer-divider:hover::after,
.resizer-divider.dragging::after {
  background: #ffffff;
}

.brand-selector-wrapper {
  margin-bottom: 24px;
}

.brand-selector-wrapper label {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 6px;
}

.brand-select-input {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.brand-select-input:focus {
  border-color: #38bdf8;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: var(--admin-primary);
  color: #fff;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.live-preview-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  text-decoration: none;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.live-preview-link:hover {
  background: #38bdf8;
  color: #0f172a;
}

/* ==================== MAIN CONTENT ==================== */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 32px 60px;
  background: #f8fafc;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-topbar h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.text-muted {
  color: #64748b;
  font-size: 0.85rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.btn-refresh {
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-refresh:hover {
  background: #f1f5f9;
}

/* Tabs */
.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.2s ease;
}

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

/* ==================== TAB 1: ANALYTICS ==================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1300px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

.kpi-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-sm);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.icon-views { background: rgba(56, 189, 248, 0.12); color: #0284c7; }
.icon-clicks { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.icon-wa { background: rgba(37, 211, 102, 0.12); color: #16a34a; }
.icon-route { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.icon-conv { background: rgba(245, 158, 11, 0.12); color: #d97706; }

.kpi-details {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.74rem;
  color: var(--admin-text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
}

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 20px;
}

.chart-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.chart-header {
  margin-bottom: 16px;
}

.chart-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-body {
  height: 240px;
  position: relative;
}

.table-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.table-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.data-table th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--admin-border);
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.badge-action {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-whatsapp { background: rgba(37, 211, 102, 0.15); color: #16a34a; }
.badge-route { background: rgba(37, 99, 235, 0.15); color: #2563eb; }
.badge-site { background: rgba(71, 85, 105, 0.15); color: #475569; }
.badge-pageview { background: #f1f5f9; color: #64748b; }

/* ==================== TAB 2: GERENCIAR LOJAS ==================== */
.tab-action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--admin-border);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.admin-stores-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-store-row {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.admin-store-row:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.admin-store-thumb {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.admin-store-details {
  flex: 1;
}

.admin-store-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.admin-store-address {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.admin-store-links-tags {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.link-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.admin-store-actions {
  display: flex;
  gap: 8px;
}

.btn-edit-store, .btn-delete-store {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-edit-store {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-edit-store:hover {
  background: #e2e8f0;
}

.btn-delete-store {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-delete-store:hover {
  background: var(--danger-color);
  color: #fff;
}

/* ==================== TAB 3: PERSONALIZAR MARCA ==================== */
.form-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  max-width: 780px;
}

.form-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.form-subtitle {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Switches de Visibilidade dos Botões Principais */
.brand-toggles-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 12px 0;
}

@media (max-width: 900px) {
  .brand-toggles-container {
    grid-template-columns: 1fr;
  }
}

.toggle-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--admin-border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.toggle-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.toggle-checkbox {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: #cbd5e1;
  border-radius: 20px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.toggle-checkbox:checked + .toggle-switch {
  background: var(--admin-primary);
}

.toggle-checkbox:checked + .toggle-switch::after {
  transform: translateX(18px);
}

.toggle-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-pink { color: #ec4899; }

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 12px;
  color: #94a3b8;
}

.input-with-icon input {
  padding-left: 36px;
}

.avatar-upload-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
}

.avatar-preview {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--admin-primary);
}

.file-input-hidden {
  display: none;
}

.file-name-label {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 4px;
}

.color-pickers-row {
  display: flex;
  gap: 16px;
}

.color-picker-box {
  background: #f8fafc;
  border: 1px solid var(--admin-border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.color-picker-box label {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

.color-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input-wrapper input[type="color"] {
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
}

/* ==================== TAB 4: QR CODE STUDIO ==================== */
.qrcode-studio-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.qrcode-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qrcode-preview-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.studio-qr-target {
  padding: 14px;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.qr-scan-hint {
  font-size: 0.75rem;
  color: #64748b;
}

/* ==================== LIVE PHONE PREVIEW ==================== */
.admin-preview-panel {
  width: 360px;
  min-width: 280px;
  max-width: 600px;
  flex-shrink: 0;
  background: #0f172a;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
}

.phone-mockup-wrapper {
  width: 300px;
  height: 600px;
  background: #1e293b;
  border: 8px solid #334155;
  border-radius: 42px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.phone-speaker {
  width: 70px;
  height: 5px;
  background: #475569;
  border-radius: 10px;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: #f8fafc;
  overflow: hidden;
}

.phone-screen iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.preview-panel-info {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.preview-panel-info button {
  background: transparent;
  border: none;
  color: #38bdf8;
  cursor: pointer;
}

.text-green { color: #22c55e; }
.text-blue { color: #3b82f6; }
.text-gray { color: #64748b; }
.text-gold { color: #f59e0b; }

/* Buttons & Modals */
.btn-primary-action {
  background: var(--admin-primary);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.btn-primary-action:hover {
  background: var(--admin-primary-hover);
}

.btn-secondary-action {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-action-small {
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-action-small:hover {
  background: #f8fafc;
}

.input-helper-box {
  display: flex;
  gap: 8px;
}

.btn-helper {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-helper:hover {
  background: #e2e8f0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-large {
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Modal Compacto para Cadastro de Loja (Sem Rolagem Lateral/Vertical) */
.modal-compact {
  max-width: 820px;
  max-height: 94vh;
  overflow-y: hidden;
  padding: 20px 24px;
}

.modal-compact-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--admin-border);
}

.modal-compact-header .modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-compact-header .modal-desc {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.modal-form-compact {
  gap: 10px;
  margin-top: 10px;
}

.form-row-compact {
  gap: 12px;
  margin-bottom: 4px;
}

.form-input-compact {
  padding: 7px 10px;
  font-size: 0.82rem;
}

.flex-3 { flex: 3; }

.store-photo-compact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed #cbd5e1;
}

.store-photo-thumb-compact {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #cbd5e1;
  flex-shrink: 0;
}

.upload-controls-compact {
  display: flex;
  gap: 8px;
  flex: 1;
  align-items: center;
}

.modal-form-actions-compact {
  margin-top: 10px;
  padding-top: 10px;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #94a3b8;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

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

.store-photo-upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed #cbd5e1;
}

.store-photo-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.upload-controls {
  flex: 1;
}

.form-input-sm {
  padding: 6px 8px;
  font-size: 0.78rem;
}

.mt-2 { margin-top: 8px; }

/* ==============================================================
   ESTILOS DE AUTENTICAÇÃO, SEGURANÇA E INATIVIDADE
   ============================================================== */

.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 30%, #1e293b 0%, #0d1b2a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 20px;
}

.auth-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 440px;
  padding: 36px 32px;
  animation: authSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(13, 27, 42, 0.08);
  color: var(--admin-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px auto;
}

.auth-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: #64748b;
}

.login-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.login-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.login-alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.auth-form .form-group-password {
  margin-top: 18px;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 48px;
}

.btn-toggle-eye {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 1.15rem;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-toggle-eye:hover {
  color: var(--admin-primary);
  background: #f1f5f9;
}

.btn-block {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-top: 12px;
}

.auth-footer-info {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
  text-align: center;
  font-size: 0.78rem;
  color: #94a3b8;
}

/* Indicador de Inatividade */
.session-timer-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  font-family: monospace;
}

.session-timer-pill.warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

/* Botões de Sair (Logout) */
.btn-logout-sidebar, .btn-logout-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout-sidebar {
  width: 100%;
  justify-content: center;
  margin-bottom: 8px;
}

.btn-logout-sidebar:hover, .btn-logout-topbar:hover {
  background: #fecaca;
  color: #7f1d1d;
  box-shadow: 0 2px 4px rgba(185, 28, 28, 0.15);
}

/* ==============================================================
   TESTE VISUAL AO VIVO & BOTÕES DE TESTAR LINKS
   ============================================================== */

.preview-panel-header {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--admin-border);
}

.preview-panel-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.preview-brand-switcher {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}

.preview-brand-btn {
  flex: 1;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 700;
  font-size: 0.78rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.preview-brand-btn.active {
  background: #ffffff;
  color: var(--admin-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-label-with-test {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.form-label-with-test label {
  margin-bottom: 0;
}

.btn-test-link {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.btn-test-link:hover {
  background: #dbeafe;
  color: #1e40af;
}

