/* General Setup */
:root {
    --color-primary: #3498db; /* Biru */
    --color-secondary: #2ecc71; /* Hijau */
    --color-danger: #f39c12; /* Oranye (Pengganti Merah) */
    --color-background: #ecf0f1; /* Abu Muda */
    --color-text: #2c3e50; /* Biru Tua */
    --spectrum-start: #1abc9c; /* Cyan/Biru Muda (Pengganti Merah) */
    --spectrum-end: #9b59b6; /* Ungu */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
}

/* 3D Button and Shadow Effect */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2), 0 5px 0 0 #2980b9; /* 3D Shadow */
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3), 0 3px 0 0 #2980b9;
}

.btn-danger {
    /* Mengganti Merah dengan Oranye yang lebih soft */
    background: linear-gradient(135deg, var(--color-danger), #d35400); 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2), 0 5px 0 0 #b34200;
}

.btn-danger:hover {
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3), 0 3px 0 0 #b34200;
}

/* --- Login Page Styles --- */

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Spectrum Background: Cyan/Biru Muda ke Ungu */
    background: linear-gradient(45deg, var(--spectrum-start), var(--spectrum-end)); 
}

.login-container {
    background-color: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4); /* Stronger 3D shadow */
    width: 350px;
    text-align: center;
}

.login-container h2 {
    color: var(--color-text);
    margin-bottom: 20px;
    text-transform: uppercase;
    position: relative;
}

.login-container h2::after {
    content: "🔑"; /* Simbol */
    position: absolute;
    right: -30px;
    top: -5px;
    font-size: 1.5em;
    color: var(--color-primary);
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    border-color: var(--color-primary);
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    font-size: 1.1em;
    background: linear-gradient(90deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 5px 0 0 #1f6497;
    transition: all 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 0 #1f6497;
}

.login-footer {
    margin-top: 15px;
    font-size: 0.9em;
}

.login-footer a {
    color: var(--color-primary);
    text-decoration: none;
}

.alert {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    font-weight: bold;
}

.alert.error {
    /* Warna error diganti menjadi Oranye yang lebih soft */
    background-color: #fcebe3; 
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}


/* --- Dashboard Styles --- */

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--color-text);
    padding: 15px;
    color: white;
    position: fixed;
    height: 100%;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
}

.sidebar h3 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--color-secondary);
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 10px;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 3px;
}

.sidebar ul li a {
    display: block;
    padding: 15px 10px; /* Padding rapat sesuai dengan sidebar.php */
    text-decoration: none;
    color: white;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    
    /* Efek gradien tetap dipertahankan dari style asli */
    background: linear-gradient(to right, var(--color-text) 50%, var(--spectrum-start) 100%);
    background-size: 200% 100%;
    background-position: right bottom;
}

/* Penyesuaian garis pemisah (hr) agar tidak terlalu renggang */
.sidebar ul li hr {
    border: 0;
    border-top: 1px solid #5c7085;
    margin: 10px 2; /* Jarak vertikal garis pemisah */
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background-position: left bottom;
    color: white;
    transform: translateX(5px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.main-content {
    margin-left: 250px;
    padding: 30px;
    flex-grow: 1;
    width: calc(100% - 250px);
}

.header {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.8em;
    color: var(--color-primary);
}

.user-info {
    text-align: right;
}

.user-info span {
    display: block;
    font-weight: bold;
}

.user-info small {
    color: #7f8c8d;
}

/* Content Panel */
.content-panel {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.content-panel h2 {
    color: var(--color-text);
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Quick Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border-left: 5px solid;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.stat-card.madrasah { border-color: var(--color-primary); } /* Sebelumnya merah */
.stat-card.ptk { border-color: var(--color-secondary); }
.stat-card.siswa { border-color: #f39c12; }
.stat-card.berita { border-color: #9b59b6; }

.stat-card h4 {
    margin-top: 0;
    color: #7f8c8d;
    display: flex;
    align-items: center;
}

.stat-card .icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.stat-card p {
    font-size: 2.5em;
    font-weight: bold;
    margin: 5px 0 0;
    color: var(--color-text);
}
/* --- Modern Dashboard Refresh --- */

/* Reset panel agar lebih kontras */
.main-content {
    background-color: #f0f2f5;
}

.content-panel {
    background-color: transparent;
    box-shadow: none;
    padding: 0;
}

.content-panel h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    border: none;
    margin-bottom: 25px;
}

/* Grid Stats yang lebih rapat dan rapi */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Card Modern Styling */
.stat-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

/* Ikon dengan background bulat lembut */
.stat-card .icon-wrapper {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.stat-card.madrasah .icon-wrapper { background: #e0f2fe; color: var(--color-primary); }
.stat-card.ptk .icon-wrapper { background: #dcfce7; color: var(--color-secondary); }
.stat-card.siswa .icon-wrapper { background: #fef3c7; color: var(--color-danger); }
.stat-card.berita .icon-wrapper { background: #f3e8ff; color: var(--spectrum-end); }

.stat-card h4 {
    font-size: 0.875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin: 0 0 8px 0;
}

.stat-card p {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

/* Box Selamat Datang */
.welcome-hero {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-top: 20px;
}

.welcome-hero h3 {
    color: #1e293b;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.welcome-hero p {
    color: #64748b;
    max-width: 700px;
    line-height: 1.6;
}

/* Tombol Modern (Tanpa 3D kaku) */
.btn-modern-group {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.btn-modern {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
    font-size: 0.9rem;
}

.btn-blue { background: var(--color-primary); color: white; }
.btn-green { background: var(--color-secondary); color: white; }
.btn-modern:hover { opacity: 0.9; transform: scale(1.02); }