@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  --red:       #C8102E;
  --red-dark:  #a00e25;
  --red-light: #fdf0f2;
  --gray-900:  #111111;
  --gray-800:  #1f1f1f;
  --gray-700:  #374151;
  --gray-500:  #6b7280;
  --gray-400:  #9ca3af;
  --gray-200:  #e5e7eb;
  --gray-100:  #f3f4f6;
  --gray-50:   #f9fafb;
  --gold:      #F5C400;
  --white:     #ffffff;
  --sidebar-w: 240px;
  --radius:    10px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
}

body { font-family: 'Inter', sans-serif; background: var(--gray-50); color: var(--gray-900); font-size: 14px; line-height: 1.6; }

/* ── LOGIN ─────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gray-900); }
.login-box { background: var(--white); border-radius: 16px; padding: 48px 40px; width: 100%; max-width: 400px; box-shadow: 0 24px 64px rgba(0,0,0,.3); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { height: 48px; }
.login-logo h1 { font-size: 20px; font-weight: 700; color: var(--gray-900); margin-top: 12px; }
.login-logo p  { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.login-box .form-group { margin-bottom: 16px; }
.login-box label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; letter-spacing: .03em; text-transform: uppercase; }
.login-box input { width: 100%; padding: 11px 14px; border: 1.5px solid var(--gray-200); border-radius: 8px; font-family: inherit; font-size: 14px; color: var(--gray-900); transition: border .15s; background: var(--white); }
.login-box input:focus { outline: none; border-color: var(--red); }
.btn-login { width: 100%; padding: 13px; background: var(--red); color: var(--white); border: none; border-radius: 8px; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s, transform .1s; margin-top: 8px; }
.btn-login:hover { background: var(--red-dark); }
.btn-login:active { transform: scale(.98); }
.login-erro { background: var(--red-light); border: 1px solid #f5c6cb; color: var(--red); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* ── LAYOUT ─────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar { width: var(--sidebar-w); background: var(--gray-900); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; }
.sidebar-logo { padding: 24px 20px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo span { display: block; font-size: 11px; font-weight: 600; color: rgba(255,255,255,.35); letter-spacing: .08em; text-transform: uppercase; margin-top: 10px; }
.sidebar-logo strong { font-size: 15px; font-weight: 700; color: var(--white); }
.sidebar-logo .logo-badge { display: inline-block; background: var(--red); color: var(--white); font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; margin-top: 6px; letter-spacing: .05em; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-section { padding: 16px 16px 4px; font-size: 10px; font-weight: 700; color: rgba(255,255,255,.25); letter-spacing: .1em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: rgba(255,255,255,.6); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: all .15s; border-radius: 0; margin: 1px 8px; border-radius: 8px; }
.nav-item:hover { background: rgba(255,255,255,.07); color: var(--white); }
.nav-item.active { background: var(--red); color: var(--white); }
.nav-item i { font-size: 17px; flex-shrink: 0; }
.nav-item .badge-count { margin-left: auto; background: rgba(255,255,255,.15); color: rgba(255,255,255,.8); font-size: 11px; padding: 1px 7px; border-radius: 20px; }
.nav-item.active .badge-count { background: rgba(255,255,255,.25); }

.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.4); }
.sidebar-logout { color: rgba(255,255,255,.4); text-decoration: none; font-size: 17px; transition: color .15s; }
.sidebar-logout:hover { color: var(--red); }

/* MAIN */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: var(--white); border-bottom: 1px solid var(--gray-200); padding: 0 28px; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.topbar-title span { font-size: 13px; font-weight: 400; color: var(--gray-500); margin-left: 6px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.content { padding: 28px; flex: 1; }

/* ── CARDS STAT ─────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); border: 1px solid var(--gray-200); display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-icon-red    { background: var(--red-light); color: var(--red); }
.stat-icon-green  { background: #ecfdf5; color: #059669; }
.stat-icon-amber  { background: #fffbeb; color: #d97706; }
.stat-icon-blue   { background: #eff6ff; color: #2563eb; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray-500); margin-top: 3px; font-weight: 500; }

/* ── CARDS GERAIS ───────────────────────────── */
.card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--gray-200); box-shadow: var(--shadow); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.card-body { padding: 20px; }

/* ── TABELA ─────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--gray-50); }
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--gray-100); font-size: 13.5px; color: var(--gray-700); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
.td-primary { font-weight: 600; color: var(--gray-900); }
.td-link { color: var(--red); text-decoration: none; font-weight: 600; }
.td-link:hover { text-decoration: underline; }

/* ── BADGES ─────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-ativa     { background: #ecfdf5; color: #065f46; }
.badge-agregada  { background: #eff6ff; color: #1d4ed8; }
.badge-inaugurar { background: #fffbeb; color: #92400e; }
.badge-inativa   { background: var(--gray-100); color: var(--gray-500); }

/* ── BOTÕES ─────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; transition: all .15s; border: 1.5px solid transparent; }
.btn-primary   { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-outline   { background: transparent; color: var(--gray-700); border-color: var(--gray-200); }
.btn-outline:hover { background: var(--gray-100); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn i { font-size: 16px; }

/* ── FILTROS / BUSCA ────────────────────────── */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1.5px solid var(--gray-200); border-radius: 8px; padding: 0 12px; flex: 1; min-width: 200px; max-width: 340px; }
.search-box i { color: var(--gray-400); font-size: 17px; }
.search-box input { border: none; outline: none; font-family: inherit; font-size: 13.5px; color: var(--gray-900); background: transparent; width: 100%; padding: 9px 0; }
.filter-select { padding: 9px 12px; border: 1.5px solid var(--gray-200); border-radius: 8px; font-family: inherit; font-size: 13px; color: var(--gray-700); background: var(--white); cursor: pointer; outline: none; }
.filter-select:focus { border-color: var(--red); }

/* ── FORMULÁRIO ─────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--gray-700); letter-spacing: .03em; text-transform: uppercase; }
.form-group input, .form-group select, .form-group textarea { padding: 10px 13px; border: 1.5px solid var(--gray-200); border-radius: 8px; font-family: inherit; font-size: 14px; color: var(--gray-900); transition: border .15s; background: var(--white); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--red); }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-section { font-size: 11px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .07em; padding: 20px 0 8px; border-bottom: 1px solid var(--gray-200); margin-bottom: 16px; grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; padding-top: 20px; border-top: 1px solid var(--gray-200); margin-top: 8px; }

/* ── FICHA DA LOJA ──────────────────────────── */
.loja-header { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.loja-avatar { width: 60px; height: 60px; border-radius: 14px; background: var(--red-light); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex-shrink: 0; }
.loja-info h1 { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.loja-info p  { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.loja-meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.loja-meta-item { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--gray-500); }
.loja-meta-item i { font-size: 15px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.detail-item { padding: 13px 0; border-bottom: 1px solid var(--gray-100); }
.detail-item:nth-child(odd) { padding-right: 24px; }
.detail-item:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--gray-100); }
.detail-label { font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.detail-value { font-size: 14px; color: var(--gray-900); font-weight: 500; }

/* ── PAGINAÇÃO ──────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 24px; }
.page-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 13px; font-weight: 500; text-decoration: none; color: var(--gray-700); border: 1px solid var(--gray-200); transition: all .15s; }
.page-btn:hover { background: var(--gray-100); }
.page-btn.active { background: var(--red); color: var(--white); border-color: var(--red); }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ── EMPTY STATE ────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-500); }
.empty-state i { font-size: 48px; color: var(--gray-300); margin-bottom: 12px; display: block; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* ── GRID DASHBOARD ─────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }

/* ── MISC ───────────────────────────────────── */
.text-red   { color: var(--red); }
.text-muted { color: var(--gray-500); }
.fw-600 { font-weight: 600; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }

@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid  { grid-template-columns: 1fr; }
  .form-grid  { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}
