/* ============================================
   OrthoExpert - Sistem Pakar Maloklusi Gigi
   Aesthetic: Clinical Precision + Modern Medical
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:opsz,wght@9..40,300;400;500;600;700&display=swap');

:root {
    --navy: #0a1628;
    --navy-mid: #112240;
    --navy-light: #1e3a5f;
    --teal: #0d9488;
    --teal-light: #14b8a6;
    --teal-glow: #5eead4;
    --amber: #f59e0b;
    --amber-light: #fbbf24;
    --red: #ef4444;
    --green: #10b981;
    --white: #ffffff;
    --off-white: #f0f9ff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-dark: #1e3a5f;
    --card-bg: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(10,22,40,0.12);
    --shadow-lg: 0 12px 40px rgba(10,22,40,0.18);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--off-white);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4 { font-family: 'DM Serif Display', serif; line-height: 1.2; }
.serif { font-family: 'DM Serif Display', serif; }

/* ─── NAVBAR ─── */
.navbar {
    background: var(--navy);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--white);
}

.brand-icon img{
    width: 45px;      /* lebar logo */
    height: 45px;     /* tinggi logo */
    object-fit: cover; /* atau contain */
    border-radius: 50%; /* jika ingin bulat */
}

.login-icon img{
    width: 65px;      /* lebar logo */
    height: 65px;     /* tinggi logo */
    object-fit: cover; /* atau contain */
    border-radius: 50%; /* jika ingin bulat */
    align-items: center;
}



.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--teal), var(--teal-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.brand-text {
    font-family: 'DM Serif Display', serif;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand-sub {
    font-size: 0.65rem;
    color: var(--teal-glow);
    font-weight: 300;
    display: block;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: -2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-links a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-badge {
    background: var(--teal);
    color: white;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ─── HERO ─── */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, var(--navy-light) 100%);
    color: white;
    padding: 5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(13,148,136,0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 50%, rgba(14,184,166,0.08) 0%, transparent 60%);
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    from { transform: translateX(-5%) translateY(-3%); }
    to { transform: translateX(5%) translateY(3%); }
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 50px 50px;
}

.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(13,148,136,0.2);
    border: 1px solid rgba(13,148,136,0.4);
    color: var(--teal-glow);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.hero h1 em {
    font-style: italic;
    color: var(--teal-glow);
}

.hero p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    max-width: 580px;
    margin: 0 auto 2.5rem;
    font-weight: 300;
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--teal), var(--teal-light));
    color: white;
    box-shadow: 0 4px 14px rgba(13,148,136,0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(13,148,136,0.5);
    color: white;
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1.5px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
    color: white;
}

.btn-danger {
    background: var(--red);
    color: white;
}

.btn-danger:hover { 
    background: #dc2626; 
    transform: translateY(-1px);
    color: white;
}

.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

.btn-dark {
    background: var(--navy);
    color: white;
}
.btn-dark:hover { background: var(--navy-mid); color: white; }

/* ─── CARDS ─── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.15rem;
    color: var(--navy);
}

.card-body { padding: 1.5rem; }

/* ─── STATS CARDS ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent, var(--teal));
}

.stat-number {
    font-family: 'DM Serif Display', serif;
    font-size: 2.25rem;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label { color: var(--text-secondary); font-size: 0.875rem; }

.stat-icon {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 1.75rem;
    opacity: 0.15;
}

/* ─── TABLES ─── */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead th {
    background: var(--navy);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

thead th:first-child { border-radius: 0; }
thead th:last-child { border-radius: 0; }

tbody tr { border-bottom: 1px solid var(--border); transition: var(--transition); }
tbody tr:hover { background: #f8faff; }
tbody td { padding: 12px 16px; color: var(--text-primary); vertical-align: middle; }

/* ─── BADGES ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-ringan { background: #dcfce7; color: #166534; }
.badge-sedang { background: #fef3c7; color: #92400e; }
.badge-berat { background: #fee2e2; color: #991b1b; }
.badge-admin { background: #e0e7ff; color: #3730a3; }
.badge-pakar { background: #d1fae5; color: #065f46; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: white;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ─── ALERT / FLASH ─── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.25rem;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ─── DIAGNOSIS FORM ─── */
.diagnosis-container { max-width: 1000px; margin: 0 auto; }

.gejala-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    transition: var(--transition);
    cursor: default;
}

.gejala-card:hover { border-color: var(--teal); box-shadow: 0 2px 12px rgba(13,148,136,0.1); }
.gejala-card.selected { border-color: var(--teal); background: #f0fdfa; }

.gejala-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.gejala-check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.gejala-card.selected .gejala-check {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
}

.gejala-info { flex: 1; }
.gejala-kode { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.gejala-nama { font-weight: 600; font-size: 0.95rem; color: var(--navy); }
.gejala-desc { font-size: 0.82rem; color: var(--text-secondary); margin-top: 3px; }

.confidence-slider { margin-top: 1rem; display: none; }
.gejala-card.selected .confidence-slider { display: block; }

.confidence-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.cf-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cf-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.cf-option input[type="radio"] { display: none; }

.cf-option label {
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.cf-option input:checked + label {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
}

.cf-option label:hover { border-color: var(--teal); color: var(--teal); }

/* ─── HASIL DIAGNOSIS ─── */
.hasil-hero {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.hasil-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top right, rgba(13,148,136,0.2), transparent 70%);
}

.hasil-content { position: relative; z-index: 1; }

.cf-bar-container {
    background: rgba(255,255,255,0.15);
    border-radius: 100px;
    height: 12px;
    margin: 12px 0;
    overflow: hidden;
}

.cf-bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 1s cubic-bezier(0.4,0,0.2,1);
    background: linear-gradient(90deg, var(--teal), var(--teal-glow));
}

.tingkat-badge-hero {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.tingkat-ringan-hero { background: rgba(16,185,129,0.25); color: #5eead4; border: 1px solid rgba(16,185,129,0.4); }
.tingkat-sedang-hero { background: rgba(245,158,11,0.25); color: #fbbf24; border: 1px solid rgba(245,158,11,0.4); }
.tingkat-berat-hero { background: rgba(239,68,68,0.25); color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }

/* ─── LAYOUT ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.page-content { padding: 2rem 1.5rem; max-width: 1200px; margin: 0 auto; }

.two-col { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; align-items: start; }

/* ─── SIDEBAR ─── */
.sidebar {
    background: var(--navy);
    min-height: calc(100vh - 64px);
    padding: 1.5rem 1rem;
    position: sticky;
    top: 64px;
}

.sidebar-section { margin-bottom: 0.5rem; }

.sidebar-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.5rem 12px;
    display: block;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-link.active { background: rgba(13,148,136,0.3); color: var(--teal-glow); }

.sidebar-link span:first-child { font-size: 1rem; width: 20px; text-align: center; }

/* ─── LOGIN PAGE ─── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(13,148,136,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(14,184,166,0.08) 0%, transparent 50%);
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--teal), var(--teal-light));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 1rem;
}

/* ─── PRINT STYLES ─── */
@media print {
    .navbar, .sidebar, .btn, .no-print { display: none !important; }
    body { background: white; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .two-col { grid-template-columns: 1fr; }
    .sidebar { min-height: auto; position: relative; top: 0; }
    .hero { padding: 3rem 1rem; }
    .hero h1 { font-size: 2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .cf-options { gap: 6px; }
}

/* ─── UTILITIES ─── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-teal { color: var(--teal); }
.text-navy { color: var(--navy); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 1rem; }
.gap-1 { gap: 0.5rem; }
.fw-600 { font-weight: 600; }
.fs-sm { font-size: 0.875rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
