/* D:\xampp\htdocs\sim-bk\assets\css\style.css */

/* ========== ROOT VARIABLES ========== */
:root {
    --primary: #1a3a5c;
    --primary-dark: #0f2744;
    --primary-light: #2c5282;
    --secondary: #2b6cb0;
    --accent: #3182ce;
    --bg-light: #edf2f7;
    --bg-card: rgba(255, 255, 255, 0.95);
    --text-dark: #1a202c;
    --text-light: #718096;
    --success: #38a169;
    --danger: #e53e3e;
    --warning: #d69e2e;
    --info: #3182ce;
    --sidebar-width: 260px;
    --header-height: 60px;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

/* ========== GLOBAL ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========== LOGIN PAGE ========== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--secondary) 100%);
    padding: 20px;
}

.login-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 50px 40px;
    width: 100%;
    max-width: 900px;
    text-align: center;
    color: #fff;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.login-container .logo-yayasan {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.login-container h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.login-container .subtitle {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 5px;
}

.login-container .school-name {
    font-size: 13px;
    opacity: 0.75;
    margin-bottom: 30px;
}

.login-container .divider-text {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 25px;
}

.login-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.login-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 25px 15px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: #fff;
}

.login-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.login-card img {
    width: 65px;
    height: 65px;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.login-card .admin-icon {
    width: 65px;
    height: 65px;
    background: #e67e22;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
}

.login-card h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
}

.login-card p {
    font-size: 11px;
    opacity: 0.75;
    margin: 0;
}

.login-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 20px;
    font-size: 12px;
    opacity: 0.6;
}

/* ========== LOGIN FORM PAGE ========== */
.login-form-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--secondary) 100%);
    padding: 20px;
}

.login-form-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    color: #fff;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.login-form-container .logo-unit {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.login-form-container h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
}

.login-form-container .unit-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 25px;
}

.form-floating-custom {
    position: relative;
    margin-bottom: 15px;
}

.form-floating-custom input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-floating-custom input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-floating-custom input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.form-floating-custom .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #e67e22, #d35400);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #d35400, #c0392b);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(211, 84, 0, 0.4);
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    transition: var(--transition);
}

.back-link:hover {
    color: #fff;
}

/* ========== LAYOUT ========== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    transition: var(--transition);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header img {
    width: 55px;
    height: 55px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.sidebar-header h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
}

.sidebar-header small {
    font-size: 11px;
    opacity: 0.7;
}

.sidebar-menu {
    padding: 15px 0;
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 2px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    font-size: 14px;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-left-color: #e67e22;
}

.sidebar-menu li a i {
    width: 22px;
    margin-right: 12px;
    text-align: center;
    font-size: 16px;
}

.sidebar-menu .menu-label {
    padding: 15px 20px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    font-weight: 600;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== TOP HEADER ========== */
.top-header {
    background: #fff;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 999;
}

.top-header .toggle-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--primary);
    cursor: pointer;
}

.top-header .page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.top-header .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-header .user-info span {
    font-size: 13px;
    color: var(--text-light);
}

.top-header .user-info .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* ========== PAGE CONTENT ========== */
.page-content {
    padding: 25px;
    flex: 1;
}

/* ========== CARDS / STATS ========== */
.stat-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid var(--primary);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card.pelanggaran {
    border-left-color: var(--danger);
}

.stat-card.prestasi {
    border-left-color: var(--success);
}

.stat-card.total {
    border-left-color: var(--info);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    margin-bottom: 12px;
}

.stat-card .stat-icon.bg-primary { background: var(--primary); }
.stat-card .stat-icon.bg-danger { background: var(--danger); }
.stat-card .stat-icon.bg-success { background: var(--success); }
.stat-card .stat-icon.bg-info { background: var(--info); }
.stat-card .stat-icon.bg-warning { background: var(--warning); }

.stat-card .stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 3px;
}

/* ========== DATA TABLE CARD ========== */
.data-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-card .card-header-custom {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 18px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.data-card .card-header-custom h5 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.data-card .card-body-custom {
    padding: 20px;
}

/* ========== TABLE ========== */
.table-custom {
    width: 100%;
    border-collapse: collapse;
}

.table-custom thead th {
    background: var(--bg-light);
    padding: 12px 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
    white-space: nowrap;
}

.table-custom tbody td {
    padding: 12px 15px;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background: #f7fafc;
}

.table-custom .foto-mini {
    width: 40px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    border: 2px solid #e2e8f0;
}

.table-custom .nama-siswa-link {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.table-custom .nama-siswa-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ========== BADGES ========== */
.badge-custom {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-pelanggaran {
    background: #fee2e2;
    color: #dc2626;
}

.badge-prestasi {
    background: #dcfce7;
    color: #16a34a;
}

.badge-sd {
    background: #dbeafe;
    color: #2563eb;
}

.badge-smp {
    background: #fef3c7;
    color: #d97706;
}

.badge-sma {
    background: #ede9fe;
    color: #7c3aed;
}

/* ========== BUTTONS ========== */
.btn-custom {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-primary-custom {
    background: var(--primary);
    color: #fff;
}

.btn-primary-custom:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
}

.btn-success-custom {
    background: var(--success);
    color: #fff;
}

.btn-success-custom:hover {
    background: #2f855a;
    color: #fff;
}

.btn-warning-custom {
    background: var(--warning);
    color: #fff;
}

.btn-warning-custom:hover {
    background: #b7791f;
    color: #fff;
}

.btn-danger-custom {
    background: var(--danger);
    color: #fff;
}

.btn-danger-custom:hover {
    background: #c53030;
    color: #fff;
}

.btn-info-custom {
    background: var(--info);
    color: #fff;
}

.btn-info-custom:hover {
    background: #2b6cb0;
    color: #fff;
}

.btn-sm-custom {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-group-action {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* ========== DETAIL SISWA ========== */
.detail-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.detail-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 30px;
    text-align: center;
}

.foto-3x4 {
    width: 113px;
    height: 151px;
    object-fit: cover;
    border-radius: 8px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.detail-body {
    padding: 30px;
}

.detail-table {
    width: 100%;
}

.detail-table tr td {
    padding: 10px 15px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-table tr td:first-child {
    font-weight: 600;
    color: var(--text-light);
    width: 200px;
    white-space: nowrap;
}

.poin-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 18px;
}

.poin-box.pelanggaran {
    background: #fee2e2;
    color: #dc2626;
}

.poin-box.prestasi {
    background: #dcfce7;
    color: #16a34a;
}

/* ========== FORMS ========== */
.form-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.form-card .form-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 18px 25px;
}

.form-card .form-header h5 {
    margin: 0;
    font-size: 16px;
}

.form-card .form-body {
    padding: 25px;
}

.form-label-custom {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.form-control-custom {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    transition: var(--transition);
}

.form-control-custom:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.foto-preview {
    width: 113px;
    height: 151px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid #e2e8f0;
}

/* ========== SEARCH BOX ========== */
.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 14px 8px 35px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 13px;
    outline: none;
    width: 220px;
    transition: var(--transition);
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.6);
}

.search-box input:focus {
    background: rgba(255,255,255,0.25);
    width: 280px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 13px;
}

/* ========== FOOTER ========== */
.main-footer {
    background: #fff;
    padding: 15px 25px;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    border-top: 1px solid #e2e8f0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    .login-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .top-header .toggle-sidebar {
        display: block;
    }

    .login-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .login-container {
        padding: 30px 20px;
    }

    .login-container h1 {
        font-size: 22px;
    }

    .detail-table tr td:first-child {
        width: auto;
    }

    .page-content {
        padding: 15px;
    }

    .stat-card .stat-number {
        font-size: 22px;
    }
}

@media (max-width: 576px) {
    .login-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .login-card {
        padding: 20px 10px;
    }

    .login-card img {
        width: 50px;
        height: 50px;
    }

    .login-card .admin-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }

    .btn-group-action {
        flex-direction: column;
    }
}

/* ========== SIDEBAR OVERLAY ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* ========== SCROLLBAR ========== */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* ========== ANIMATION ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

/* ========== MODAL CUSTOM ========== */
.modal-header-custom {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}

.modal-header-custom .btn-close {
    filter: brightness(0) invert(1);
}