/* Reset & Base */  
*, *::before, *::after {  
    box-sizing: border-box;  
    margin: 0;  
    padding: 0;  
}

body {  
    font-family: Arial, sans-serif;  
    background: #f5f5f5;  
    color: #333;  
    font-size: 15px;  
    line-height: 1.5;  
}

a {  
    color: #0066cc;  
    text-decoration: none;  
}

a:hover {  
    text-decoration: underline;  
}

code {  
    background: #f0f0f0;  
    padding: .15rem .4rem;  
    border-radius: 3px;  
    font-size: .9rem;  
}

ul {  
    padding-left: 1.2rem;  
    line-height: 1.9;  
    font-size: .9rem;  
}

/* Layout */  
.page-center {  
    display: flex;  
    justify-content: center;  
    align-items: flex-start;  
    min-height: 100vh;  
    padding: 3rem 1rem;  
    background: #f0f2f5;  
}

.page-center-middle {  
    display: flex;  
    justify-content: center;  
    align-items: center;  
    min-height: 100vh;  
    background: #f0f2f5;  
}

main {  
    padding: 2rem;  
    max-width: 1100px;  
    margin: 0 auto;  
}

main.narrow {  
    max-width: 800px;  
}

/* Header */  
header {  
    background: #0066cc;  
    color: #fff;  
    padding: 1rem 2rem;  
    display: flex;  
    justify-content: space-between;  
    align-items: center;  
}

header strong {  
    font-size: 1.05rem;  
}

header .header-right {  
    display: flex;  
    align-items: center;  
    gap: 1rem;  
    font-size: .9rem;  
}

/* Navigation */  
nav a {  
    color: #cce0ff;  
    margin-right: 1rem;  
    text-decoration: none;  
    font-size: .9rem;  
}

nav a:hover {  
    color: #fff;  
    text-decoration: none;  
}

.logout-link {  
    color: #fff;  
    font-size: .9rem;  
    text-decoration: none;  
}

.logout-link:hover {  
    text-decoration: underline;  
}

/* Box (Login / Setup) */  
.box {  
    background: #fff;  
    padding: 2rem;  
    border-radius: 8px;  
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);  
    width: 100%;  
    max-width: 460px;  
}

.box h2 {  
    margin-bottom: 1.2rem;  
    text-align: center;  
    color: #0066cc;  
}

/* Cards */  
.card {  
    background: #fff;  
    padding: 1.5rem;  
    border-radius: 8px;  
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);  
    margin-bottom: 1.5rem;  
}

.card h2,  
.card h3 {  
    margin-top: 0;  
    margin-bottom: 1rem;  
}

.card-self-start {  
    align-self: flex-start;  
}

/* Grid */  
.grid-2 {  
    display: grid;  
    grid-template-columns: 1fr 1fr;  
    gap: 1.5rem;  
}

@media (max-width: 700px) {  
    .grid-2 {  
        grid-template-columns: 1fr;  
    }  
}

/* Forms */  
label {  
    display: block;  
    margin: .7rem 0 .25rem;  
    font-weight: bold;  
    font-size: .9rem;  
}

input[type="text"],  
input[type="password"],  
input[type="email"],  
input[type="file"],  
textarea,  
select {  
    width: 100%;  
    padding: .5rem .65rem;  
    border: 1px solid #ccc;  
    border-radius: 4px;  
    font-size: .9rem;  
    font-family: inherit;  
    background: #fff;  
    color: #333;  
}

input[type="text"]:focus,  
input[type="password"]:focus,  
input[type="email"]:focus,  
textarea:focus,  
select:focus {  
    outline: none;  
    border-color: #0066cc;  
    box-shadow: 0 0 0 2px rgba(0, 102, 204, .15);  
}

textarea {  
    resize: vertical;  
}

.form-spacer {  
    margin-top: .8rem;  
}

/* Buttons */  
.btn {  
    display: inline-block;  
    padding: .45rem 1rem;  
    border: none;  
    border-radius: 4px;  
    cursor: pointer;  
    font-size: .88rem;  
    font-family: inherit;  
    text-decoration: none;  
    transition: opacity .15s;  
}

.btn:hover {  
    opacity: .88;  
    text-decoration: none;  
}

.btn-primary {  
    background: #0066cc;  
    color: #fff;  
}

.btn-primary:hover {  
    background: #0055aa;  
    color: #fff;  
}

.btn-danger {  
    background: #cc0000;  
    color: #fff;  
}

.btn-info {  
    background: #17a2b8;  
    color: #fff;  
}

.btn-success {  
    background: #28a745;  
    color: #fff;  
}

.btn-block {  
    display: block;  
    width: 100%;  
    padding: .65rem;  
    font-size: 1rem;  
    text-align: center;  
    margin-top: 1rem;  
}

/* Tables */  
.table-wrap {  
    overflow-x: auto;  
}

table {  
    width: 100%;  
    border-collapse: collapse;  
    font-size: .9rem;  
}

th, td {  
    padding: .65rem .8rem;  
    text-align: left;  
    border-bottom: 1px solid #eee;  
}

th {  
    background: #f0f0f0;  
    font-size: .82rem;  
    text-transform: uppercase;  
    color: #555;  
    font-weight: 600;  
}

tr:hover td {  
    background: #fafafa;  
}

/* Badges */  
.badge {  
    display: inline-block;  
    padding: .18rem .55rem;  
    border-radius: 12px;  
    font-size: .75rem;  
    font-weight: bold;  
    white-space: nowrap;  
}

.badge-admin      { background: #fff3cd; color: #856404; }  
.badge-employee   { background: #d1ecf1; color: #0c5460; }  
.badge-local      { background: #e2e3e5; color: #383d41; }  
.badge-ldap       { background: #cce5ff; color: #004085; }  
.badge-active     { background: #d4edda; color: #155724; }  
.badge-inactive   { background: #f8d7da; color: #721c24; }  
.badge-done       { background: #28a745; color: #fff; }  
.badge-open       { background: #ffc107; color: #333; }

/* Alert Messages */  
.alert {  
    padding: .7rem 1rem;  
    border-radius: 4px;  
    margin-bottom: 1rem;  
    font-size: .92rem;  
}

.alert-success {  
    background: #d4edda;  
    color: #155724;  
    border: 1px solid #c3e6cb;  
}

.alert-error {  
    background: #f8d7da;  
    color: #721c24;  
    border: 1px solid #f5c6cb;  
}

.alert-info {  
    background: #d1ecf1;  
    color: #0c5460;  
    border: 1px solid #bee5eb;  
}

/* Stats Bar */  
.stats-bar {  
    margin-bottom: 1.5rem;  
    display: flex;  
    flex-wrap: wrap;  
    gap: .5rem;  
}

.stat-item {  
    display: inline-block;  
    background: #e9ecef;  
    border-radius: 20px;  
    padding: .25rem .8rem;  
    font-size: .82rem;  
    color: #333;  
}

/* Table Actions */  
.table-actions {  
    display: flex;  
    flex-wrap: wrap;  
    gap: .35rem;  
    align-items: center;  
}

.table-actions .btn {  
    padding: .25rem .65rem;  
    font-size: .8rem;  
}

/* Video Player */  
.training-video {  
    width: 100%;  
    max-height: 420px;  
    border-radius: 6px;  
    margin: .8rem 0;  
    display: block;  
}

/* Header */  
.training-title {  
    display: flex;  
    align-items: center;  
    gap: .6rem;  
    flex-wrap: wrap;  
    margin-bottom: .6rem;  
}

.training-title h3 {  
    margin: 0;  
}

/* Setup Steps */  
.step-indicator {  
    color: #666;  
    font-size: .85rem;  
    margin-bottom: 1rem;  
}

/* Back Link */  
.back-link {  
    display: inline-block;  
    margin-bottom: 1rem;  
    font-size: .9rem;  
}

/* Hidden Utility */  
.hidden {  
    display: none;  
}


/* Groups */
.group-card {
    border-left: 4px solid #0066cc;
}

.group-header {
    margin-bottom: 1.2rem;
}

.group-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .3rem;
}

.group-title-row h2 {
    margin: 0;
}

.group-actions {
    display: flex;
    gap: .4rem;
    flex-shrink: 0;
}

.group-meta {
    font-size: .85rem;
    color: #666;
}

.group-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 800px) {
    .group-sections {
        grid-template-columns: 1fr;
    }
}

.group-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.group-section-header {
    margin-bottom: .8rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid #dee2e6;
}

.group-section-header h3 {
    margin: 0;
    font-size: .95rem;
}

.inline-form {
    display: flex;
    gap: .4rem;
    margin-top: .8rem;
    align-items: center;
}

.inline-form select {
    flex: 1;
    min-width: 0;
}

.empty-hint {
    font-size: .85rem;
    color: #888;
    font-style: italic;
    margin: .5rem 0;
}

.member-tag {
    display: inline-block;
    background: #e9ecef;
    border-radius: 4px;
    padding: .2rem .55rem;
    font-size: .8rem;
    margin: .15rem;
}

/* Progress Bars */
.progress-bar-wrap {
    background: #e9ecef;
    border-radius: 20px;
    height: 10px;
    width: 120px;
    display: inline-block;
    vertical-align: middle;
    margin-right: .4rem;
}

.progress-bar {
    height: 10px;
    border-radius: 20px;
    background: #28a745;
    transition: width .3s;
}

.progress-bar.low {
    background: #dc3545;
}

.progress-bar.mid {
    background: #ffc107;
}

/* Quiz */
.quiz-section {
    border-top: 2px solid #0066cc;
    padding-top: 1.2rem;
    margin-top: 1.2rem;
}

.question-block {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
}

.question-block h4 {
    margin: 0 0 .6rem;
    font-size: .95rem;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: .9rem;
}

.answer-option:hover {
    background: #e9ecef;
}

.answer-option input[type="radio"] {
    width: auto;
}

.answer-option.correct {
    background: #d4edda;
    color: #155724;
}

.answer-option.wrong {
    background: #f8d7da;
    color: #721c24;
}

.quiz-result-box {
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 1rem;
}

.quiz-result-box.passed {
    background: #d4edda;
    color: #155724;
}

.quiz-result-box.failed {
    background: #f8d7da;
    color: #721c24;
}

/* Admin Quiz Builder */
.question-builder {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fff;
}

.answer-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .4rem;
}

.answer-row input[type="text"] {
    flex: 1;
}

.answer-row input[type="radio"] {
    width: auto;
    flex-shrink: 0;
}

/* Training List (Employee) */
.training-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 1rem;
    border-bottom: 1px solid #eee;
    gap: 1rem;
}

.training-list-item:last-child {
    border-bottom: none;
}

.training-list-item:hover {
    background: #f8f9fa;
}

.training-list-info {
    flex: 1;
}

.training-list-info strong {
    display: block;
    margin-bottom: .2rem;
}

.training-list-info small {
    color: #888;
    font-size: .8rem;
}

.training-list-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

/* Detail Page */
.training-header {
    margin-bottom: 1rem;
}

.training-header h2 {
    margin: 0 0 .4rem;
}

.section-divider {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: 1.5rem 0;
}

/* Checkbox List */
.checkbox-list {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: .6rem;
    max-height: 220px;
    overflow-y: auto;
    background: #f8f9fa;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .5rem;
    border-radius: 4px;
    font-weight: normal;
    font-size: .9rem;
    margin: 0;
    cursor: pointer;
}

.checkbox-item:hover {
    background: #e9ecef;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}
/* Steps Progress */
.steps-progress {
    display: flex;
    gap: .5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.step-dot {
    flex: 1;
    text-align: center;
    padding: .5rem;
    border-radius: 4px;
    font-size: .85rem;
    font-weight: bold;
    background: #e9ecef;
    color: #888;
}

.step-dot.active {
    background: #cce5ff;
    color: #004085;
}

.step-dot.done {
    background: #d4edda;
    color: #155724;
}

.step-locked {
    opacity: .5;
    pointer-events: none;
}

/* Star Rating */
.star-rating {
    display: flex;
    gap: .2rem;
    margin: .5rem 0;
}

.star-rating .star-label {
    cursor: pointer;
    font-size: 1.8rem;
    color: #ddd;
    margin: 0;
    font-weight: normal;
}

.star-rating .star-label input {
    display: none;
}

.star-rating .star-label .star {
    transition: color .15s;
}

.star-display .star {
    font-size: 1.4rem;
    color: #ddd;
}

.star-display .star.filled {
    color: #ffc107;
}
/* Filter Bar */
.filter-bar {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: .8rem;
}

.filter-bar input,
.filter-bar select {
    min-width: 0;
}
/* Checked checkbox items highlight */
.checkbox-item:has(input:checked) {
    background: #e8f4fd;
    border-radius: 4px;
}