/* ══════════════════════════════════════════
   HJ MENTORSHIP — DESIGN SYSTEM
   Brand: HJ Classes
   Primary: Navy #1B3D6F | Accent: Orange #E8712B | Green #4CAF50
   ══════════════════════════════════════════ */

:root {
    --hj-navy: #1B3D6F;
    --hj-navy-dark: #142D54;
    --hj-navy-light: #2A5498;
    --hj-orange: #E8712B;
    --hj-orange-light: #F5923E;
    --hj-orange-pale: #FFF3EB;
    --hj-green: #4CAF50;
    --hj-green-light: #66BB6A;
    --hj-green-pale: #E8F5E9;
    --bg: #F5F3EF;
    --bg-card: #FFFFFF;
    --bg-sidebar: #0F2240;
    --text: #1A2332;
    --text-light: #5A6B7D;
    --text-muted: #94A3B8;
    --border: #E2DDD6;
    --border-light: #EDE9E3;
    --danger: #DC3545;
    --danger-pale: #FDE8EA;
    --warning: #F0AD4E;
    --warning-pale: #FFF8EB;
    --info: #2E86AB;
    --info-pale: #E5F2F8;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(15,34,64,0.06);
    --shadow-md: 0 4px 12px rgba(15,34,64,0.08);
    --shadow-lg: 0 8px 28px rgba(15,34,64,0.12);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.2s ease;
    --sidebar-width: 250px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--hj-navy); text-decoration: none; }
a:hover { color: var(--hj-orange); }

/* ── LAYOUT ── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    background: var(--bg-sidebar); color: white;
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-width); height: 100vh;
    display: flex; flex-direction: column;
    overflow-y: auto; z-index: 100;
}
.main-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}
.page-content { padding: 24px 32px; }

/* Sidebar */
.sidebar-brand { padding: 20px 20px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-brand-logo { width: 38px; height: 38px; border-radius: 8px; background: linear-gradient(135deg, var(--hj-orange), var(--hj-orange-light)); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: white; flex-shrink: 0; }
.sidebar-brand-text { font-size: 16px; font-weight: 700; }
.sidebar-brand-text span { color: var(--hj-orange); }
.sidebar-brand-sub { font-size: 10px; color: rgba(255,255,255,0.4); display: block; font-weight: 500; }

.sidebar-section { padding: 16px 12px 4px; }
.sidebar-section-title { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,0.25); padding: 0 8px; margin-bottom: 6px; }

.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: rgba(255,255,255,0.55); font-size: 13px; font-weight: 500; transition: var(--transition); cursor: pointer; border: none; background: none; width: 100%; text-align: left; text-decoration: none; }
.sidebar-link:hover { color: white; background: rgba(255,255,255,0.06); }
.sidebar-link.active { color: white; background: rgba(232,113,43,0.25); font-weight: 600; border-left: 3px solid var(--hj-orange); }
.sidebar-link .icon { width: 20px; text-align: center; font-size: 15px; }

.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,0.06); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.sidebar-user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--hj-orange); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: white; flex-shrink: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: white; }
.sidebar-user-role { font-size: 10px; color: rgba(255,255,255,0.4); }

/* Top Bar */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 32px; border-bottom: 1px solid var(--border-light);
    background: var(--bg-card); position: sticky; top: 0; z-index: 50;
}
.topbar-title h1 { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }
.topbar-title p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 20px; border: none; border-radius: var(--radius-sm); font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition); text-decoration: none; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--hj-navy); color: white; box-shadow: 0 2px 6px rgba(27,61,111,0.25); }
.btn-primary:hover { background: var(--hj-navy-light); color: white; }
.btn-accent { background: var(--hj-orange); color: white; box-shadow: 0 2px 6px rgba(232,113,43,0.3); }
.btn-accent:hover { background: #D4651F; color: white; }
.btn-success { background: var(--hj-green); color: white; }
.btn-outline { background: none; color: var(--hj-navy); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--hj-navy); background: rgba(27,61,111,0.04); }
.btn-ghost { background: none; color: var(--text-light); }
.btn-ghost:hover { background: rgba(0,0,0,0.04); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-danger { background: var(--danger); color: white; }
.btn-block { width: 100%; }

/* ── FORMS ── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text); letter-spacing: 0.3px; }
.form-input, .form-select, .form-textarea {
    padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-family: var(--font); font-size: 13px; color: var(--text); background: white;
    transition: var(--transition); outline: none; width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--hj-navy); box-shadow: 0 0 0 3px rgba(27,61,111,0.08); }
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { color: var(--danger); font-size: 12px; margin-top: 2px; }
.validation-message { color: var(--danger); font-size: 12px; }

/* ── CARDS ── */
.card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-sm); transition: var(--transition); }
.card:hover { box-shadow: var(--shadow-md); }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; color: var(--text); }

/* ── STAT CARDS ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); padding: 20px;
    box-shadow: var(--shadow-sm); transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 12px; }
.stat-card-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-card-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-card-trend { font-size: 11px; font-weight: 600; margin-top: 8px; }
.stat-card-trend.up { color: var(--hj-green); }
.stat-card-trend.down { color: var(--danger); }

/* ── TABLES ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); text-align: left; padding: 12px 14px; border-bottom: 2px solid var(--border); background: var(--bg); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-light); font-size: 13px; vertical-align: middle; }
.data-table tr:hover td { background: rgba(27,61,111,0.02); }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; }
.badge-primary { background: rgba(27,61,111,0.1); color: var(--hj-navy); }
.badge-accent { background: var(--hj-orange-pale); color: var(--hj-orange); }
.badge-success { background: var(--hj-green-pale); color: #2E7D32; }
.badge-danger { background: var(--danger-pale); color: var(--danger); }
.badge-warning { background: var(--warning-pale); color: #8B6914; }
.badge-info { background: var(--info-pale); color: var(--info); }
.badge-muted { background: #F0EBE3; color: var(--text-muted); }

/* ── PROGRESS ── */
.progress-bar { height: 6px; background: var(--border-light); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--hj-navy), var(--hj-navy-light)); transition: width 0.5s ease; }
.progress-fill.accent { background: linear-gradient(90deg, var(--hj-orange), var(--hj-orange-light)); }
.progress-fill.success { background: linear-gradient(90deg, var(--hj-green), var(--hj-green-light)); }
.progress-fill.danger { background: var(--danger); }

/* ── AVATAR ── */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: white; flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }

/* ── AUTH PAGES ── */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-brand { background: linear-gradient(135deg, var(--hj-navy) 0%, #0F2240 100%); display: flex; flex-direction: column; justify-content: center; padding: 60px; color: white; position: relative; overflow: hidden; }
.auth-brand::after { content: ''; position: absolute; top: -100px; right: -100px; width: 300px; height: 300px; border-radius: 50%; background: rgba(232,113,43,0.06); }
.auth-brand h1 { font-size: 36px; font-weight: 800; margin-bottom: 12px; line-height: 1.2; }
.auth-brand h1 span { color: var(--hj-orange); }
.auth-brand p { font-size: 16px; color: rgba(255,255,255,0.6); max-width: 400px; line-height: 1.7; }
.auth-form-area { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-form { max-width: 400px; width: 100%; }
.auth-form h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.auth-form .subtitle { font-size: 14px; color: var(--text-light); margin-bottom: 28px; }

/* ── KEY ACTIVATION ── */
.key-input { font-size: 20px; font-weight: 600; letter-spacing: 3px; text-align: center; padding: 16px; text-transform: uppercase; font-family: 'JetBrains Mono', monospace; }
.key-valid { border-color: var(--hj-green) !important; background: var(--hj-green-pale) !important; }
.key-invalid { border-color: var(--danger) !important; background: var(--danger-pale) !important; }

.package-preview { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; margin: 20px 0; }
.package-preview h3 { font-size: 16px; font-weight: 700; color: var(--hj-navy); margin-bottom: 4px; }
.package-preview .detail-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border-light); }
.package-preview .detail-row:last-child { border-bottom: none; }
.package-preview .detail-label { color: var(--text-muted); }
.package-preview .detail-value { font-weight: 600; color: var(--text); }

/* ── LOADING ── */
.loading-spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--hj-navy); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert-success { background: var(--hj-green-pale); color: #2E7D32; border: 1px solid #A5D6A7; }
.alert-error { background: var(--danger-pale); color: var(--danger); border: 1px solid #F5C6CB; }
.alert-warning { background: var(--warning-pale); color: #8B6914; border: 1px solid #FFE082; }
.alert-info { background: var(--info-pale); color: var(--info); border: 1px solid #81D4FA; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text-light); margin-bottom: 4px; }
.empty-state p { font-size: 14px; }

/* ── NOT FOUND ── */
.not-found { text-align: center; padding: 80px 24px; }
.not-found h1 { font-size: 72px; font-weight: 800; color: var(--hj-orange); }
.not-found p { font-size: 18px; color: var(--text-light); margin: 8px 0 24px; }

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
    .sidebar { display: none; }
    .main-area { margin-left: 0; width: 100%; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
}
@media (max-width: 640px) {
    .page-content { padding: 16px; }
    .topbar { padding: 14px 16px; flex-wrap: wrap; gap: 8px; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .form-row { grid-template-columns: 1fr; }
}
