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

:root {
    --primary-color: #49ab7c;
    --secondary-color: #3d9168;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --white: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: #95a5a6;
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: #4caf50;
    color: var(--white);
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-block {
    width: 100%;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    display: block;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(73, 171, 124, 0.85), rgba(61, 145, 104, 0.85));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 2000;
}

.login-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.login-card h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-form .form-group {
    text-align: left;
}

.login-hint {
    margin-top: 1rem;
    color: rgba(44, 62, 80, 0.7);
    font-size: 0.9rem;
}

.sim-alert {
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    text-align: left;
    font-size: 0.95rem;
}

.sim-alert-danger {
    background: #fdecea;
    color: #b03a2e;
    border: 1px solid #f5c6cb;
}

.custom-checkbox-container {
    display: flex;
    position: relative;
    padding-left: 32px;
    margin-bottom: 20px;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
    color: #333;
    align-items: flex-start;
}

.custom-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ced4da;
    border-radius: 5px;
    transition: all 0.2s ease-in-out;
}

.custom-checkbox-container:hover input~.checkmark {
    border-color: var(--primary-color);
    background-color: #f8f9fa;
}

.custom-checkbox-container input:checked~.checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(73, 171, 124, 0.4);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox-container input:checked~.checkmark:after {
    display: block;
}

.custom-checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.label-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    margin-top: 1px;
}

.sub-text {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: normal;
    margin-top: 2px;
}

.otp-group {
    text-align: center;
}

.otp-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.simulation-note {
    font-size: 0.85rem;
    background: #fff8e1;
    color: #7a5e00;
    border: 1px solid #f5ddb0;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
}

.otp-input-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.otp-digit-login {
    width: 40px;
    height: 50px;
    text-align: center;
    font-size: 24px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.otp-digit-login:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(73, 171, 124, 0.15);
}

.auth-secondary-links {
    margin-top: 15px;
    text-align: center;
}

.auth-secondary-links a {
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
}

.auth-secondary-links a:hover {
    text-decoration: underline;
}

.training-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(160deg, #eef8f2 0%, #e7f0ff 100%);
}

.training-card {
    max-width: 640px;
    width: 100%;
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.training-card h1 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.training-card p {
    margin-bottom: 0.8rem;
}

.training-footnote {
    font-size: 0.92rem;
    color: #54606d;
    margin-bottom: 1.4rem;
}

.admin-body {
    background: #eef2f5;
}

.admin-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-header h1 {
    margin-bottom: 0.25rem;
}

.admin-header p {
    color: #5b6773;
}

.admin-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    padding: 1rem;
}

.admin-card h2 {
    margin-bottom: 0.8rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.stat-box {
    border: 1px solid #e4e9ee;
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-box span {
    font-size: 0.85rem;
    color: #5a6774;
}

.stat-box strong {
    font-size: 1.4rem;
    color: #1f2d3d;
}

.top-users {
    margin-top: 0.9rem;
}

.top-users h3 {
    font-size: 1rem;
    margin-bottom: 0.45rem;
}

.top-user-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.top-user-chip {
    background: #e8f5ef;
    color: #2d6a4f;
    border: 1px solid #cde9db;
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.86rem;
}

.admin-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

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

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

th,
td {
    border-bottom: 1px solid #e6ebef;
    text-align: left;
    padding: 0.55rem;
    vertical-align: top;
}

thead th {
    background: #f7fafc;
    position: sticky;
    top: 0;
}

.pagination {
    margin-top: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

@media (max-width: 768px) {
    .login-card {
        padding: 1.75rem;
    }

    .admin-wrapper {
        padding: 0.85rem;
    }

    .form-actions {
        justify-content: stretch;
    }

    .form-actions .btn {
        width: 100%;
    }
}
