/*
 * SiPintarKu — tambahan di atas Flowbite (prebuilt Tailwind v4).
 * flowbite.min.css hanya berisi utility yang dipakai komponen Flowbite; utility lain yang
 * dipakai aplikasi didefinisikan di bawah. Cek kelengkapan: php cli/check_css.php
 */

/* ---------- 1. Utility Tailwind tambahan ---------- */
.text-gray-700 { color: #374151; }
.text-green-50 { color: #f0fdf4; }
.text-green-100 { color: #dcfce7; }
.text-amber-700 { color: #b45309; }
.bg-amber-100 { background-color: #fef3c7; }
.border-red-200 { border-color: #fecaca; }
.border-yellow-200 { border-color: #fef08a; }
.border-l-4 { border-left-width: 4px; border-left-style: solid; }
.placeholder-red-400::placeholder { color: #f87171; }
.rounded-2xl { border-radius: 1rem; }
.min-h-screen { min-height: 100vh; }
.min-h-24 { min-height: 6rem; }
.max-w-28 { max-width: 7rem; }
.max-w-40 { max-width: 10rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-screen-sm { max-width: 640px; }
.pe-11 { padding-inline-end: 2.75rem; }
.overflow-auto { overflow: auto; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.hover\:bg-green-50:hover { background-color: #f0fdf4; }
.hover\:text-gray-700:hover { color: #374151; }
.hover\:text-green-700:hover { color: #15803d; }
.hover\:text-green-800:hover { color: #166534; }
.hover\:text-red-600:hover { color: #dc2626; }
.focus\:ring-green-600:focus { --tw-ring-color: #16a34a; }
.disabled\:opacity-60:disabled { opacity: .6; cursor: not-allowed; }
@media (min-width: 640px) {
    .sm\:inline { display: inline; }
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 768px) {
    .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
}
@media (min-width: 1024px) {
    .lg\:inline-flex { display: inline-flex; }
    .lg\:text-9xl { font-size: 8rem; line-height: 1; }
}

/* ---------- 2. Komponen aplikasi ---------- */
.auth-bg { background: linear-gradient(135deg, #14532d 0%, #15803d 55%, #22c55e 100%); }

.avatar-initial {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 2.5rem; height: 2.5rem; border-radius: 9999px;
    background: #15803d; color: #fff; font-weight: 700;
}
.avatar-initial.avatar-lg { width: 3.5rem; height: 3.5rem; font-size: 1.5rem; }

/* Breadcrumb: <li class="before-slash"> */
.before-slash::before { content: "/"; margin: 0 .35rem; color: #9ca3af; }

/* Sidebar */
.menu-soon { opacity: .6; cursor: not-allowed; }
[aria-expanded="true"] > .submenu-caret { transform: rotate(180deg); }

/* ---------- 3. DataTables bergaya Flowbite ---------- */
.dataTables_wrapper { font-size: .875rem; color: #4b5563; }
.dataTables_wrapper .dt-top,
.dataTables_wrapper .dt-bottom { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.dataTables_wrapper .dt-top { margin-bottom: 1rem; }
.dataTables_wrapper .dt-bottom { margin-top: 1rem; }
.dataTables_wrapper select,
.dataTables_wrapper input[type="search"] {
    background: #f9fafb; border: 1px solid #d1d5db; border-radius: .5rem; padding: .45rem .75rem;
    font-size: .875rem; color: #111827; margin: 0 .35rem;
}
.dataTables_wrapper select { padding-right: 2rem; }
.dataTables_wrapper input[type="search"]:focus,
.dataTables_wrapper select:focus { outline: none; border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22, 163, 74, .25); }
table.dataTable { width: 100% !important; border-collapse: collapse; }
table.dataTable thead th {
    padding: .75rem 1rem; font-weight: 600; text-align: left; white-space: nowrap;
    border-bottom: 1px solid #e5e7eb; position: relative;
}
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc { cursor: pointer; padding-right: 1.5rem; }
table.dataTable thead .sorting::after { content: "\2195"; position: absolute; right: .5rem; opacity: .3; }
table.dataTable thead .sorting_asc::after { content: "\2191"; position: absolute; right: .5rem; color: #15803d; }
table.dataTable thead .sorting_desc::after { content: "\2193"; position: absolute; right: .5rem; color: #15803d; }
table.dataTable tbody td { padding: .7rem 1rem; border-bottom: 1px solid #f3f4f6; vertical-align: top; }
table.dataTable tbody tr:hover { background: #f9fafb; }
table.dataTable td.dataTables_empty { text-align: center; color: #9ca3af; padding: 2rem; }
.dataTables_wrapper .dataTables_processing {
    position: absolute; top: 40%; left: 50%; transform: translateX(-50%); z-index: 10;
    background: #fff; border: 1px solid #e5e7eb; border-radius: .5rem; padding: .5rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}
.dataTables_wrapper { position: relative; }
.dataTables_paginate { display: inline-flex; }
.dataTables_paginate .paginate_button {
    display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; height: 2.25rem;
    padding: 0 .65rem; margin-left: -1px; border: 1px solid #d1d5db; background: #fff; color: #4b5563; cursor: pointer;
}
.dataTables_paginate .paginate_button:first-child { border-radius: .5rem 0 0 .5rem; }
.dataTables_paginate .paginate_button:last-child { border-radius: 0 .5rem .5rem 0; }
.dataTables_paginate .paginate_button:hover { background: #f0fdf4; color: #166534; }
.dataTables_paginate .paginate_button.current { background: #15803d; border-color: #15803d; color: #fff; }
.dataTables_paginate .paginate_button.disabled { color: #d1d5db; cursor: default; background: #fff; }
.dataTables_paginate .ellipsis { padding: 0 .5rem; }
/* Responsive (child row) */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control { position: relative; padding-left: 2.25rem; cursor: pointer; }
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before {
    content: "+"; position: absolute; left: .7rem; top: .7rem; width: 1.1rem; height: 1.1rem; line-height: 1.1rem;
    text-align: center; border-radius: 9999px; background: #15803d; color: #fff; font-size: .8rem; font-weight: 700;
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control::before { content: "\2212"; background: #b91c1c; }
table.dataTable > tbody > tr.child ul.dtr-details { list-style: none; margin: 0; padding: 0; }
table.dataTable > tbody > tr.child ul.dtr-details > li { padding: .35rem 0; border-bottom: 1px solid #f3f4f6; }
table.dataTable > tbody > tr.child span.dtr-title { display: inline-block; min-width: 6rem; font-weight: 600; color: #374151; }

/* ---------- 4. Select2 bergaya Flowbite ---------- */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 2.6rem; background: #f9fafb; border: 1px solid #d1d5db; border-radius: .5rem;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 2.5rem; padding-left: .75rem; color: #111827; font-size: .875rem; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 2.5rem; right: .4rem; }
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22, 163, 74, .25); }
.select2-dropdown { border-color: #d1d5db; border-radius: .5rem; overflow: hidden; font-size: .875rem; }
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: #15803d; }
.select2-container--default .select2-selection--multiple .select2-selection__choice { background: #dcfce7; border-color: #bbf7d0; color: #166534; border-radius: .375rem; }

/* ---------- 5. SweetAlert2 ---------- */
.swal2-popup { border-radius: 1rem !important; font-family: inherit; }
.swal2-styled { border-radius: .5rem !important; font-weight: 500 !important; }
.swal2-styled:focus { box-shadow: 0 0 0 3px rgba(22, 163, 74, .35) !important; }

/* ---------- 6. Utility tambahan (Tahap 2) ---------- */
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.h-32 { height: 8rem; }
.min-w-28 { min-width: 7rem; }
.min-w-44 { min-width: 11rem; }
.min-w-48 { min-width: 12rem; }
.min-w-56 { min-width: 14rem; }
.normal-case { text-transform: none; }
.object-contain { object-fit: contain; }
.opacity-75 { opacity: .75; }
.border-amber-200 { border-color: #fde68a; }
.border-blue-200 { border-color: #bfdbfe; }
.border-green-200 { border-color: #bbf7d0; }
.hover\:bg-amber-50:hover { background-color: #fffbeb; }
.hover\:bg-red-50:hover { background-color: #fef2f2; }
@media (min-width: 640px) {
    .sm\:col-span-2 { grid-column: span 2 / span 2; }
    .sm\:items-end { align-items: flex-end; }
}
@media (min-width: 1024px) {
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
}

/* ---------- 7. Absensi (Tahap 3) ---------- */
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg span { display: inline-flex; align-items: center; justify-content: center; min-width: 2.1rem; height: 2.1rem; padding: 0 .4rem;
    border: 1px solid #d1d5db; border-radius: .5rem; font-weight: 600; font-size: .8rem; color: #4b5563; background: #fff; user-select: none; }
.seg input:focus-visible + span { outline: 2px solid #16a34a; outline-offset: 1px; }
.seg input:disabled + span { cursor: not-allowed; opacity: .6; }
.seg input:checked + .seg-H { background: #15803d; border-color: #15803d; color: #fff; }
.seg input:checked + .seg-T { background: #ca8a04; border-color: #ca8a04; color: #fff; }
.seg input:checked + .seg-S { background: #2563eb; border-color: #2563eb; color: #fff; }
.seg input:checked + .seg-I { background: #4b5563; border-color: #4b5563; color: #fff; }
.seg input:checked + .seg-A { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.seg input:checked + .seg-x { background: #f3f4f6; border-color: #9ca3af; color: #111827; }
.rekap-bulanan td, .rekap-bulanan th { border-right: 1px solid #f3f4f6; }
.cell { display: inline-block; width: 1.35rem; line-height: 1.35rem; border-radius: .25rem; font-weight: 700; }
.cell-H { background: #dcfce7; color: #166534; } .cell-T { background: #fef9c3; color: #854d0e; }
.cell-S { background: #dbeafe; color: #1e40af; } .cell-I { background: #e5e7eb; color: #374151; }
.cell-A { background: #fecaca; color: #991b1b; }
.left-8 { left: 2rem; }
#reader video { width: 100% !important; border-radius: .5rem; }
/* Jurnal KAIH: toggle centang besar (ramah HP) */
.toggle-kaih { position: relative; display: inline-flex; cursor: pointer; }
.toggle-kaih input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-kaih span { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem;
    border: 2px solid #d1d5db; border-radius: .75rem; background: #fff; color: transparent; font-size: 1.1rem; transition: all .15s; }
.toggle-kaih input:checked + span { background: #15803d; border-color: #15803d; color: #fff; }
.toggle-kaih input:focus-visible + span { outline: 2px solid #16a34a; outline-offset: 2px; }
.toggle-kaih input:disabled + span { opacity: .6; cursor: not-allowed; }
label.has-checked:has(input:checked) { border-color: #15803d; background: #f0fdf4; }
.align-top { vertical-align: top; }
.min-w-16 { min-width: 4rem; }
.opacity-60 { opacity: .6; }
@media (min-width: 640px) {
    .sm\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .sm\:grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

/* ---------- 8. Dashboard (Tahap 4) ---------- */
.bg-amber-50 { background-color: #fffbeb; }
.hover\:bg-amber-100:hover { background-color: #fef3c7; }
.text-amber-600 { color: #d97706; }
.first\:border-0:first-child { border-width: 0; }
.ring-green-600 { --tw-ring-color: #16a34a; box-shadow: 0 0 0 1px #16a34a; }
@media (min-width: 1024px) { .lg\:col-span-1 { grid-column: span 1 / span 1; } }

/* ---------- 9. Akademik (Tahap 5) ---------- */
@media (min-width: 640px) { .sm\:w-80 { width: 20rem; } }
@media (min-width: 1024px) { .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .xl\:col-span-3 { grid-column: span 3 / span 3; }
}
kbd { padding: 0 .3rem; border: 1px solid #d1d5db; border-bottom-width: 2px; border-radius: .25rem; background: #fff; font-size: .7rem; font-family: inherit; }

/* ---------- 10. Ujian online (Tahap 6) ---------- */
.align-middle { vertical-align: middle; }
.min-h-0 { min-height: 0; }
.min-w-40 { min-width: 10rem; }
.max-h-32 { max-height: 8rem; }
.max-h-40 { max-height: 10rem; }
.max-h-64 { max-height: 16rem; }
.max-h-80 { max-height: 20rem; }
.max-h-\[32rem\] { max-height: 32rem; }
.text-amber-800 { color: #92400e; }
.text-white\/80 { color: rgb(255 255 255 / .8); }
.text-white\/90 { color: rgb(255 255 255 / .9); }
.ring-green-200 { --tw-ring-color: #bbf7d0; }
.hover\:border-green-500:hover { border-color: #22c55e; }
.hover\:border-green-600:hover { border-color: #16a34a; }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1); }
@media (min-width: 1024px) {
    .lg\:grid-cols-\[1fr_16rem\] { grid-template-columns: 1fr 16rem; }
    .lg\:top-20 { top: 5rem; }
}
@media (min-width: 1280px) { .xl\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 11. Administrasi (Tahap 7) ---------- */
.border-s-red-500 { border-inline-start-color: #ef4444; }
.col-span-full { grid-column: 1 / -1; }
.gap-y-2 { row-gap: .5rem; }
.hover\:bg-red-100:hover { background-color: #fee2e2; }
.max-w-3xl { max-width: 48rem; }
.ml-5 { margin-left: 1.25rem; }
.my-1 { margin-top: .25rem; margin-bottom: .25rem; }
.text-yellow-600 { color: #ca8a04; }
@media (min-width: 1024px) {
    .lg\:items-center { align-items: center; }
    .lg\:items-start { align-items: flex-start; }
    .lg\:w-\[28rem\] { width: 28rem; }
}
@media (min-width: 1280px) {
    .xl\:col-span-2 { grid-column: span 2 / span 2; }
    .xl\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
