/* ═══════════════════════════════════════════
   CRETO — Certificate Generation Platform
   ═══════════════════════════════════════════ */

:root {
  --primary: #FF6B35;
  --primary-dark: #E55A28;
  --primary-light: #FF8F66;
  --accent: #1B2845;
  --accent-light: #274060;
  --surface: #FAFBFC;
  --white: #FFFFFF;
  --card: #FFFFFF;
  --border: #E8ECF1;
  --text: #1A1D26;
  --text-secondary: #5A6175;
  --text-muted: #9AA0B0;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Bricolage Grotesque', 'DM Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--surface); color: var(--text); min-height: 100vh; font-size: 14px; line-height: 1.6; }

/* ── Typography ── */
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; font-family: var(--font); cursor: pointer; border: none; transition: all .2s; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); box-shadow: 0 6px 20px rgba(255,107,53,.3); color: #fff; }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-light); color: #fff; }
.btn--outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn--outline:hover { border-color: var(--primary); color: var(--primary); }
.btn--success { background: var(--success); color: #fff; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover { background: rgba(0,0,0,.04); }
.btn--lg { padding: 14px 28px; font-size: 15px; border-radius: 10px; }
.btn--sm { padding: 6px 14px; font-size: 12px; }
.btn--block { width: 100%; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.form-control { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; font-family: var(--font); color: var(--text); background: var(--white); transition: border-color .2s, box-shadow .2s; outline: none; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,107,53,.1); }
.form-control::placeholder { color: var(--text-muted); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Cards ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card--hover:hover { box-shadow: var(--shadow); border-color: transparent; }

/* ── Navbar ── */
.navbar { background: var(--accent); padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.navbar__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.navbar__logo { width: 34px; height: 34px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 900; color: #fff; font-family: var(--font-display); }
.navbar__name { color: #fff; font-size: 16px; font-weight: 700; font-family: var(--font-display); letter-spacing: -.3px; }
.navbar__name span { color: var(--primary); }
.navbar__links { display: flex; align-items: center; gap: 6px; list-style: none; }
.navbar__links a { color: rgba(255,255,255,.6); font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 6px; transition: all .15s; }
.navbar__links a:hover, .navbar__links a.active { color: #fff; background: rgba(255,255,255,.1); }
.navbar__user { display: flex; align-items: center; gap: 10px; }
.navbar__avatar { width: 32px; height: 32px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-header { padding: 32px 0 24px; }
.page-header h1 { margin-bottom: 4px; }
.page-header p { color: var(--text-secondary); font-size: 14px; }

/* ── Stats Grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card__icon { font-size: 24px; margin-bottom: 8px; }
.stat-card__value { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--text); }
.stat-card__label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; margin-top: 2px; }

/* ── Table ── */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: 13px; }
th { background: #F8F9FB; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; font-size: 11px; border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid #F3F4F6; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFBFC; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 600; letter-spacing: .3px; }
.badge--free { background: #F3F4F6; color: #6B7280; }
.badge--starter { background: #EFF6FF; color: #2563EB; }
.badge--business { background: #F5F3FF; color: #7C3AED; }
.badge--custom { background: #FFF7ED; color: #C2410C; }
.badge--active { background: #DCFCE7; color: #16a34a; }
.badge--suspended { background: #FEF3C7; color: #D97706; }
.badge--blocked { background: #FEE2E2; color: #DC2626; }
.badge--success { background: #DCFCE7; color: #16a34a; }
.badge--pending { background: #FEF3C7; color: #D97706; }
.badge--failed { background: #FEE2E2; color: #DC2626; }

/* ── Auth Pages ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent) 0%, #0F172A 100%); padding: 20px; }
.auth-card { background: #fff; border-radius: var(--radius-lg); padding: 40px; max-width: 440px; width: 100%; box-shadow: var(--shadow-lg); }
.auth-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 28px; }
.auth-logo__icon { width: 44px; height: 44px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 900; color: #fff; font-family: var(--font-display); }
.auth-logo__text { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--accent); letter-spacing: -.5px; }
.auth-title { text-align: center; margin-bottom: 6px; font-size: 20px; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.auth-divider { text-align: center; color: var(--text-muted); font-size: 12px; margin: 20px 0; position: relative; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--border); }
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.error-msg { background: #FEE2E2; border: 1px solid #FECACA; color: #991B1B; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.success-msg { background: #DCFCE7; border: 1px solid #86EFAC; color: #166534; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* ── Pricing ── */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin: 32px 0; }
.pricing-card { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius-lg); padding: 28px; text-align: center; position: relative; transition: all .3s; }
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pricing-card.featured { border-color: var(--primary); }
.pricing-card.featured::before { content: 'Most Popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 4px 16px; border-radius: 50px; font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.pricing-card__name { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.pricing-card__price { font-family: var(--font-display); font-size: 36px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.pricing-card__price span { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.pricing-card__desc { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.pricing-card__features { list-style: none; text-align: left; margin-bottom: 24px; }
.pricing-card__features li { padding: 6px 0; font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.pricing-card__features li::before { content: '✓'; color: var(--success); font-weight: 700; }

/* ── Super Admin Sidebar ── */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--accent); padding: 0; overflow-y: auto; }
.admin-sidebar__brand { padding: 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.06); }
.admin-sidebar__brand-icon { width: 36px; height: 36px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; font-size: 13px; font-family: var(--font-display); flex-shrink: 0; }
.admin-sidebar__brand-text { color: #fff; font-size: 14px; font-weight: 700; font-family: var(--font-display); }
.admin-sidebar__brand-sub { color: rgba(255,255,255,.4); font-size: 10px; display: block; }
.admin-sidebar__section { padding: 16px 20px 6px; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.25); }
.admin-sidebar__nav { list-style: none; }
.admin-sidebar__nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: rgba(255,255,255,.55); font-size: 13px; transition: all .15s; border-left: 3px solid transparent; }
.admin-sidebar__nav a:hover, .admin-sidebar__nav a.active { color: #fff; background: rgba(255,255,255,.06); border-left-color: var(--primary); }
.admin-main { padding: 32px; overflow-y: auto; background: var(--surface); }

/* ── Toast ── */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #fff; background: var(--accent); box-shadow: var(--shadow-lg); z-index: 9999; animation: slideIn .3s ease; }
.toast--success { background: var(--success); }
.toast--error { background: var(--danger); }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Responsive ── */
@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
}
