/* ═══════════════════════════════════════════════
   Shop Afiliados – Admin CSS
   ═══════════════════════════════════════════════ */

:root {
  --sidebar-width: 230px;
  --sidebar-bg: #111418;
  --sidebar-border: #2a2d35;
  --topbar-h: 56px;
  --body-bg: #f0f2f5;
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --text-body: #1f2937;
  --text-muted: #6b7280;

  /* Lojas */
  --ae-color:  #e52e04;
  --sp-color:  #ee4d2d;
  --ml-color:  #3483fa;
  --kb-color:  #e95420;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; }
body { background: var(--body-bg); color: var(--text-body); font-family: 'Segoe UI', system-ui, sans-serif; }

/* ─── Login ─── */
.login-body { background: linear-gradient(135deg, #111418 0%, #1e2128 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrapper { width: 100%; max-width: 380px; padding: 1rem; }
.login-card { background: #1a1d23; border: 1px solid #2a2d35; border-radius: 1rem; padding: 2.5rem 2rem; color: #fff; }
.login-logo { text-align: center; margin-bottom: 1.5rem; }
.login-card .form-control { color: #fff !important; }
.login-card .form-control::placeholder { color: #6b7280; }
.login-card .form-control:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }

/* ─── Layout ─── */
.layout-wrapper { display: flex; min-height: 100vh; }

/* ─── Sidebar ─── */
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  min-height: 100vh;
  transition: width .25s ease;
  overflow: hidden;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 1rem 1rem .9rem;
  border-bottom: 1px solid var(--sidebar-border);
  white-space: nowrap;
}
.brand-text { color: #fff; font-weight: 700; font-size: 1rem; }
.sidebar-menu { list-style: none; margin: 0; padding: .5rem; }
.sidebar-menu li { margin-bottom: 2px; }
.sidebar-menu a {
  display: flex; align-items: center; gap: .6rem;
  color: #9ca3af; font-size: .875rem; padding: .5rem .75rem;
  border-radius: .5rem; text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.sidebar-menu a:hover { background: #1e2128; color: #fff; }
.sidebar-menu a.active { background: #1e2128; color: #fff; font-weight: 600; }
.sidebar-menu a.text-danger-link { color: #f87171 !important; }
.sidebar-menu a.text-danger-link:hover { background: rgba(239,68,68,.1); }
.menu-section { font-size: .65rem; font-weight: 700; letter-spacing: .08em; color: #4b5563; padding: .75rem .75rem .25rem; text-transform: uppercase; }

/* Store dots */
.store-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.store-dot.aliexpress   { background: var(--ae-color); }
.store-dot.shopee       { background: var(--sp-color); }
.store-dot.mercadolivre { background: var(--ml-color); }
.store-dot.kabum        { background: var(--kb-color); }

/* Collapsed sidebar */
#sidebar.collapsed { width: 56px; min-width: 56px; }
#sidebar.collapsed .brand-text,
#sidebar.collapsed .sidebar-menu a span,
#sidebar.collapsed .menu-section { display: none; }
#sidebar.collapsed .sidebar-menu a { justify-content: center; padding: .6rem 0; }
#sidebar.collapsed .store-dot { display: none; }

/* ─── Main Content ─── */
#main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ─── Topbar ─── */
.topbar {
  height: var(--topbar-h); background: #fff;
  border-bottom: 1px solid var(--card-border);
  display: flex; align-items: center; padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 100;
  gap: 1rem;
}
.page-title { font-weight: 600; font-size: 1.05rem; }

/* ─── Content Area ─── */
.content-area { padding: 1.25rem 1.5rem; flex: 1; }

/* ─── Cards ─── */
.card-panel { border: 1px solid var(--card-border); border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card-panel .card-header {
  background: #f9fafb; border-bottom: 1px solid var(--card-border);
  padding: .75rem 1rem; border-radius: .75rem .75rem 0 0;
  font-size: .9rem;
}
.card-panel .card-body { padding: 1rem; }
.card-panel .card-footer { background: #f9fafb; border-top: 1px solid var(--card-border); padding: .6rem 1rem; }

/* Dark card header */
.table-header-dark th {
  background: #f3f4f6; color: #374151;
  font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--card-border) !important;
  padding: .5rem .75rem;
}

/* ─── Stat Cards ─── */
.stat-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: .75rem; padding: 1.1rem; display: flex; align-items: center; gap: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat-icon { width: 52px; height: 52px; border-radius: .6rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: .15rem; }

/* ─── Store Cards (por loja) ─── */
.store-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: .75rem; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); transition: transform .15s, box-shadow .15s; }
.store-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.store-count { font-size: .8rem; color: var(--text-muted); }

/* ─── Store Badges ─── */
.store-badge { display: inline-block; padding: .25em .6em; border-radius: .4rem; font-size: .72rem; font-weight: 700; color: #fff; }
.store-aliexpress   { background: var(--ae-color); }
.store-shopee       { background: var(--sp-color); }
.store-mercadolivre { background: var(--ml-color); }
.store-kabum        { background: var(--kb-color); }

/* ─── Soft bg helpers ─── */
.bg-primary-soft { background: #eff6ff; }
.bg-success-soft { background: #f0fdf4; }
.bg-warning-soft { background: #fffbeb; }
.bg-info-soft    { background: #f0f9ff; }
.bg-danger-soft  { background: #fef2f2; }

/* ─── Thumbnails ─── */
.thumb-xs { width: 36px; height: 36px; object-fit: cover; }
.thumb-sm { width: 44px; height: 44px; object-fit: cover; }

/* ─── Forms ─── */
.required-label::after { content: ' *'; color: #ef4444; }
.form-control:focus, .form-select:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }

/* Alert hint por loja */
.alert-orange { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }

/* ─── Tables ─── */
.table { --bs-table-hover-bg: #f9fafb; font-size: .875rem; }
.table td, .table th { border-color: var(--card-border); vertical-align: middle; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  #sidebar { position: fixed; left: 0; top: 0; z-index: 1000; width: 56px; min-width: 56px; }
  #sidebar .brand-text, #sidebar .menu-section, #sidebar .sidebar-menu a span { display: none; }
  #sidebar .sidebar-menu a { justify-content: center; }
  #sidebar .store-dot { display: none; }
  #sidebar.mobile-open { width: var(--sidebar-width); }
  #sidebar.mobile-open .brand-text,
  #sidebar.mobile-open .menu-section,
  #sidebar.mobile-open .sidebar-menu a span { display: unset; }
  #sidebar.mobile-open .sidebar-menu a { justify-content: flex-start; }
  #sidebar.mobile-open .store-dot { display: inline-block; }
  #main-content { margin-left: 56px; }
  .content-area { padding: 1rem; }
}
