/* =====================================================================
   AndaPintar - Base CSS (mandiri, tanpa framework eksternal)
   Berisi reset, sistem grid 12 kolom, utilitas, form, tombol, tabel.
   Dipakai bersama oleh situs publik (style.css) dan panel admin (admin.css).
   Tidak memuat apa pun dari CDN: halaman tetap tampil sempurna meski
   koneksi lambat atau server pihak ketiga bermasalah.
   ===================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  font-size: 1rem;
  line-height: 1.65;
  color: #0f172a;
  background: #f8fafc;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .6rem; font-weight: 700; line-height: 1.3; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.4rem; }
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid #e2e8f0; margin: 1rem 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
summary { cursor: pointer; }

/* ------------------------------------------------------------ LAYOUT */

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 1rem;
}

.row { display: flex; flex-wrap: wrap; margin-inline: -.5rem; }
.row > * { padding-inline: .5rem; width: 100%; }

.g-0 { margin-inline: 0; } .g-0 > * { padding-inline: 0; }
.g-2 { row-gap: .5rem; } .g-3 { row-gap: 1rem; } .g-4 { row-gap: 1.5rem; }

.col      { flex: 1 1 0; }
.col-auto { width: auto; flex: 0 0 auto; }
.col-12 { width: 100%; } .col-6 { width: 50%; } .col-8 { width: 66.6667%; } .col-4 { width: 33.3333%; }

@media (min-width: 576px) {
  .col-sm-6 { width: 50%; } .col-sm-4 { width: 33.3333%; }
}
@media (min-width: 768px) {
  .col-md-4 { width: 33.3333%; } .col-md-5 { width: 41.6667%; }
  .col-md-6 { width: 50%; } .col-md-7 { width: 58.3333%; }
  .col-md-8 { width: 66.6667%; } .col-md-9 { width: 75%; }
  .col-md-2 { width: 16.6667%; } .col-md-3 { width: 25%; } .col-md-12 { width: 100%; }
}
@media (min-width: 992px) {
  .col-lg-3 { width: 25%; } .col-lg-4 { width: 33.3333%; }
  .col-lg-5 { width: 41.6667%; } .col-lg-6 { width: 50%; }
  .col-lg-7 { width: 58.3333%; } .col-lg-8 { width: 66.6667%; }
  .col-lg-12 { width: 100%; }
}

/* --------------------------------------------------------- UTILITIES */

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
@media (min-width: 768px) { .d-md-inline { display: inline !important; } }
@media (min-width: 992px) {
  .d-lg-none { display: none !important; }
  .d-lg-block { display: block !important; }
}
@media (max-width: 991.98px) { .d-lg-none-up { display: none !important; } }

.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.align-middle { vertical-align: middle; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }

.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: 1rem; }

.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; } .mb-5 { margin-bottom: 3rem; }
.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; } .mt-5 { margin-top: 3rem; }
.me-2 { margin-right: .5rem; } .ms-2 { margin-left: .5rem; } .ms-auto { margin-left: auto; }
.me-auto { margin-right: auto; } .mx-auto { margin-inline: auto; }
.my-3 { margin-block: 1rem; }
.p-2 { padding: .5rem; } .p-4 { padding: 1.5rem; }
.py-2 { padding-block: .5rem; } .py-3 { padding-block: 1rem; }
.py-4 { padding-block: 1.5rem; } .py-5 { padding-block: 3rem; }
.pb-1 { padding-bottom: .25rem; } .pb-3 { padding-bottom: 1rem; }

.w-100 { width: 100% !important; }
.text-center { text-align: center; } .text-end { text-align: right; }
.text-muted { color: #64748b; }
.text-success { color: #059669; } .text-danger { color: #dc2626; }
.text-uppercase { text-transform: uppercase; letter-spacing: .05em; }
.fw-semibold { font-weight: 600; } .fw-bold { font-weight: 700; }
.small, .small * { font-size: .875rem; }
.lead { font-size: 1.05rem; }
.rounded { border-radius: 9px; }
.border-bottom { border-bottom: 1px solid #e2e8f0; }
.border-top { border-top: 1px solid #e2e8f0; }
.list-unstyled { list-style: none; padding-left: 0; }
.h3 { font-size: 1.5rem; font-weight: 700; }
.h5 { font-size: 1.1rem; font-weight: 700; }
.h6 { font-size: .95rem; font-weight: 700; }

.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap;
}

/* ------------------------------------------------------------- FORMS */

.form-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.form-text { font-size: .8rem; color: #64748b; margin-top: .2rem; }

.form-control, .form-select {
  display: block; width: 100%; padding: .5rem .75rem;
  font-family: inherit; font-size: .95rem; line-height: 1.5; color: #0f172a;
  background: #fff; border: 1px solid #cbd5e1; border-radius: 9px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%2364748b' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: 14px;
  padding-right: 2rem;
}
.form-control:focus, .form-select:focus {
  outline: none; border-color: #1d4ed8; box-shadow: 0 0 0 3px rgba(29, 78, 216, .14);
}
.form-control::placeholder { color: #94a3b8; }
.form-control-sm, .form-select-sm { padding: .3rem .55rem; font-size: .85rem; border-radius: 7px; }
.form-control-color { padding: .2rem; height: 38px; }
textarea.form-control { min-height: 80px; }

.input-group { display: flex; width: 100%; }
.input-group > .form-control, .input-group > .form-select { flex: 1 1 auto; width: 1%; }
.input-group > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group-text {
  display: flex; align-items: center; padding: .5rem .7rem; font-size: .85rem;
  color: #64748b; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 9px;
}

.form-check { display: flex; align-items: center; gap: .45rem; }
.form-check-input { width: 1rem; height: 1rem; margin: 0; accent-color: #1d4ed8; flex: 0 0 auto; }
.form-check-label { font-size: .9rem; margin: 0; }

/* ----------------------------------------------------------- BUTTONS */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .5rem 1rem; font-family: inherit; font-size: .95rem; font-weight: 600;
  line-height: 1.4; text-align: center; border: 1px solid transparent; border-radius: 9px;
  cursor: pointer; background: none; color: #0f172a;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 3px solid rgba(29, 78, 216, .35); outline-offset: 1px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: .3rem .7rem; font-size: .84rem; border-radius: 7px; }

.btn-primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.btn-primary:hover { background: #1e3a8a; border-color: #1e3a8a; color: #fff; }
.btn-outline-primary { border-color: #bfdbfe; color: #1d4ed8; background: #fff; }
.btn-outline-primary:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.btn-outline-secondary { border-color: #cbd5e1; color: #475569; background: #fff; }
.btn-outline-secondary:hover { background: #f1f5f9; color: #0f172a; }
.btn-outline-danger { border-color: #fecaca; color: #dc2626; background: #fff; }
.btn-outline-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-success { background: #059669; border-color: #059669; color: #fff; }
.btn-success:hover { background: #047857; color: #fff; }
.btn-warning { background: #f59e0b; border-color: #f59e0b; color: #1f2937; }
.btn-warning:hover { background: #d97706; color: #1f2937; }
.btn-dark { background: #0f172a; border-color: #0f172a; color: #fff; }
.btn-dark:hover { background: #1e293b; color: #fff; }
.btn-light { background: #f1f5f9; border-color: #e2e8f0; color: #0f172a; }
.btn-link { border: none; color: #1d4ed8; background: none; padding-inline: .3rem; }

/* ------------------------------------------------------------ TABLES */

.table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.table th, .table td { padding: .6rem .65rem; border-bottom: 1px solid #e2e8f0; text-align: left; }
.table th { font-weight: 700; }
.table-sm th, .table-sm td { padding: .38rem .5rem; }
.table-striped tbody tr:nth-child(odd) { background: #f8fafc; }
.table-hover tbody tr:hover { background: #f1f5f9; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ------------------------------------------------- ALERTS & BADGES -- */

.alert {
  position: relative; padding: .75rem 1rem; border: 1px solid transparent;
  border-radius: 9px; margin-bottom: 1rem; font-size: .93rem;
}
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert ul { margin-bottom: 0; }
.btn-close {
  position: absolute; top: .55rem; right: .7rem; width: 22px; height: 22px;
  border: none; background: none; cursor: pointer; font-size: 1.1rem; line-height: 1;
  color: inherit; opacity: .6;
}
.btn-close::before { content: "\00d7"; }
.btn-close:hover { opacity: 1; }

.badge { display: inline-block; padding: .22rem .5rem; font-size: .74rem; font-weight: 700; border-radius: 6px; }
.bg-danger { background: #dc2626; color: #fff; }
.bg-primary { background: #1d4ed8; color: #fff; }

/* -------------------------------------------------------- NAVIGATION */

.navbar { display: flex; align-items: center; }
.navbar > .container { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.navbar-brand { display: flex; align-items: center; gap: .5rem; }
.navbar-nav { display: flex; list-style: none; padding: 0; margin: 0; }
.nav-item { position: relative; }
.nav-link { display: block; padding: .5rem .75rem; }

@media (min-width: 992px) {
  .navbar-collapse { display: flex; align-items: center; gap: 1rem; flex: 1 1 auto; }
}

.navbar-toggler {
  display: none; padding: .35rem .6rem; border: 1px solid #cbd5e1;
  border-radius: 8px; background: #fff; cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.navbar-toggler-icon::before { content: "\2630"; }

.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 1050;
  min-width: 240px; padding: .4rem; margin-top: .2rem; list-style: none;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 12px 28px -8px rgba(15, 23, 42, .22);
}
.dropdown-menu.show { display: block; }
.dropdown-item { display: block; padding: .5rem .7rem; border-radius: 7px; font-size: .92rem; }
.dropdown-toggle::after { content: " \25be"; }

@media (max-width: 991.98px) {
  .navbar-toggler { display: inline-block; margin-left: auto; }
  .navbar-collapse { display: none; width: 100%; }
  .navbar-collapse.show { display: block; }
  .navbar-nav { flex-direction: column; width: 100%; }
  .dropdown-menu { position: static; box-shadow: none; border: none; padding-left: 1rem; }
}

/* -------------------------------------------------- BREADCRUMB & NAV */

.breadcrumb { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0 0 1rem; font-size: .85rem; }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; padding-right: .35rem; color: #94a3b8; }
.breadcrumb-item.active { color: #64748b; }

.pagination { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 0; }
.page-link {
  display: block; padding: .4rem .75rem; border: 1px solid #e2e8f0; border-radius: 8px;
  background: #fff; font-weight: 600; font-size: .9rem;
}
.page-item.active .page-link { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.page-item.disabled .page-link { color: #cbd5e1; }
