/* ============================================================
   Dewi Study Centre - Main Stylesheet
   Font: Playfair Display + Nunito
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=Nunito:wght@300;400;600;700;800&display=swap');

:root {
    --primary: #1a3a5c;
    --primary-light: #2563a8;
    --accent: #e8a020;
    --accent-light: #fbb740;
    --teal: #0d9488;
    --bg: #f8f7f4;
    --white: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --shadow: 0 4px 20px rgba(26,58,92,0.10);
    --shadow-lg: 0 8px 40px rgba(26,58,92,0.16);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

h1,h2,h3,h4 {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
}

a { color: var(--primary-light); text-decoration: none; transition: .2s; }
a:hover { color: var(--accent); }

img { max-width: 100%; }

/* ============================================================
   NAVBAR PUBLIK
   ============================================================ */
.navbar {
    background: var(--primary);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 16px rgba(0,0,0,.2);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 0;
}

.navbar-brand .logo-icon {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.navbar-brand .brand-text {
    color: white;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
}

.navbar-brand .brand-sub {
    color: var(--accent-light);
    font-size: .72rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

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

.nav-links a {
    color: rgba(255,255,255,.85);
    padding: .5rem .9rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    transition: .2s;
}

.nav-links a:hover, .nav-links a.active {
    background: rgba(255,255,255,.12);
    color: var(--accent-light);
}

.nav-btn-login {
    background: var(--accent) !important;
    color: var(--primary) !important;
    padding: .45rem 1.2rem !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
}

.nav-btn-login:hover {
    background: var(--accent-light) !important;
    transform: translateY(-1px);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #0f2744 50%, #1a3a5c 100%);
    min-height: 88vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 4rem 2rem;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(232,160,32,.15) 0%, transparent 70%);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(13,148,136,.12) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: rgba(232,160,32,.2);
    border: 1px solid rgba(232,160,32,.4);
    color: var(--accent-light);
    padding: .35rem 1rem;
    border-radius: 50px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 3.2rem;
    color: white;
    line-height: 1.15;
    margin-bottom: 1.2rem;
}

.hero h1 span { color: var(--accent-light); }

.hero p {
    color: rgba(255,255,255,.75);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 480px;
}

.btn-hero-primary {
    background: var(--accent);
    color: var(--primary);
    padding: .85rem 2rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    display: inline-block;
    transition: .3s;
    box-shadow: 0 4px 20px rgba(232,160,32,.4);
    margin-right: .75rem;
}

.btn-hero-primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(232,160,32,.5);
    color: var(--primary);
}

.btn-hero-outline {
    border: 2px solid rgba(255,255,255,.4);
    color: white;
    padding: .83rem 1.8rem;
    border-radius: 50px;
    font-weight: 700;
    display: inline-block;
    transition: .3s;
}

.btn-hero-outline:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.7);
    color: white;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,.1);
}

.hero-stat .num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-light);
    font-family: 'Playfair Display', serif;
}

.hero-stat .label {
    font-size: .8rem;
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.hero-card-stack {
    position: relative;
    width: 360px;
    height: 400px;
}

.hero-card {
    position: absolute;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 1.5rem;
    color: white;
}

.hero-card-main {
    width: 280px;
    top: 40px;
    left: 40px;
    background: rgba(255,255,255,.95) !important;
    color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.hero-card-float1 {
    width: 180px;
    top: 0;
    right: 0;
    background: var(--accent) !important;
}

.hero-card-float2 {
    width: 200px;
    bottom: 30px;
    left: 0;
    background: var(--teal) !important;
}

/* ============================================================
   SECTION UMUM
   ============================================================ */
.section {
    padding: 5rem 2rem;
}

.section-alt {
    background: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-badge {
    display: inline-block;
    background: rgba(26,58,92,.08);
    color: var(--primary-light);
    padding: .3rem .9rem;
    border-radius: 50px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: .75rem;
}

.section-header h2 {
    font-size: 2.4rem;
    margin-bottom: .75rem;
}

.section-header p {
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto;
}

/* ============================================================
   KARTU FITUR
   ============================================================ */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

.card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: .3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.icon-blue { background: rgba(37,99,168,.12); color: var(--primary-light); }
.icon-gold { background: rgba(232,160,32,.15); color: var(--accent); }
.icon-teal { background: rgba(13,148,136,.12); color: var(--teal); }
.icon-red  { background: rgba(220,38,38,.1);   color: var(--danger); }

.card h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.card p { color: var(--text-muted); font-size: .92rem; }

/* ============================================================
   BERITA CARD
   ============================================================ */
.news-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: .3s;
}

.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-card-body { padding: 1.5rem; }

.news-badge {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--teal);
    margin-bottom: .5rem;
}

.news-card h3 { font-size: 1.05rem; margin-bottom: .5rem; line-height: 1.4; }
.news-meta { font-size: .8rem; color: var(--text-muted); margin-top: .75rem; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.login-left {
    background: linear-gradient(160deg, var(--primary) 0%, #0f2744 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: rgba(232,160,32,.08);
    border-radius: 50%;
}

.login-left h2 { color: white; font-size: 2rem; margin-bottom: 1rem; }
.login-left p { color: rgba(255,255,255,.7); text-align: center; }

.login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--bg);
}

.login-box {
    width: 100%;
    max-width: 420px;
}

.login-box h3 {
    font-size: 1.8rem;
    margin-bottom: .5rem;
}

.login-box p { color: var(--text-muted); margin-bottom: 2rem; }

.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-weight: 700;
    font-size: .875rem;
    margin-bottom: .4rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: .7rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-size: .95rem;
    color: var(--text);
    background: white;
    transition: .2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37,99,168,.12);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2.5rem;
}

/* ============================================================
   BUTTON
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .65rem 1.4rem;
    border-radius: var(--radius-sm);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: .92rem;
    border: none;
    cursor: pointer;
    transition: .2s;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); color: white; transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: var(--primary); }
.btn-accent:hover { background: var(--accent-light); color: var(--primary); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { border: 2px solid var(--border); color: var(--text); background: white; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: .4rem .9rem; font-size: .82rem; }
.btn-full { width: 100%; justify-content: center; }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: var(--primary);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand .brand-name {
    color: white;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1rem;
}

.sidebar-brand .brand-role {
    color: var(--accent-light);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-menu {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-group-label {
    padding: .5rem 1.5rem;
    font-size: .68rem;
    font-weight: 700;
    color: rgba(255,255,255,.35);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: .5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.5rem;
    color: rgba(255,255,255,.7);
    font-size: .9rem;
    font-weight: 600;
    transition: .2s;
    position: relative;
}

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

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.sidebar-link .icon { font-size: 1.1rem; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,.08);
}

.user-mini {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.user-mini .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 800;
    font-size: .9rem;
    flex-shrink: 0;
}

.user-mini .name { color: white; font-size: .85rem; font-weight: 700; }
.user-mini .role-badge { color: rgba(255,255,255,.5); font-size: .72rem; }

/* MAIN CONTENT */
.dashboard-main {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: white;
    padding: .85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--primary); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-notif {
    position: relative;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.notif-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.content-area {
    padding: 2rem;
    flex: 1;
}

/* ============================================================
   STAT CARDS (DASHBOARD)
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

/* ============================================================
   TABLE
   ============================================================ */
.table-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

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

.table-head h4 { font-size: 1rem; margin: 0; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
thead th {
    background: var(--bg);
    padding: .75rem 1rem;
    text-align: left;
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: .875rem 1rem;
    font-size: .88rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(26,58,92,.025); }

/* ============================================================
   BADGE / STATUS
   ============================================================ */
.badge {
    display: inline-block;
    padding: .25rem .65rem;
    border-radius: 50px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.badge-success { background: rgba(22,163,74,.12); color: var(--success); }
.badge-warning { background: rgba(217,119,6,.12);  color: var(--warning); }
.badge-danger  { background: rgba(220,38,38,.1);   color: var(--danger); }
.badge-primary { background: rgba(37,99,168,.12);  color: var(--primary-light); }
.badge-muted   { background: var(--border);        color: var(--text-muted); }

/* ============================================================
   ALERT
   ============================================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: .9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.alert-success { background: rgba(22,163,74,.1);  color: #15803d; border: 1px solid rgba(22,163,74,.2); }
.alert-danger  { background: rgba(220,38,38,.08); color: #b91c1c; border: 1px solid rgba(220,38,38,.2); }
.alert-warning { background: rgba(217,119,6,.1);  color: #92400e; border: 1px solid rgba(217,119,6,.2); }
.alert-info    { background: rgba(37,99,168,.1);  color: var(--primary); border: 1px solid rgba(37,99,168,.2); }

/* ============================================================
   FOOTER PUBLIK
   ============================================================ */
.footer {
    background: var(--primary);
    color: rgba(255,255,255,.75);
    padding: 4rem 2rem 0;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: rgba(255,255,255,.65); font-size: .88rem; transition: .2s; }
.footer-links a:hover { color: var(--accent-light); }

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 1.25rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .82rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .hero-content { grid-template-columns: 1fr; text-align: center; }
    .hero h1 { font-size: 2.2rem; }
    .hero-visual { display: none; }
    .login-page { grid-template-columns: 1fr; }
    .login-left { display: none; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .dashboard-main { margin-left: 0; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.w-100 { width: 100%; }
