/* ═══════════════════════════════════════════════════
   Tareba Design System — Global Styles
   ═══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --navy:       #0F2342;
  --navy-mid:   #1B3A6B;
  --navy-light: #243F72;
  --gold:       #C8952A;
  --gold-light: #E8B84B;
  --gold-glow:  rgba(200,149,42,0.25);
  --slate:      #F4F6FA;
  --border:     #DDE3EE;
  --white:      #FFFFFF;
  --text:       #0F2342;
  --text-sec:   #5A6A84;
  --text-muted: #8A9BB5;
  --green:      #1A7F4B;
  --green-bg:   #EAF7F0;
  --amber:      #B45309;
  --amber-bg:   #FEF3C7;
  --blue:       #1D4ED8;
  --blue-bg:    #EEF2FF;
  --red:        #B91C1C;
  --red-bg:     #FEF2F2;
  --purple:     #6D28D9;
  --purple-bg:  #F5F3FF;
  --r:    8px;
  --rl:   12px;
  --rxl:  20px;
  --sh:    0 1px 3px rgba(15,35,66,0.07), 0 1px 2px rgba(15,35,66,0.04);
  --sh-md: 0 4px 20px rgba(15,35,66,0.10), 0 2px 8px rgba(15,35,66,0.06);
  --sh-lg: 0 8px 40px rgba(15,35,66,0.14);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --tr: 0.2s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--slate); color: var(--text); font-size: 15px; line-height: 1.6; }
a { color: var(--navy-mid); text-decoration: none; }
a:hover { color: var(--gold); }
img { max-width: 100%; }
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Shared Nav ── */
.site-nav { background: var(--navy); position: sticky; top: 0; z-index: 200; box-shadow: 0 2px 20px rgba(0,0,0,0.2); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 12px; }
.nav-logo { font-size: 22px; font-weight: 900; color: var(--white); letter-spacing: -0.8px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-right: 16px; }
.nav-logo span { color: var(--gold); }
.nav-logo-tag { font-size: 9px; font-weight: 700; background: var(--gold); color: var(--navy); padding: 2px 6px; border-radius: 4px; }
.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-links a { color: rgba(255,255,255,0.65); font-size: 14px; font-weight: 500; padding: 6px 14px; border-radius: 7px; transition: all var(--tr); }
.nav-links a:hover, .nav-links a.active { color: var(--white); background: rgba(255,255,255,0.1); }
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-right a { color: rgba(255,255,255,0.7); font-size: 13px; font-weight: 500; transition: color var(--tr); }
.nav-right a:hover { color: white; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 20px; border-radius: var(--r); font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all var(--tr); font-family: var(--font); text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--navy-mid); color: white; box-shadow: 0 2px 8px rgba(27,58,107,0.25); }
.btn-primary:hover { background: var(--navy); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(27,58,107,0.3); color: white; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--navy); box-shadow: 0 2px 10px var(--gold-glow); font-weight: 700; }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--gold-glow); color: var(--navy); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.4); }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.7); color: white; }
.btn-outline-navy { background: transparent; color: var(--navy-mid); border: 2px solid var(--border); }
.btn-outline-navy:hover { border-color: var(--navy-mid); background: #EEF3FF; color: var(--navy); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #991B1B; color: white; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-green  { background: var(--green-bg);  color: var(--green);  }
.badge-amber  { background: var(--amber-bg);  color: var(--amber);  }
.badge-blue   { background: var(--blue-bg);   color: var(--blue);   }
.badge-red    { background: var(--red-bg);    color: var(--red);    }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-navy   { background: #EEF3FF;          color: var(--navy-mid); }
.badge-grey   { background: var(--slate);     color: var(--text-sec); }
.badge-dot    { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-beta   { background: linear-gradient(135deg,var(--gold),var(--gold-light)); color: var(--navy); font-weight: 700; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text); }
.form-label .req { color: var(--red); }
.form-control { border: 1.5px solid var(--border); border-radius: var(--r); padding: 10px 14px; font-size: 14px; font-family: var(--font); color: var(--text); background: white; outline: none; width: 100%; transition: all var(--tr); }
.form-control:focus { border-color: var(--navy-mid); box-shadow: 0 0 0 3px rgba(27,58,107,0.1); }
.form-control.is-error { border-color: var(--red); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.input-group { position: relative; }
.input-group .form-control { padding-left: 40px; }
.input-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--text-muted); pointer-events: none; }

/* ── Alerts ── */
.alert { padding: 14px 18px; border-radius: var(--r); margin-bottom: 20px; font-size: 14px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid #86efac; }
.alert-error   { background: var(--red-bg);   color: var(--red);   border: 1px solid #fca5a5; }
.alert-info    { background: var(--blue-bg);  color: var(--blue);  border: 1px solid #93c5fd; }
.alert-warning { background: var(--amber-bg); color: var(--amber); border: 1px solid #fcd34d; }

/* ── Cards ── */
.card { background: white; border: 1px solid var(--border); border-radius: var(--rl); padding: 24px; box-shadow: var(--sh); }
.card-hover { transition: all var(--tr); cursor: pointer; }
.card-hover:hover { box-shadow: var(--sh-md); transform: translateY(-2px); border-color: #C8D4E8; }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.divider-text { display: flex; align-items: center; gap: 14px; color: var(--text-muted); font-size: 13px; margin: 20px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Footer ── */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.7); padding: 60px 24px 30px; margin-top: 80px; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-brand-name { font-size: 22px; font-weight: 900; color: white; margin-bottom: 10px; }
.footer-brand-name span { color: var(--gold); }
.footer-desc { font-size: 14px; line-height: 1.7; max-width: 280px; }
.footer-col-title { font-size: 12px; font-weight: 700; color: white; letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 16px; }
.footer-col a { display: block; color: rgba(255,255,255,0.6); font-size: 14px; margin-bottom: 10px; transition: color var(--tr); }
.footer-col a:hover { color: white; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; }

/* ── Utility ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 520px; margin: 0 auto; padding: 0 24px; }
.container-md { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; } .mt-5 { margin-top: 48px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; justify-content: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── App layout (platform pages) ── */
.app-layout { display: flex; min-height: calc(100vh - 64px); }
.app-sidebar { width: 230px; flex-shrink: 0; background: white; border-right: 1px solid var(--border); padding: 20px 0; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.app-main { flex: 1; padding: 32px; overflow: auto; min-width: 0; }
.sb-section { margin-bottom: 24px; }
.sb-label { font-size: 10px; font-weight: 700; color: var(--text-muted); letter-spacing: 1.2px; text-transform: uppercase; padding: 0 18px; margin-bottom: 6px; }
.sb-item { display: flex; align-items: center; gap: 10px; padding: 8px 18px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-sec); transition: all var(--tr); text-decoration: none; border-left: 3px solid transparent; }
.sb-item:hover { background: var(--slate); color: var(--text); }
.sb-item.active { background: #EEF3FF; color: var(--navy-mid); border-left-color: var(--navy-mid); font-weight: 600; }
.sb-icon { font-size: 16px; width: 20px; text-align: center; }
.sb-count { margin-left: auto; font-size: 11px; background: var(--slate); color: var(--text-muted); padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.sb-item.active .sb-count { background: var(--navy-mid); color: white; }
.sb-divider { height: 1px; background: var(--border); margin: 10px 18px; }
.page-title { font-size: 26px; font-weight: 900; letter-spacing: -0.8px; margin-bottom: 4px; }
.page-sub { font-size: 14px; color: var(--text-sec); margin-bottom: 28px; }

/* ── Stat cards ── */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: white; border: 1px solid var(--border); border-radius: var(--rl); padding: 20px 24px; box-shadow: var(--sh); position: relative; overflow: hidden; transition: all var(--tr); }
.stat-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg,var(--navy-mid),var(--gold)); opacity: 0; transition: opacity var(--tr); }
.stat-card:hover::before { opacity: 1; }
.stat-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.stat-value { font-size: 32px; font-weight: 900; color: var(--text); letter-spacing: -1.5px; margin: 6px 0 2px; line-height: 1; }
.stat-sub { font-size: 12px; color: var(--text-sec); }
.stat-trend { font-size: 12px; font-weight: 600; color: var(--green); margin-top: 4px; }
.stat-icon { position: absolute; right: 20px; top: 20px; font-size: 24px; opacity: 0.12; }

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: var(--rl); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; background: white; }
th { background: var(--slate); font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFBFF; }
.td-trunc { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Pro gate ── */
.pro-gate { background: linear-gradient(135deg,var(--navy),var(--navy-light)); border-radius: var(--rl); padding: 40px; text-align: center; color: white; }
.pro-gate h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.pro-gate p { color: rgba(255,255,255,0.7); font-size: 14px; margin-bottom: 24px; }

/* ── Skeleton ── */
.skeleton { background: linear-gradient(90deg,#F0F4FA 25%,#E4EAF5 50%,#F0F4FA 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Animations ── */
.fade-in { animation: fadeIn 0.4s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.count-up { display: inline-block; }

/* ── Responsive ── */
@media (max-width: 1024px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) {
  .nav-links { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .app-main { padding: 20px 16px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .page-title { font-size: 22px; }
}
@media (max-width: 480px) { .stats-row { grid-template-columns: 1fr; } }
