/* =============================================
   CreativeMide Brand Audit System — Main CSS
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  --primary:      #1a1a2e;
  --accent:       #e94560;
  --secondary:    #16213e;
  --surface:      #0f3460;
  --bg:           #f8f9fc;
  --card-bg:      #ffffff;
  --text:         #1e1e2e;
  --text-muted:   #6c757d;
  --border:       #e2e8f0;
  --success:      #10b981;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --info:         #3b82f6;
  --sidebar-w:    260px;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,.08);
  --shadow-lg:    0 8px 40px rgba(0,0,0,.14);
  --transition:   all .22s cubic-bezier(.4,0,.2,1);
  --font-head:    'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.25;
  color: var(--primary);
  letter-spacing: -0.02em;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { opacity: .8; }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; top: 0; left: 0; height: 100vh;
  width: var(--sidebar-w); background: var(--primary);
  display: flex; flex-direction: column; z-index: 1000;
  transition: var(--transition); overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,.15);
}

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-brand img { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; }
.sidebar-brand-name { color: #fff; font-family: var(--font-head); font-size: .95rem; font-weight: 700; letter-spacing: -.01em; }
.sidebar-brand-sub  { color: rgba(255,255,255,.45); font-size: .68rem; }

.sidebar-nav { padding: 14px 0; flex: 1; }
.nav-section { padding: 8px 20px 4px; font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.3); }

.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: rgba(255,255,255,.65);
  font-size: .84rem; font-weight: 500; border-radius: 0;
  transition: var(--transition); position: relative;
}
.sidebar-link:hover, .sidebar-link.active {
  color: #fff; background: rgba(255,255,255,.07);
}
.sidebar-link.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  height: 60%; width: 3px; background: var(--accent); border-radius: 0 4px 4px 0;
}
.sidebar-link i { font-size: .95rem; width: 18px; text-align: center; }
.sidebar-footer {
  padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.45); font-size: .76rem;
}

/* ── MAIN LAYOUT ── */
.main-wrapper { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 60px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,.04);
}
.topbar-title { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--primary); letter-spacing: -.01em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.page-content { padding: 24px; flex: 1; }

/* ── CARDS ── */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden; transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-header {
  padding: 16px 20px 13px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-family: var(--font-head); font-size: .9rem; font-weight: 700; margin: 0; color: var(--primary); letter-spacing: -.01em; }
.card-body { padding: 20px; }

/* ── STAT CARDS ── */
.stat-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 20px; border: 1px solid var(--border);
  position: relative; overflow: hidden; transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card::after {
  content: ''; position: absolute; top: 0; right: 0;
  width: 70px; height: 70px; border-radius: 0 0 0 70px; opacity: .07;
}
.stat-card.primary::after { background: var(--primary); }
.stat-card.accent::after  { background: var(--accent); }
.stat-card.success::after { background: var(--success); }
.stat-card.info::after    { background: var(--info); }

.stat-label { font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-family: var(--font-head); font-size: 1.75rem; font-weight: 800; color: var(--primary); line-height: 1; letter-spacing: -.03em; }
.stat-change { font-size: .76rem; margin-top: 5px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-icon { position: absolute; top: 16px; right: 16px; font-size: 1.6rem; opacity: .12; color: var(--primary); }

/* ── SCORE RING ── */
.score-ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.score-ring { position: relative; width: 120px; height: 120px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 10; }
.score-ring .bg   { stroke: var(--border); }
.score-ring .fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.score-ring-value { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: -.03em; }
.score-label { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-align: center; }

/* ── PLATFORM BADGES ── */
.platform-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 600;
  text-transform: capitalize; cursor: pointer; transition: var(--transition);
}
.platform-badge:hover { opacity: .85; transform: scale(1.03); }
.pb-facebook   { background: #1877F21a; color: #1877F2; border: 1px solid #1877F240; }
.pb-instagram  { background: #E1306C1a; color: #E1306C; border: 1px solid #E1306C40; }
.pb-twitter, .pb-x { background: #0009; color: #fff; border: 1px solid #333; }
.pb-linkedin   { background: #0A66C21a; color: #0A66C2; border: 1px solid #0A66C240; }
.pb-tiktok     { background: #0009; color: #fff; border: 1px solid #333; }
.pb-pinterest  { background: #E600231a; color: #E60023; border: 1px solid #E6002340; }
.pb-shopify    { background: #96bf481a; color: #5a8a23; border: 1px solid #96bf4840; }

/* ── TABLES ── */
.table-custom { width: 100%; border-collapse: collapse; }
.table-custom th { background: var(--bg); padding: 9px 14px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); border-bottom: 2px solid var(--border); text-align: left; }
.table-custom td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: .85rem; vertical-align: middle; }
.table-custom tr:last-child td { border-bottom: none; }
.table-custom tr:hover td { background: var(--bg); }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .78rem; font-weight: 600; margin-bottom: 5px; color: var(--text); }
.form-control, .form-select {
  width: 100%; padding: 9px 13px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--font-body); font-size: .875rem;
  color: var(--text); background: var(--card-bg); transition: var(--transition);
  outline: none;
}
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,69,96,.1); }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-sm); font-family: var(--font-body);
  font-size: .84rem; font-weight: 600; cursor: pointer; border: none;
  transition: var(--transition); text-decoration: none; letter-spacing: -.01em;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.14); }
.btn:active { transform: translateY(0); }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-accent    { background: var(--accent);  color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-danger    { background: var(--danger);  color: #fff; }
.btn-outline   { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }
.btn-sm { padding: 5px 12px; font-size: .78rem; }
.btn-lg { padding: 11px 26px; font-size: .95rem; }
.btn-icon { padding: 7px; border-radius: 7px; }

/* ── ALERTS ── */
.alert { padding: 11px 15px; border-radius: var(--radius-sm); font-size: .85rem; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 9px; }
.alert-success { background: #10b98112; border: 1px solid #10b98140; color: #065f46; }
.alert-danger  { background: #ef444412; border: 1px solid #ef444440; color: #991b1b; }
.alert-info    { background: #3b82f612; border: 1px solid #3b82f640; color: #1e40af; }
.alert-warning { background: #f59e0b12; border: 1px solid #f59e0b40; color: #92400e; }

/* ── TABS ── */
.nav-tabs-custom { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.nav-tab {
  padding: 8px 16px; font-size: .82rem; font-weight: 600; color: var(--text-muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer;
  transition: var(--transition); background: none; border-top: none; border-left: none; border-right: none;
  font-family: var(--font-body); letter-spacing: -.01em;
}
.nav-tab:hover { color: var(--primary); }
.nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── CHART CONTAINERS ── */
.chart-wrap { position: relative; height: 260px; width: 100%; }
.chart-wrap canvas { border-radius: var(--radius-sm); }

/* ── INSIGHT BOX ── */
.insight-box { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border-radius: var(--radius); padding: 22px; }
.insight-box h5 { font-family: var(--font-head); color: #fff; margin-bottom: 10px; font-size: .95rem; }
.insight-box p { color: rgba(255,255,255,.8); font-size: .855rem; line-height: 1.7; }

.rec-list { list-style: none; }
.rec-list li { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .855rem; }
.rec-list li:last-child { border-bottom: none; }
.rec-list li::before { content: '→'; color: var(--accent); font-weight: 700; margin-top: 1px; flex-shrink: 0; }

/* ── SPLASH PAGE ── */
.splash-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--surface) 100%);
  position: relative; overflow: hidden;
}
.splash-page::before {
  content: ''; position: absolute; top: -40%; right: -20%;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%); opacity: .07;
}
.splash-card { text-align: center; color: #fff; z-index: 1; padding: 48px; max-width: 540px; width: 90%; }
.splash-logo { width: 110px; height: 110px; object-fit: contain; border-radius: 20px; margin: 0 auto 22px; box-shadow: 0 8px 40px rgba(0,0,0,.3); }
.splash-title { font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: #fff; letter-spacing: -.03em; }
.splash-subtitle { color: rgba(255,255,255,.65); font-size: 1rem; margin-top: 7px; }
.splash-badge { display: inline-block; padding: 3px 12px; background: var(--accent); border-radius: 20px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }

/* ── LOGIN PAGE ── */
.login-page { min-height: 100vh; display: flex; }
.login-visual {
  flex: 1; background: linear-gradient(160deg, var(--primary), var(--secondary), var(--surface));
  display: flex; flex-direction: column; justify-content: center; padding: 56px;
  position: relative; overflow: hidden;
}
.login-visual::before {
  content: ''; position: absolute; bottom: -20%; left: -10%;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%); opacity: .1;
}
.login-visual-text { color: #fff; z-index: 1; }
.login-visual-text h1 { font-size: 2.4rem; font-weight: 800; line-height: 1.15; margin-bottom: 14px; letter-spacing: -.03em; }
.login-visual-text p { color: rgba(255,255,255,.6); font-size: 1rem; max-width: 360px; }
.login-form-panel { width: 440px; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--card-bg); }
.login-form-inner { width: 100%; max-width: 340px; }
.login-logo { font-family: var(--font-head); font-size: 1.25rem; font-weight: 800; color: var(--primary); margin-bottom: 28px; letter-spacing: -.02em; }
.login-logo span { color: var(--accent); }

/* ── CUSTOM WEBSITE PAGE ── */
.cw-hero { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; padding: 72px 0; text-align: center; }
.cw-hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 14px; letter-spacing: -.03em; }
.cw-hero p { font-size: 1rem; color: rgba(255,255,255,.72); max-width: 520px; margin: 0 auto; }

.benefit-card { border-radius: var(--radius); padding: 24px; background: var(--card-bg); border: 1px solid var(--border); height: 100%; transition: var(--transition); }
.benefit-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.benefit-icon { width: 48px; height: 48px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 14px; }
.benefit-card h5 { font-family: var(--font-head); margin-bottom: 7px; font-size: .95rem; letter-spacing: -.01em; }
.benefit-card p { color: var(--text-muted); font-size: .845rem; }

/* ── RESPONSIVE ── */
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--primary); }

@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 576px) {
  .page-content { padding: 14px; }
  .login-visual { display: none; }
  .login-form-panel { width: 100%; }
  .stat-value { font-size: 1.5rem; }
  .cw-hero h1 { font-size: 1.7rem; }
  .splash-title { font-size: 1.6rem; }
}

/* ── ANIMATIONS ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.fade-in-up { animation: fadeInUp .38s ease both; }
.fade-in-up-1 { animation-delay: .08s; }
.fade-in-up-2 { animation-delay: .16s; }
.fade-in-up-3 { animation-delay: .24s; }
.fade-in-up-4 { animation-delay: .32s; }

/* ── UTILS ── */
.text-accent   { color: var(--accent) !important; }
.text-muted-sm { font-size: .76rem; color: var(--text-muted); }
.badge-custom  { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .69rem; font-weight: 700; }
.badge-success { background: #10b98118; color: #065f46; }
.badge-warning { background: #f59e0b18; color: #92400e; }
.badge-danger  { background: #ef444418; color: #991b1b; }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--primary); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: .82rem; }
