* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f1f5f9;
}

/* ===================== */
/* LOGIN PAGE */
/* ===================== */

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

.login-header {
    text-align: center;
    margin-bottom: 25px;
}

.login-icon {
    width: 65px;
    height: 65px;
    background: #e9f1ff;
    color: #1e3a8a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    font-size: 28px;
}

.login-header h2 {
    margin: 0;
    color: #1e3a8a;
    font-size: 26px;
}

.login-header p {
    margin: 8px 0 4px 0;
    color: #334155;
    font-weight: bold;
}

.login-header span {
    color: #64748b;
    font-size: 14px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 7px;
}

.form-group input {
    width: 100%;
    padding: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
}

.form-group input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 8px;
}

.login-btn:hover {
    background: #1d4ed8;
}

.login-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 18px;
}

.back-link {
    text-align: center;
    margin-top: 22px;
}

.back-link a {
    color: #1e3a8a;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.back-link a:hover {
    text-decoration: underline;
}

/* ===================== */
/* SIDEBAR ADMIN */
/* ===================== */

.sidebar {
    width: 280px;
    height: 100vh;
    background: #1e3a8a;
    position: fixed;
    left: 0;
    top: 0;
    padding: 25px 20px;
    color: white;
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 35px;
    font-size: 26px;
    letter-spacing: 1px;
}

.sidebar a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 13px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-size: 16px;
}

.sidebar a:hover {
    background: #2563eb;
}

.logout-btn {
    background: #dc2626;
    margin-top: 30px;
}

.logout-btn:hover {
    background: #b91c1c !important;
}

/* ===================== */
/* CONTENT ADMIN */
/* ===================== */

.content {
    margin-left: 280px;
    padding: 35px 25px;
}

.content h1 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #0f172a;
    font-size: 32px;
    text-align: left;
}

/* ===================== */
/* DASHBOARD CARD */
/* ===================== */

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.card h3 {
    margin: 0 0 12px 0;
    color: #1e3a8a;
    font-size: 20px;
}

.number {
    font-size: 32px;
    font-weight: bold;
    color: #000;
}

/* ===================== */
/* BUTTON */
/* ===================== */

.btn {
    display: inline-block;
    background: #2563eb;
    color: white;
    padding: 10px 15px;
    border-radius: 7px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    background: #1d4ed8;
}

.btn-green {
    background: #16a34a;
}

.btn-green:hover {
    background: #15803d;
}

.btn-orange {
    background: #f59e0b;
}

.btn-orange:hover {
    background: #d97706;
}

/* ===================== */
/* TABLE ADMIN */
/* ===================== */

.table-box {
    background: white;
    padding: 15px;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background: #1e3a8a;
    color: white;
    padding: 12px;
    text-align: left;
}

td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

/* ===================== */
/* IMAGE / CHART */
/* ===================== */

img.chart {
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* ===================== */
/* ALERT */
/* ===================== */

.success {
    background: #d1fae5;
    color: #065f46;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

/* ===================== */
/* RESPONSIVE HP */
/* ===================== */

@media screen and (max-width: 800px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 18px;
    }

    .sidebar h2 {
        margin-bottom: 15px;
        font-size: 24px;
    }

    .sidebar a {
        display: inline-block;
        margin: 4px;
        font-size: 14px;
        padding: 10px 12px;
    }

    .logout-btn {
        margin-top: 4px;
    }

    .content {
        margin-left: 0;
        padding: 18px;
    }

    .content h1 {
        font-size: 24px;
        line-height: 1.4;
        text-align: left;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
    }

    .card h3 {
        font-size: 18px;
    }

    .number {
        font-size: 28px;
    }

    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 9px;
    }
}

.small-card {
    box-shadow: none;
    border: 1px solid #e5e7eb;
}

.card p {
    line-height: 1.6;
    color: #334155;
}

.content .card {
    margin-bottom: 20px;
}

.table-box table td {
    vertical-align: top;
}

.table-box {
    margin-top: 12px;
}

.card h3 {
    line-height: 1.4;
}

.table-box th {
    text-align: center;
}

.table-box td {
    text-align: center;
}

.table-box td:first-child,
.table-box th:first-child {
    text-align: left;
    font-weight: bold;
}

.notif-success {
    background: #d1fae5;
    color: #065f46;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: bold;
    border-left: 6px solid #10b981;
}

.notif-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: bold;
    border-left: 6px solid #ef4444;
}

.btn-training {
    background: #2563eb;
    color: white;
    padding: 14px 22px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
}

.btn-training:hover {
    background: #1d4ed8;
}

.toast-success,
.toast-error {
    position: fixed;
    top: 25px;
    right: 25px;
    min-width: 320px;
    max-width: 420px;
    padding: 16px 20px;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    line-height: 1.5;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    animation: toastSlideIn 0.4s ease;
}

.toast-success {
    background: #16a34a;
    border-left: 6px solid #bbf7d0;
}

.toast-error {
    background: #dc2626;
    border-left: 6px solid #fecaca;
}

.toast-hide {
    animation: toastSlideOut 0.5s ease forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(80px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(80px);
    }
}

@media screen and (max-width: 600px) {
    .toast-success,
    .toast-error {
        top: 15px;
        right: 15px;
        left: 15px;
        min-width: auto;
        max-width: none;
    }
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: popupFadeIn 0.25s ease;
}

.popup-box {
    width: 90%;
    max-width: 430px;
    background: #ffffff;
    border-radius: 18px;
    padding: 30px 28px;
    text-align: center;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
    animation: popupScaleIn 0.25s ease;
}

.popup-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 18px auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 38px;
    font-weight: bold;
}

.success-box .popup-icon {
    background: #16a34a;
}

.error-box .popup-icon {
    background: #dc2626;
}

.popup-box h2 {
    margin: 0 0 12px 0;
    color: #1e3a8a;
    font-size: 24px;
}

.popup-box p {
    margin: 0;
    color: #334155;
    font-size: 15px;
    line-height: 1.6;
}

.popup-box button {
    margin-top: 22px;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    background: #1e3a8a;
    color: white;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.popup-box button:hover {
    background: #1d4ed8;
}

.popup-hide {
    animation: popupFadeOut 0.3s ease forwards;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes popupFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes popupScaleIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.alert-popup {
    position: fixed;
    top: 50%;
    left: calc(50% + 170px);
    width: 320px;
    max-width: 90%;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.28);
    transform: translate(-50%, -50%);
    z-index: 99999;
    overflow: hidden;
    animation: popupShow 0.25s ease;
    border: 1px solid #d1d5db;
}

.alert-title {
    background: #f3f4f6;
    padding: 12px 16px;
    font-weight: bold;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
}

.alert-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
}

.alert-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 19px;
}

.success-icon {
    background: #16a34a;
}

.warning-icon {
    background: #f59e0b;
}

.alert-text {
    font-size: 14px;
    color: #111827;
    line-height: 1.5;
}

.alert-footer {
    background: #f9fafb;
    padding: 12px 16px;
    text-align: right;
    border-top: 1px solid #e5e7eb;
}

.alert-footer button {
    padding: 8px 26px;
    border: 1px solid #2563eb;
    background: #ffffff;
    color: #2563eb;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.alert-footer button:hover {
    background: #2563eb;
    color: white;
}

.popup-hide {
    animation: popupHide 0.25s ease forwards;
}

@keyframes popupShow {
    from {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes popupHide {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.95);
    }
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-img {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: white;
    padding: 10px;
}

@media screen and (max-width: 768px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

.btn-small {
    display: inline-block;
    padding: 7px 12px;
    background: #2563eb;
    color: white;
    border-radius: 7px;
    text-decoration: none;
    font-size: 13px;
    margin: 2px;
}

.btn-small:hover {
    background: #1d4ed8;
}

.btn-download {
    background: #16a34a;
}

.btn-download:hover {
    background: #15803d;
}