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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f2f4f7;
    color: #23272f;
    padding: 24px 12px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 10px;
    padding: 28px 32px 36px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}

/* ---------- Kop Surat ---------- */
.kop-surat {
    text-align: center;
    border-bottom: 3px solid #cf1123;
    padding-bottom: 14px;
    margin-bottom: 18px;
}

.kop-surat h2 {
    color: #cf1123;
    letter-spacing: 1px;
    font-size: 22px;
}

.kop-surat h3 {
    margin-top: 4px;
    font-size: 17px;
    color: #1a1a1a;
}

.sub-kegiatan {
    margin-top: 4px;
    font-style: italic;
    color: #555;
    font-size: 14px;
}

/* ---------- Info Bar ---------- */
.info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    background: #fff7f0;
    border: 1px solid #ffd9b3;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}

.info-item .label {
    font-weight: 600;
    color: #cf1123;
    margin-right: 4px;
}

/* ---------- Kelas Tab ---------- */
.kelas-tab {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.tab-link {
    text-decoration: none;
    padding: 7px 16px;
    border-radius: 20px;
    background: #f0f0f0;
    color: #23272f;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #ddd;
    transition: background 0.15s ease, color 0.15s ease;
}

.tab-link:hover {
    background: #ffe1e1;
}

.tab-link.aktif {
    background: #cf1123;
    color: #fff;
    border-color: #cf1123;
}

/* ---------- Alert ---------- */
.alert {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-sukses {
    background: #e6f7ec;
    color: #1f8a4c;
    border: 1px solid #b6ecc9;
}

/* ---------- Ringkasan ---------- */
.ringkasan {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.ring-box {
    text-align: center;
    padding: 12px 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.ring-box span {
    display: block;
    font-size: 22px;
    margin-top: 4px;
}

.ring-hadir { background: #2e9e5b; }
.ring-sakit { background: #e0a83b; }
.ring-izin  { background: #3b82c4; }
.ring-alpa  { background: #cf1123; }

/* ---------- Tabel ---------- */
.tabel-absen {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 20px;
}

.tabel-absen thead th {
    background: #cf1123;
    color: #fff;
    padding: 10px 6px;
    text-align: center;
    font-size: 12.5px;
}

.tabel-absen tbody td {
    border: 1px solid #e3e3e3;
    padding: 8px 6px;
    vertical-align: middle;
}

.tabel-absen tbody tr:nth-child(even) {
    background: #fafafa;
}

.tabel-absen tbody tr:hover {
    background: #fff3ee;
}

.nama-siswa {
    text-align: left;
    font-weight: 500;
}

.center {
    text-align: center;
}

.input-ket {
    width: 100%;
    padding: 5px 6px;
    border: 1px solid #d7d7d7;
    border-radius: 4px;
    font-size: 12.5px;
}

.input-ket:focus {
    outline: none;
    border-color: #cf1123;
}

input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #cf1123;
    cursor: pointer;
}

/* ---------- Aksi Bar ---------- */
.aksi-bar {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-bottom: 26px;
}

.btn {
    border: none;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.15s ease;
}

.btn:hover {
    opacity: 0.9;
}

.btn:active {
    transform: scale(0.97);
}

.btn-simpan {
    background: #cf1123;
    color: #fff;
}

.btn-cetak {
    background: #23272f;
    color: #fff;
}

/* ---------- Tanda Tangan ---------- */
.ttd-area {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    font-size: 13px;
    text-align: center;
}

.ttd-box {
    width: 45%;
}

.ttd-space {
    height: 70px;
}

/* ---------- Print ---------- */
@media print {
    body {
        background: #fff;
        padding: 0;
    }
    .container {
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }
    .no-print {
        display: none !important;
    }
}
