/*
 * CSS Dasar Klasik (Gaya Bootstrap Sederhana) - Gudang BHS YIA
 * Rapi, bersih, mudah dibaca, tanpa efek berlebihan
 */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    margin: 0;
    padding: 28px 32px;
    font-size: 14px;
    line-height: 1.6;
}

a {
    color: #0d6efd;
    text-decoration: none;
}

a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

h1, h2, h3, h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #212529;
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 21px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
h4 { font-size: 14px; }

p {
    margin-top: 0;
    margin-bottom: 12px;
}

hr {
    border: 0;
    border-top: 1px solid #dee2e6;
    margin: 18px 0;
}

code {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    color: #212529;
}

/* Container Desktop Lebih Lebar & Lega */
.page-wrapper {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
}

/* Header & Navigasi */
.site-header {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 18px 24px;
    margin-bottom: 22px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #212529;
    text-decoration: none;
}

.brand-link:hover {
    color: #212529;
    text-decoration: none;
}

.brand-logo {
    height: 36px;
    width: auto;
    display: block;
}

.brand-title {
    font-size: 18px;
    font-weight: 600;
    display: block;
    line-height: 1.25;
    color: #212529;
}

.header-meta {
    text-align: right;
    font-size: 13px;
}

.header-shift-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.header-clock {
    font-weight: 600;
    color: #212529;
}

.header-user-row {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    color: #495057;
}

/* Menu Navigasi */
.nav-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid #dee2e6;
    margin-top: 14px;
    padding-top: 14px;
    font-size: 13px;
}

.nav-bar a {
    color: #495057;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}

.nav-bar a:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #0d6efd;
    text-decoration: none;
}

.nav-bar a.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
    font-weight: 600;
}

/* Sub-navigasi Admin */
.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.admin-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Kotak Konten Putih */
.box {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 22px 26px;
    margin-bottom: 22px;
}

.box-gray {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 18px;
}

.box-warn {
    background-color: #fff3cd;
    border: 1px solid #ffecb5;
    border-radius: 4px;
    color: #664d03;
    padding: 14px 18px;
    margin-bottom: 22px;
}

.auth-box {
    max-width: 440px;
    margin: 20px auto;
}

.auth-box-wide {
    max-width: 540px;
    margin: 20px auto;
}

/* Flexbox Helpers */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.flex-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.flex-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #dee2e6;
}

.filter-input {
    flex: 1 1 220px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.section-header h2,
.section-header h3 {
    margin-bottom: 0;
}

/* Kartu Ringkasan Statistik */
.stat-card {
    flex: 1 1 190px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 16px 18px;
}

.stat-card-green {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.stat-card-amber {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.stat-card-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.stat-card-danger .text-muted,
.stat-card-danger .stat-value {
    color: #842029;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #212529;
    margin: 4px 0 2px;
    line-height: 1.2;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-col {
    flex: 1 1 200px;
}

/* List Bergaris Tipis */
.simple-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #ffffff;
}

.simple-list li {
    padding: 10px 14px;
    border-bottom: 1px solid #dee2e6;
}

.simple-list li:last-child {
    border-bottom: none;
}

.bullet-list {
    margin: 6px 0 0 18px;
    padding: 0;
}

.bullet-list li {
    margin-bottom: 4px;
}

/* Alert Flash */
.alert {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

.alert-info {
    background-color: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

/* Formulir Standar */
label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 13px;
    color: #212529;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="file"],
select,
textarea {
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #ffffff;
    color: #212529;
    max-width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0d6efd;
}

.input-full {
    width: 100%;
}

.form-group {
    margin-bottom: 12px;
}

.radio-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    margin-bottom: 0;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: pointer;
}

/* Tombol Solid Standar */
button,
input[type="submit"],
.btn {
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #f8f9fa;
    color: #212529;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.25;
}

button:hover,
input[type="submit"]:hover,
.btn:hover {
    background-color: #e9ecef;
    color: #212529;
    text-decoration: none;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    color: #ffffff;
}

.btn-success {
    background-color: #198754;
    border-color: #198754;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
    color: #ffffff;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
    color: #ffffff;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

button:disabled {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

/* Badge Status */
.badge {
    display: inline-block;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    color: #495057;
}

.badge-blue { background-color: #cfe2ff; border-color: #b6d4fe; color: #084298; }
.badge-green { background-color: #d1e7dd; border-color: #badbcc; color: #0f5132; }
.badge-red { background-color: #f8d7da; border-color: #f5c2c7; color: #842029; }
.badge-yellow { background-color: #fff3cd; border-color: #ffecb5; color: #664d03; }

/* Tabel Data Bergaris Tipis */
.table-wrap {
    overflow-x: auto;
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 8px;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    font-size: 13px;
    background-color: #ffffff;
}

table.data-table th,
table.data-table td {
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    padding: 11px 14px;
    text-align: left;
    vertical-align: middle;
    line-height: 1.45;
}

table.data-table th:last-child,
table.data-table td:last-child {
    border-right: none;
}

table.data-table th {
    background-color: #f8f9fa;
    color: #212529;
    font-weight: 600;
}

table.data-table tbody tr:last-child td {
    border-bottom: none;
}

table.data-table tbody tr:hover td {
    background-color: #f8f9fa;
}

/* Tabel Roster Jadwal */
table.matrix-table th,
table.matrix-table td {
    padding: 5px 4px;
}

.nowrap {
    white-space: nowrap;
}

/* Modal Dialog Sederhana */
.hidden {
    display: none !important;
}

.simple-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 999;
    overflow-y: auto;
    padding: 20px 16px;
}

.simple-modal-box {
    background-color: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    max-width: 480px;
    margin: 30px auto;
    padding: 18px 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
}

/* FAQ Accordion */
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: #212529;
}

.faq-item p {
    margin-top: 8px;
    margin-bottom: 0;
    color: #495057;
}

/* Kode Shift Sederhana */
.shift-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #ced4da;
    border-radius: 4px;
    min-width: 26px;
    min-height: 24px;
    text-align: center;
    line-height: 1.1;
}

.shift-p { background-color: #0d6efd; color: #ffffff; border-color: #0d6efd; }
.shift-s { background-color: #ffc107; color: #212529; border-color: #ffc107; }
.shift-m { background-color: #ffffff; color: #212529; border-color: #adb5bd; }
.shift-l { background-color: #dc3545; color: #ffffff; border-color: #dc3545; }
.shift-c { background-color: #198754; color: #ffffff; border-color: #198754; }

.col-today {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

.text-muted { color: #6c757d; font-size: 12px; }
.text-red { color: #dc3545; font-weight: 600; }
.text-green { color: #198754; font-weight: 600; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.mb-0 { margin-bottom: 0 !important; }

/* Footer */
.site-footer {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 16px 20px;
    margin-top: 16px;
    font-size: 13px;
    color: #495057;
}

.footer-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-col {
    flex: 1 1 220px;
}

.footer-bottom {
    border-top: 1px solid #dee2e6;
    margin-top: 14px;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
}

/* QR Code Loker & Cetak Label */
.qr-scan-card {
    border-left: 4px solid #198754;
}

/* Global Swap Notification Bar */
.nav-notif-badge {
    display: inline-block;
    background-color: #dc3545;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
    line-height: 1.3;
}

.swap-notif-bar {
    background-color: #fff3cd;
    border: 1px solid #ffecb5;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13px;
}

.swap-notif-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.swap-notif-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.swap-notif-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 10px;
}

.swap-notif-approved {
    border-left: 3px solid #198754;
}

.swap-notif-rejected {
    border-left: 3px solid #dc3545;
}

.swap-notif-pending {
    border-left: 3px solid #ffc107;
}

.qr-print-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.qr-sticker {
    background-color: #ffffff;
    border: 1px dashed #adb5bd;
    border-radius: 4px;
    padding: 12px;
    text-align: center;
    box-sizing: border-box;
    break-inside: avoid;
    page-break-inside: avoid;
}

.qr-size-small .qr-sticker {
    flex: 0 0 calc(33.333% - 8px);
}

.qr-size-medium .qr-sticker {
    flex: 0 0 calc(50% - 6px);
}

.qr-size-large .qr-sticker {
    flex: 0 0 100%;
}

.qr-sticker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 6px;
    margin-bottom: 8px;
    font-size: 12px;
}

.qr-sticker-brand {
    font-weight: 700;
    color: #495057;
}

.qr-sticker-rack {
    background-color: #0d6efd;
    color: #ffffff;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.qr-sticker-code-wrap {
    margin: 6px 0;
}

.qr-sticker-code-wrap svg {
    display: inline-block;
    border: 1px solid #dee2e6;
}

.qr-sticker-name {
    font-weight: 700;
    font-size: 14px;
    color: #212529;
    margin-top: 4px;
}

.qr-sticker-spec {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

.qr-sticker-meta {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 12px;
    color: #495057;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e9ecef;
}

.qr-sticker-hint {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

.qr-sticker-actions {
    margin-top: 8px;
}

/* Mini Game Latih Ingatan */
.memory-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    max-width: 560px;
    margin-top: 14px;
}

.memory-board-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    max-width: 720px;
}

.memory-card {
    min-height: 76px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #e9ecef;
    color: #495057;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 6px;
    cursor: pointer;
    user-select: none;
}

.memory-card:hover {
    background-color: #dee2e6;
}

.memory-card.is-flipped {
    background-color: #cfe2ff;
    border-color: #0d6efd;
    color: #084298;
}

.memory-card.is-matched {
    background-color: #d1e7dd;
    border-color: #198754;
    color: #0f5132;
    cursor: default;
}

.seq-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-width: 360px;
    margin-top: 14px;
}

.seq-pad {
    height: 82px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #f8f9fa;
    color: #212529;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.seq-pad:hover {
    background-color: #e9ecef;
}

.seq-pad.is-lit {
    background-color: #0d6efd;
    border-color: #0a58ca;
    color: #ffffff;
}

.seq-pad.is-wrong {
    background-color: #dc3545;
    border-color: #b02a37;
    color: #ffffff;
}

@media (max-width: 720px) {
    body { padding: 12px; }
    .site-header { padding: 14px 16px; margin-bottom: 14px; }
    .box { padding: 16px; margin-bottom: 16px; }
    .box-gray { padding: 12px 14px; margin-bottom: 14px; }
    .header-meta { text-align: left; width: 100%; }
    .header-shift-row,
    .header-user-row { justify-content: flex-start; }
    .nav-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }
    .nav-bar a {
        white-space: nowrap;
        flex: 0 0 auto;
    }
    table.data-table th,
    table.data-table td {
        padding: 9px 10px;
    }
    .memory-board-6 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .memory-card {
        min-height: 62px;
        font-size: 11px;
    }
    .qr-size-small .qr-sticker,
    .qr-size-medium .qr-sticker {
        flex: 0 0 100%;
    }
}

@media print {
    body { background-color: #ffffff; padding: 0; }
    .page-wrapper { max-width: 100%; }
    .box { border: none; padding: 0; }
    .no-print { display: none !important; }
    .qr-sticker { border: 1px dashed #495057; }
    .qr-sticker-rack {
        background-color: #212529 !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
