/* =====================================================================
   PORPROVKu — COMPONENTS
   Komponen UI yang dapat dipakai ulang. Semua memakai token dari
   tokens.css. Tidak ada nilai warna mentah di lapisan ini.
   ===================================================================== */

/* ================================ 1. BUTTON =========================== */
.btn {
  --btn-bg: var(--n-200);
  --btn-fg: var(--brand);
  --btn-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 var(--sp-3);
  border-radius: var(--r-md); border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: var(--fs-base); font-weight: var(--fw-bold); font-family: inherit;
  cursor: pointer; white-space: nowrap; text-align: center;
  transition: filter var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
              transform 80ms var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--c-blue-600); outline-offset: 2px; }

.btn-primary { --btn-bg: linear-gradient(135deg, var(--c-navy-700), var(--c-blue-600)); --btn-fg: var(--n-0); box-shadow: 0 6px 14px rgba(10, 65, 121, .25); }
.btn-yellow { --btn-bg: linear-gradient(135deg, #FFD24D, var(--c-gold-400)); --btn-fg: #3A2A00; box-shadow: 0 6px 14px rgba(242, 183, 5, .3); }
.btn-green { --btn-bg: linear-gradient(135deg, #1CB86C, var(--c-green-700)); --btn-fg: var(--n-0); }
.btn-danger { --btn-bg: var(--c-red-100); --btn-fg: var(--c-red-700); --btn-bd: #F6CFCF; }
.btn-danger-solid { --btn-bg: linear-gradient(135deg, #E5564B, #C22C2C); --btn-fg: var(--n-0); }
.btn-outline { --btn-bg: var(--surface); --btn-fg: var(--brand); --btn-bd: var(--line-strong); }
.btn-outline:hover { background: var(--c-blue-100); }
.btn-ghost { --btn-bg: rgba(255, 255, 255, .1); --btn-fg: var(--n-0); --btn-bd: rgba(255, 255, 255, .18); }
.btn-quiet { --btn-bg: transparent; --btn-fg: var(--muted); }
.btn-quiet:hover { background: var(--bg-subtle); color: var(--ink); }

.btn-sm { min-height: 32px; padding: 0 11px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { min-height: 48px; padding: 0 var(--sp-5); font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn-icon { width: 32px; min-width: 32px; padding: 0; }
.btn-icon.btn-lg { width: 44px; min-width: 44px; }
.btn-block { width: 100%; }

.btn[disabled], .btn[aria-disabled="true"], .btn.is-disabled {
  opacity: .5; pointer-events: none; box-shadow: none;
}
/* Status memuat: spinner menggantikan label, lebar tetap */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; color: #fff;
  animation: spin .7s linear infinite;
}
.btn-outline.is-loading::after, .btn-danger.is-loading::after { color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ================================ 2. BADGE ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); line-height: 1.6; white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge-gray { background: #EFF4F9; color: var(--n-600); }
.badge-blue { background: #E8F1FB; color: #155C9E; }
.badge-navy { background: #E7EEF7; color: var(--c-navy-700); }
.badge-green { background: var(--c-green-100); color: var(--c-green-700); }
.badge-amber { background: #FFF3DE; color: var(--c-amber-700); }
.badge-yellow { background: #FFF6D9; color: #8A6400; }
.badge-red { background: var(--c-red-100); color: var(--c-red-700); }
.badge-live { background: var(--c-red-100); color: #C0392B; }
.badge-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: #C0392B;
  animation: blink 1.6s var(--ease) infinite;
}
@keyframes blink { 50% { opacity: .3; } }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Chip & medal */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; min-height: 28px;
  border-radius: var(--r-pill); background: #F0F5FA; font-size: var(--fs-xs);
  font-weight: var(--fw-semibold); color: #4C6680; border: 1px solid transparent; cursor: pointer;
}
.chip:hover { background: #E4EDF7; }
.chip.active { background: var(--brand); color: var(--n-0); }
.medal-chips { display: inline-flex; gap: 4px; }
.mc {
  min-width: 26px; height: 24px; padding: 0 6px; border-radius: var(--r-xs);
  display: inline-grid; place-items: center; font-size: var(--fs-xs); font-weight: var(--fw-black);
}
.mc.gold { background: #FFF4CF; color: #9A6E00; }
.mc.silver { background: #EEF2F6; color: #566878; }
.mc.bronze { background: #FBEEE3; color: #9B5B29; }

/* ================================ 3. CARD ============================= */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-md); overflow: hidden;
}
.card-flat { box-shadow: none; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) 18px; border-bottom: 1px solid #EEF4FA; flex-wrap: wrap;
}
.card-titlewrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-ico {
  width: 34px; height: 34px; border-radius: var(--r-md); background: var(--c-blue-100);
  color: var(--brand); display: grid; place-items: center; flex: 0 0 auto;
}
.card-ico svg { width: 18px; height: 18px; }
.card-head h2 { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--brand-ink); }
.card-head h3 { font-size: var(--fs-base); font-weight: var(--fw-bold); }
.card-head p { font-size: var(--fs-xs); color: var(--muted); }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot {
  padding: var(--sp-3) 18px; border-top: 1px solid #EEF4FA;
  display: flex; justify-content: center; gap: var(--sp-2);
}

.stat-card {
  display: flex; align-items: center; gap: var(--sp-3); padding: 15px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--sh-md);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); }
.stat-ico {
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: grid; place-items: center; flex: 0 0 auto;
}
.stat-ico svg { width: 22px; height: 22px; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-value { font-size: var(--fs-2xl); font-weight: var(--fw-black); line-height: 1.15; color: var(--brand-ink); }
.stat-label { font-size: var(--fs-sm); color: var(--muted); font-weight: var(--fw-semibold); }
.stat-sub { font-size: var(--fs-2xs); color: var(--muted-2); }

.tone-blue { background: var(--c-blue-100); color: var(--c-navy-700); }
.tone-gold { background: #FFF6DC; color: #A97A00; }
.tone-green { background: var(--c-green-100); color: var(--c-green-700); }
.tone-red { background: var(--c-red-100); color: #B42F2F; }
.tone-violet { background: var(--c-violet-100); color: #5B46B8; }
.tone-teal { background: var(--c-teal-100); color: #067C88; }
.tone-slate { background: #EEF3F8; color: #35536F; }

/* ================================ 4. JUDUL ============================ */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5);
}
.page-head-text { display: flex; gap: var(--sp-3); align-items: flex-start; min-width: 0; }
.page-head-ico {
  width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c-navy-700), var(--c-blue-600));
  color: var(--n-0); box-shadow: var(--sh-md); flex: 0 0 auto;
}
.page-head-text h1 { font-size: var(--fs-2xl); font-weight: var(--fw-black); letter-spacing: -.2px; color: var(--brand-ink); }
.page-head-text p { font-size: var(--fs-sm); color: var(--muted); max-width: 680px; }
.page-head-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.section-title { font-size: var(--fs-lg); font-weight: var(--fw-black); color: var(--brand-ink); }
.section-sub { font-size: var(--fs-xs); color: var(--muted); }

/* ================================ 5. FORM ============================= */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--n-700); }
.field-label .req { color: var(--danger); margin-left: 2px; }
.field-hint { font-size: var(--fs-xs); color: var(--muted-2); }
.field-error { font-size: var(--fs-xs); color: var(--c-red-700); font-weight: var(--fw-semibold); display: none; }
.field-error::before { content: '⚠ '; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=tel], input[type=file],
input[type=search], input[type=url], input[type=time], select, textarea {
  width: 100%; min-height: 42px; padding: 9px var(--sp-3);
  border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--n-25); color: var(--ink);
  font-family: inherit; font-size: var(--fs-base); outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
textarea { min-height: 110px; resize: vertical; line-height: var(--lh-base); }
input:hover, select:hover, textarea:hover { border-color: var(--c-blue-300); }
input:focus, select:focus, textarea:focus {
  border-color: var(--c-blue-300); box-shadow: var(--ring); background: var(--n-0);
}
input::placeholder, textarea::placeholder { color: var(--n-400); }
input:disabled, select:disabled, textarea:disabled {
  background: var(--bg-subtle); color: var(--n-500); cursor: not-allowed; opacity: .85;
}
select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C7288' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}

/* Status validasi real-time */
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea {
  border-color: var(--c-red-600); background: #FFFBFB;
}
.field.is-invalid input:focus, .field.is-invalid textarea:focus { box-shadow: var(--ring-danger); }
.field.is-invalid .field-error { display: block; }
.field.is-valid input, .field.is-valid select, .field.is-valid textarea { border-color: var(--c-green-600); }
.field.is-valid .field-hint::after { content: ' ✓'; color: var(--c-green-600); font-weight: var(--fw-black); }

.input-group { display: flex; gap: 6px; align-items: stretch; }
.input-group > input, .input-group > select { flex: 1; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 44px; }
.input-suffix .suffix {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: var(--fs-xs); color: var(--muted); pointer-events: none;
}

.checkbox { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-base); color: var(--n-700); cursor: pointer; min-height: 32px; }
.checkbox input[type=checkbox], .checkbox input[type=radio] {
  width: 18px; height: 18px; min-height: 18px; accent-color: var(--brand); cursor: pointer; flex: 0 0 auto;
}
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-base); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 42px; height: 24px; border-radius: var(--r-pill); background: var(--n-300);
  position: relative; transition: background var(--dur-base) var(--ease); flex: 0 0 auto;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--n-0); box-shadow: var(--sh-xs);
  transition: transform var(--dur-base) var(--ease);
}
.switch input:checked + .track { background: var(--c-green-600); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--c-blue-600); outline-offset: 2px; }

.form-grid { display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: 6px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--brand-ink); padding: 0; margin-bottom: var(--sp-3); }

/* ================================ 6. ALERT ============================ */
.alert {
  display: flex; align-items: flex-start; gap: 9px; padding: var(--sp-3) 14px;
  border-radius: var(--r-md); font-size: var(--fs-base); margin-bottom: var(--sp-4);
  border: 1px solid transparent;
}
.alert svg { width: 18px; height: 18px; margin-top: 1px; flex: 0 0 auto; }
.alert-success { background: #E9F8F0; border-color: #BCE8D1; color: #0A6B3D; }
.alert-error { background: var(--c-red-100); border-color: #F6CFCF; color: var(--c-red-700); }
.alert-info { background: #EAF2FB; border-color: #CFE2F5; color: #14538F; }
.alert-warning { background: var(--c-amber-100); border-color: #F5DFB7; color: var(--c-amber-700); }
.alert a { font-weight: var(--fw-bold); text-decoration: underline; }

/* ================================ 7. TABS ============================= */
.tabs {
  display: inline-flex; gap: 4px; padding: 4px; background: #EAF1F8;
  border-radius: var(--r-md); max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 7px 14px; border-radius: var(--r-sm); font-size: var(--fs-sm);
  font-weight: var(--fw-bold); color: #587390; white-space: nowrap;
  min-height: 34px; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer;
}
.tab:hover { color: var(--brand); }
.tab.active, .tab[aria-selected="true"] {
  background: var(--surface); color: var(--brand); box-shadow: 0 2px 8px rgba(7, 50, 96, .1);
}
.tab-panel[hidden] { display: none; }

/* ================================ 8. ACCORDION ======================== */
.accordion { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.accordion + .accordion { margin-top: var(--sp-2); }
.acc-item + .acc-item { border-top: 1px solid var(--line); }
.acc-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); min-height: var(--tap); cursor: pointer;
  font-size: var(--fs-base); font-weight: var(--fw-bold); color: var(--brand-ink);
  list-style: none;
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary::after {
  content: ''; width: 8px; height: 8px; flex: 0 0 auto;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform var(--dur-base) var(--ease); margin-right: 4px;
}
.acc-item[open] summary::after { transform: rotate(-135deg); }
.acc-item summary:hover { background: var(--bg-subtle); }
.acc-body { padding: 0 var(--sp-4) var(--sp-4); font-size: var(--fs-base); color: var(--n-700); }

/* ================================ 9. DROPDOWN ========================= */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: var(--z-dropdown);
  min-width: 210px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--sh-lg); padding: 6px;
  animation: popIn var(--dur-fast) var(--ease-out);
}
.dropdown-menu[hidden] { display: none; }
.dropdown-menu.left { right: auto; left: 0; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.dropdown-item {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 38px;
  padding: 8px 10px; border-radius: var(--r-sm); font-size: var(--fs-base);
  color: var(--n-700); background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit;
}
.dropdown-item svg { width: 16px; height: 16px; color: var(--n-500); }
.dropdown-item:hover, .dropdown-item:focus-visible { background: var(--c-blue-100); color: var(--brand); }
.dropdown-item.danger { color: var(--c-red-700); }
.dropdown-item.danger:hover { background: var(--c-red-100); }
.dropdown-sep { height: 1px; background: var(--line); margin: 5px 0; }
.dropdown-label { padding: 8px 10px 4px; font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--muted-2); font-weight: var(--fw-black); }

/* ================================ 10. MODAL =========================== */
dialog.modal {
  border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--sh-xl); width: min(560px, calc(100vw - 32px));
  max-height: min(88vh, 800px); color: var(--ink); overflow: hidden;
  animation: modalIn var(--dur-base) var(--ease-out);
}
dialog.modal::backdrop { background: rgba(5, 36, 66, .5); backdrop-filter: blur(3px); }
dialog.modal.wide { width: min(860px, calc(100vw - 32px)); }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: var(--fs-lg); font-weight: var(--fw-black); color: var(--brand-ink); }
.modal-head p { font-size: var(--fs-sm); color: var(--muted); }
.modal-body { padding: var(--sp-5); overflow-y: auto; max-height: 62vh; }
.modal-foot {
  display: flex; gap: var(--sp-2); justify-content: flex-end; flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line); background: var(--bg-subtle);
}
.modal-close { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 6px; border-radius: var(--r-sm); }
.modal-close:hover { background: var(--bg-subtle); color: var(--ink); }
.modal-ico {
  width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--c-amber-100); color: var(--c-amber-700); flex: 0 0 auto;
}
.modal-ico.danger { background: var(--c-red-100); color: var(--c-red-700); }
.modal-ico.success { background: var(--c-green-100); color: var(--c-green-700); }

/* ================================ 11. TOAST =========================== */
.toast-region {
  position: fixed; z-index: var(--z-toast); right: var(--sp-5); bottom: var(--sp-5);
  display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 11px; padding: var(--sp-3) 14px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--info);
  border-radius: var(--r-md); box-shadow: var(--sh-lg); pointer-events: auto;
  animation: toastIn var(--dur-base) var(--ease-out);
}
.toast.leaving { animation: toastOut var(--dur-base) var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }
.toast-ico { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; color: var(--info); }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: var(--fs-base); font-weight: var(--fw-bold); color: var(--ink); }
.toast-msg { font-size: var(--fs-sm); color: var(--muted); }
.toast-close { background: none; border: 0; cursor: pointer; color: var(--n-400); padding: 2px; }
.toast-close:hover { color: var(--ink); }
.toast.success { border-left-color: var(--c-green-600); }
.toast.success .toast-ico { color: var(--c-green-600); }
.toast.error { border-left-color: var(--c-red-600); }
.toast.error .toast-ico { color: var(--c-red-600); }
.toast.warning { border-left-color: var(--c-amber-600); }
.toast.warning .toast-ico { color: var(--c-amber-600); }

/* ================================ 12. TOOLTIP ========================= */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(3px); z-index: var(--z-tooltip);
  background: var(--c-navy-900); color: var(--n-0); font-size: var(--fs-xs);
  font-weight: var(--fw-semibold); padding: 6px 9px; border-radius: var(--r-xs);
  white-space: nowrap; opacity: 0; pointer-events: none; max-width: 240px;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  box-shadow: var(--sh-md);
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.help-dot {
  display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  background: var(--n-200); color: var(--n-600); font-size: 10px; font-weight: var(--fw-black);
  cursor: help; border: 0; line-height: 1; vertical-align: middle;
}

/* ================================ 13. SKELETON ======================== */
.skeleton {
  background: linear-gradient(90deg, #EEF3F8 25%, #F7FAFD 37%, #EEF3F8 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-xs); color: transparent !important; pointer-events: none;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-text { height: 12px; margin: 6px 0; }
.skeleton-title { height: 18px; width: 45%; margin-bottom: var(--sp-3); }
.skeleton-card { height: 92px; border-radius: var(--r-md); }
.skeleton-circle { border-radius: 50%; width: 40px; height: 40px; }

/* ================================ 14. EMPTY/ERROR ===================== */
.empty { padding: var(--sp-8) 18px; text-align: center; color: var(--muted-2); }
.empty svg { width: 36px; height: 36px; opacity: .45; margin: 0 auto var(--sp-2); }
.empty p { font-size: var(--fs-base); color: var(--muted); }
.empty h3 { font-size: var(--fs-md); color: var(--ink-soft); margin-bottom: 4px; }
.empty .btn { margin-top: var(--sp-3); }
.state-box {
  text-align: center; padding: var(--sp-10) var(--sp-5); max-width: 520px; margin: 0 auto;
}
.state-box .state-ico {
  width: 64px; height: 64px; border-radius: var(--r-lg); margin: 0 auto var(--sp-4);
  display: grid; place-items: center; background: var(--c-red-100); color: var(--c-red-700);
}
.state-box .state-ico svg { width: 30px; height: 30px; }
.state-box h2 { font-size: var(--fs-xl); color: var(--brand-ink); margin-bottom: var(--sp-2); }
.state-box p { font-size: var(--fs-base); color: var(--muted); margin-bottom: var(--sp-4); }
.state-box code { font-family: var(--font-mono); font-size: var(--fs-sm); background: var(--bg-subtle); padding: 2px 6px; border-radius: var(--r-xs); }

/* ================================ 15. TABLE =========================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th {
  text-align: left; padding: 10px 14px; background: var(--n-50);
  border-bottom: 1px solid var(--line); font-size: var(--fs-2xs);
  font-weight: var(--fw-black); letter-spacing: var(--tracking-wide);
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid #F1F6FA; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--n-25); }
th.num, td.num, .ta-right { text-align: right; }
th.center, td.center, .ta-center { text-align: center; }
.tbl-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.data-table { font-size: var(--fs-sm); }
.data-table th { white-space: nowrap; }
.sort-link { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.sort-link:hover { color: var(--brand); }
.sort-ico { opacity: .35; font-size: 9px; }
th.sorted .sort-ico { opacity: 1; color: var(--brand); }
th.sorted { color: var(--c-navy-800); }
.cell-link { color: inherit; display: block; }
.cell-link:hover b { color: var(--brand); text-decoration: underline; }
.data-table tr:hover .cell-link b { color: var(--brand); }
.mini-table { font-size: var(--fs-sm); }
.mini-table th { padding: 8px 10px; font-size: 10px; }
.mini-table td { padding: 8px 10px; }

/* Toolbar tabel */
.data-card { overflow: visible; }
.tbl-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding: var(--sp-3) 15px; border-bottom: 1px solid #EEF4FA;
}
.tbl-search { position: relative; flex: 1 1 240px; max-width: 380px; }
.tbl-search input { padding-left: 36px; min-height: 38px; }
.tbl-search .search-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--n-500); display: grid; pointer-events: none; }
.tbl-search .search-ico svg { width: 16px; height: 16px; }
.tbl-export { display: flex; gap: 6px; align-items: center; }
.tbl-filters {
  display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 11px 15px;
  background: var(--n-25); border-bottom: 1px solid #EEF4FA; align-items: flex-end;
}
.tbl-filter { display: flex; flex-direction: column; gap: 3px; }
.tbl-filter span { font-size: 10px; font-weight: var(--fw-black); text-transform: uppercase; letter-spacing: .05em; color: var(--n-500); }
.tbl-filter select { min-height: 34px; padding: 5px 30px 5px 9px; font-size: var(--fs-sm); background-color: var(--n-0); min-width: 132px; }
.tbl-foot {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding: 11px 15px; border-top: 1px solid #EEF4FA;
}
.per-page label { font-size: var(--fs-xs); color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.per-page select { min-height: 30px; padding: 3px 26px 3px 7px; font-size: var(--fs-sm); width: auto; }
.bulk-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 10px 15px; background: #FFFBEB; border-top: 1px solid #F7E3BE;
}
.bulk-info { font-size: var(--fs-sm); color: #8A5A00; }
.bulk-info b { font-size: var(--fs-md); }
.inline-form { display: inline-flex; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pg {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; min-height: 32px;
  border-radius: var(--r-sm); background: #F0F5FA; font-weight: var(--fw-bold);
  color: var(--brand); font-size: var(--fs-sm);
}
.pg svg { width: 14px; height: 14px; }
.pg:hover { background: #E2ECF7; }
.pg.disabled { opacity: .4; pointer-events: none; }
.pg-info { color: var(--muted); font-size: var(--fs-sm); }

/* Tabel → kartu pada layar kecil */
@media (max-width: 720px) {
  .table-wrap.responsive { overflow: visible; }
  .table-wrap.responsive table,
  .table-wrap.responsive thead,
  .table-wrap.responsive tbody,
  .table-wrap.responsive th,
  .table-wrap.responsive td,
  .table-wrap.responsive tr { display: block; width: 100%; }
  .table-wrap.responsive thead { display: none; }
  .table-wrap.responsive tbody tr {
    border: 1px solid var(--line); border-radius: var(--r-md);
    padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-2); background: var(--surface);
    box-shadow: var(--sh-xs);
  }
  .table-wrap.responsive td {
    display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3);
    padding: 7px 0; border-bottom: 1px dashed #EDF3F9; text-align: right;
  }
  .table-wrap.responsive td:last-child { border-bottom: 0; }
  .table-wrap.responsive td::before {
    content: attr(data-label); flex: 0 0 42%; text-align: left;
    font-size: var(--fs-xs); font-weight: var(--fw-black); text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted); padding-top: 2px;
  }
  .table-wrap.responsive td:empty { display: none; }
  .table-wrap.responsive td[data-label=""]::before { display: none; }
  .table-wrap.responsive .tbl-actions { justify-content: flex-end; }
  .table-wrap.responsive .empty { padding: var(--sp-5) var(--sp-3); }
}

/* ================================ 16. MATCH =========================== */
.match-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.match {
  display: block; padding: 14px 15px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.match:hover { border-color: #C9DEF2; box-shadow: var(--sh-md); transform: translateY(-1px); }
.match-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: 9px; }
.match-cabor { display: flex; align-items: center; gap: 7px; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--brand); }
.match-cabor .ci { width: 24px; height: 24px; border-radius: var(--r-xs); background: var(--c-blue-100); display: grid; place-items: center; }
.match-cabor .ci svg { width: 14px; height: 14px; }
.match-round { font-size: var(--fs-2xs); color: var(--muted); background: #F2F6FA; padding: 2px var(--sp-2); border-radius: var(--r-pill); font-weight: var(--fw-semibold); }
.match-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--sp-2); }
.team { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.team.right { flex-direction: row-reverse; text-align: right; }
.team-name { font-size: var(--fs-base); font-weight: var(--fw-bold); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-name small { display: block; font-size: 10px; color: var(--muted); font-weight: var(--fw-medium); }
.crest {
  width: 26px; height: 30px; flex: 0 0 auto; border-radius: 5px 5px var(--r-sm) var(--r-sm);
  display: grid; place-items: center; color: var(--n-0); font-size: 9.5px; font-weight: var(--fw-black);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
}
.score-box { min-width: 62px; text-align: center; }
.score { font-size: var(--fs-xl); font-weight: var(--fw-black); letter-spacing: 1px; color: var(--brand-ink); line-height: 1.2; }
.score.vs { font-size: var(--fs-sm); color: var(--muted); font-weight: var(--fw-bold); letter-spacing: .06em; }
.score-time { font-size: var(--fs-base); font-weight: var(--fw-black); color: var(--brand); }
.match-meta { display: flex; align-items: center; gap: 10px; margin-top: 9px; font-size: var(--fs-xs); color: var(--muted); flex-wrap: wrap; }
.match-meta span { display: inline-flex; align-items: center; gap: 4px; }
.match-meta svg { width: 13px; height: 13px; }
.match-status { margin-left: auto; max-width: 100%; }
.match-meta > span { min-width: 0; }

/* ================================ 17. DATA DISPLAY ==================== */
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) 14px; font-size: var(--fs-base); }
.kv dt { color: var(--muted); font-size: var(--fs-sm); }
.kv dd { margin: 0; font-weight: var(--fw-semibold); color: var(--ink); word-break: break-word; }
.timeline { position: relative; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: #E4EDF6; }
.tl-item { position: relative; }
.tl-item::before {
  content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--n-0); border: 2px solid var(--c-blue-600);
}
.tl-item.done::before { background: var(--c-green-600); border-color: var(--c-green-600); }
.tl-item.now::before { background: var(--c-gold-300); border-color: var(--c-gold-400); box-shadow: 0 0 0 4px rgba(255, 199, 44, .25); }
.tl-title { font-size: var(--fs-base); font-weight: var(--fw-bold); }
.tl-desc { font-size: var(--fs-xs); color: var(--muted); }
.diff { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); flex-wrap: wrap; }
.diff svg { width: 13px; height: 13px; color: var(--n-500); }
.diff-before { background: #F4F7FA; color: #6B8299; padding: 2px 7px; border-radius: var(--r-xs); font-weight: var(--fw-semibold); }
.diff-after { background: var(--c-green-100); color: var(--c-green-700); padding: 2px 7px; border-radius: var(--r-xs); font-weight: var(--fw-bold); }
.mini-progress { display: inline-block; width: 74%; height: 7px; background: #EDF3F9; border-radius: var(--r-pill); overflow: hidden; vertical-align: middle; }
.mini-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--c-blue-600), var(--c-green-600)); border-radius: var(--r-pill); }
.bracket { display: flex; gap: 18px; overflow-x: auto; padding-bottom: var(--sp-2); }
.bracket-col { min-width: 210px; display: flex; flex-direction: column; gap: var(--sp-3); }
.bracket-col > h4 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.bracket-match { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; font-size: var(--fs-sm); }
.bracket-match .bm-row { display: flex; justify-content: space-between; gap: var(--sp-2); padding: 2px 0; }
.bracket-match .bm-row.win { font-weight: var(--fw-black); color: var(--c-navy-800); }

/* ================================ 18. NOTIFIKASI ===================== */
.notif { display: flex; gap: 11px; padding: var(--sp-3) 15px; border-bottom: 1px solid #F1F6FA; }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: #F6FAFF; }
.notif-ico {
  width: 36px; height: 36px; border-radius: var(--r-md); background: var(--c-blue-100);
  color: var(--brand); display: grid; place-items: center; flex: 0 0 auto;
}
.notif-body { flex: 1; min-width: 0; }
.notif-body strong { font-size: var(--fs-base); display: block; }
.notif-body p { font-size: var(--fs-sm); color: var(--muted); }
.notif-body time { font-size: var(--fs-2xs); color: var(--n-500); }
.notif-mini { display: flex; flex-direction: column; gap: var(--sp-2); }
.notif-row { display: flex; gap: 9px; padding: 10px 11px; border-radius: var(--r-md); background: var(--n-25); border: 1px solid #EDF3F9; }
.notif-row.unread { background: #F2F8FF; border-color: #D8E9F9; }
.notif-row.warning { background: #FFFAF0; border-color: #F7E3BE; }
.notif-row.danger { background: #FEF3F3; border-color: #F6D3D3; }
.notif-row svg { width: 17px; height: 17px; color: var(--brand); flex: 0 0 auto; margin-top: 2px; }
.notif-row.warning svg { color: var(--c-amber-700); }
.notif-row.danger svg { color: var(--c-red-700); }
.notif-row b { font-size: var(--fs-sm); display: block; text-transform: capitalize; }
.notif-row p { font-size: var(--fs-xs); color: var(--muted); }
.notif-row time { font-size: 10px; color: var(--n-500); }

/* ================================ 19. KONTEN PUBLIK =================== */
.news-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.news-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-md); display: flex; flex-direction: column;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }
.news-thumb {
  aspect-ratio: 16 / 9; position: relative; background: linear-gradient(135deg, var(--c-navy-700), var(--c-blue-600));
  display: grid; place-items: center; color: rgba(255, 255, 255, .55); overflow: hidden;
}
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-thumb svg { width: 34px; height: 34px; }
.news-cat {
  position: absolute; top: 10px; left: 10px; background: rgba(255, 255, 255, .94);
  color: var(--c-navy-800); font-size: 10px; font-weight: var(--fw-black);
  padding: 3px 9px; border-radius: var(--r-pill);
}
.news-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-body h3 { font-size: var(--fs-md); font-weight: var(--fw-bold); line-height: var(--lh-snug); }
.news-body p { font-size: var(--fs-sm); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { font-size: var(--fs-2xs); color: var(--n-500); margin-top: auto; display: flex; gap: var(--sp-2); align-items: center; }
.article-body { font-size: var(--fs-md); line-height: var(--lh-relaxed); color: var(--n-800); white-space: pre-line; }
.article-hero {
  aspect-ratio: 16/8; border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(135deg, var(--c-navy-700), var(--c-blue-600));
  display: grid; place-items: center; color: rgba(255, 255, 255, .5);
}
.article-hero img { width: 100%; height: 100%; object-fit: cover; }

.gallery-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.gallery-item { border-radius: var(--r-md); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-md); }
.gi-media {
  aspect-ratio: 4/3; background: linear-gradient(140deg, var(--c-navy-700), #1B7BC9);
  display: grid; place-items: center; color: rgba(255, 255, 255, .6); position: relative; overflow: hidden;
}
.gi-media img { width: 100%; height: 100%; object-fit: cover; }
.gi-cap { padding: 10px var(--sp-3); font-size: var(--fs-sm); }
.gi-cap strong { display: block; font-size: var(--fs-sm); }
.play-pill { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .15); }
.play-pill span {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .92);
  color: #B42F2F; display: grid; place-items: center;
}

.venue-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-md); }
.venue-media {
  aspect-ratio: 16/8; background: linear-gradient(140deg, var(--c-navy-700), #1B7BC9);
  display: grid; place-items: center; color: rgba(255, 255, 255, .55); position: relative; overflow: hidden;
}
.venue-media img { width: 100%; height: 100%; object-fit: cover; }
.venue-body { padding: 14px; }
.venue-body h3 { font-size: var(--fs-md); font-weight: var(--fw-bold); }
.venue-body p { font-size: var(--fs-sm); color: var(--muted); }

/* Peta */
.map-frame { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-subtle); }
.map-frame iframe { width: 100%; height: 320px; border: 0; display: block; }
.map-embed { aspect-ratio: 16/9; width: 100%; }

/* ================================ 20. KARTU ATLET ===================== */
.id-card {
  position: relative; overflow: hidden; color: var(--n-0); border-radius: var(--r-xl);
  padding: 18px; box-shadow: var(--sh-lg);
  background:
    radial-gradient(400px 200px at 100% 0, rgba(255, 199, 44, .22), transparent 65%),
    linear-gradient(130deg, var(--c-navy-900), var(--c-navy-700) 60%, #1060AB);
}
.id-card .idc-head { display: flex; align-items: center; gap: 10px; }
.id-card .idc-head img { width: 32px; height: 32px; }
.id-card .idc-title { font-size: 9.5px; letter-spacing: .18em; color: var(--c-gold-300); font-weight: var(--fw-black); }
.id-card .idc-sub { font-size: var(--fs-xs); color: rgba(255, 255, 255, .75); }
.id-card .idc-body { display: flex; gap: 14px; margin-top: var(--sp-4); align-items: center; }
.id-card .idc-photo {
  width: 64px; height: 64px; border-radius: var(--r-md); background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .3); display: grid; place-items: center;
  font-size: var(--fs-2xl); font-weight: var(--fw-black); overflow: hidden;
}
.id-card .idc-photo img { width: 100%; height: 100%; object-fit: cover; }
.id-card .idc-name { font-size: var(--fs-lg); font-weight: var(--fw-black); }
.id-card .idc-role { font-size: var(--fs-xs); color: var(--c-gold-300); font-weight: var(--fw-bold); }
.id-card .idc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px var(--sp-3); margin-top: 14px; font-size: var(--fs-xs); }
.id-card .idc-meta span { color: rgba(255, 255, 255, .65); display: block; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }
.id-card .idc-meta b { font-size: var(--fs-sm); }
.id-card .idc-foot {
  display: flex; justify-content: space-between; align-items: flex-end; margin-top: 14px;
  padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, .25);
  font-size: 10px; color: rgba(255, 255, 255, .7);
}

/* ================================ 21. LOGIN =========================== */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: #F4F8FC; }
.auth-side {
  position: relative; overflow: hidden; padding: var(--sp-10); color: var(--n-0);
  background:
    radial-gradient(700px 400px at 90% 10%, rgba(22, 104, 179, .65), transparent 65%),
    linear-gradient(150deg, var(--c-navy-900) 0%, var(--c-navy-700) 55%, #0F62AE 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath fill='%23FFC72C' fill-opacity='.18' d='M0 64c180 34 340 34 520 0s340-34 520 0 280 30 400 22v54H0z'/%3E%3C/svg%3E") bottom / cover no-repeat;
  pointer-events: none;
}
.auth-brand { display: flex; align-items: center; gap: var(--sp-3); position: relative; z-index: 2; }
.auth-brand img { width: 52px; height: 52px; }
.auth-brand strong { font-size: var(--fs-2xl); display: block; }
.auth-brand small { font-size: var(--fs-2xs); letter-spacing: .2em; color: var(--c-gold-300); font-weight: var(--fw-bold); }
.auth-hero { position: relative; z-index: 2; max-width: 440px; }
.auth-hero h1 { font-size: var(--fs-4xl); font-weight: var(--fw-black); line-height: var(--lh-tight); letter-spacing: -.5px; }
.auth-hero h1 span { color: var(--c-gold-300); }
.auth-hero p { font-size: var(--fs-base); color: rgba(255, 255, 255, .8); margin-top: 10px; }
.auth-feats { display: grid; gap: 10px; margin-top: 22px; }
.auth-feat { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); color: rgba(255, 255, 255, .9); }
.auth-feat span.af-ico {
  width: 30px; height: 30px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .14);
  display: grid; place-items: center; color: var(--c-gold-300); flex: 0 0 auto;
}
.auth-feat svg { width: 16px; height: 16px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: var(--sp-7) var(--sp-6); }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface);
  border-radius: var(--r-xl); box-shadow: var(--sh-lg); border: 1px solid var(--line); padding: var(--sp-6);
}
.auth-card h2 { font-size: var(--fs-2xl); font-weight: var(--fw-black); color: var(--brand-ink); }
.auth-card > p { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--sp-4); }
.demo-box { margin-top: var(--sp-4); border-top: 1px dashed var(--line); padding-top: 14px; }
.demo-box summary { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--brand); cursor: pointer; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.demo-item { font-size: var(--fs-2xs); background: #F6FAFE; border: 1px solid #E6EFF8; border-radius: var(--r-xs); padding: 6px var(--sp-2); }
.demo-item b { display: block; font-size: 10px; color: var(--brand); }
.demo-item span { color: var(--muted); font-family: var(--font-mono); }

/* ================================ 22. KHUSUS ========================== */
.confirm-wrap { max-width: 460px; margin: var(--sp-7) auto; }
.confirm-head { display: flex; gap: var(--sp-3); align-items: flex-start; margin-bottom: 14px; }
.confirm-ico { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--c-amber-100); color: var(--c-amber-700); display: grid; place-items: center; flex: 0 0 auto; }
.confirm-head h2 { font-size: var(--fs-xl); font-weight: var(--fw-black); color: var(--brand-ink); }
.mfa-qr { display: grid; place-items: center; padding: 10px; background: var(--n-0); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: var(--sp-3); }
.mfa-qr img { border-radius: var(--r-sm); }
.secret-box {
  font-family: var(--font-mono); font-size: var(--fs-md); letter-spacing: 2px; text-align: center;
  background: #F5F9FD; border: 1px dashed #C9DEF2; border-radius: var(--r-md);
  padding: 10px; margin: 6px 0; word-break: break-all; color: var(--c-navy-800); font-weight: var(--fw-bold);
}
.report-card { transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.report-card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }
.report-title { display: block; margin-top: 10px; font-size: var(--fs-md); font-weight: var(--fw-black); color: var(--brand-ink); }
.report-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--brand); }
.report-link svg { width: 14px; height: 14px; }
.otp-input {
  font-size: var(--fs-2xl); letter-spacing: 8px; text-align: center;
  font-family: var(--font-mono); font-weight: var(--fw-black);
}
.pending-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.pending-item {
  display: flex; align-items: center; gap: 10px; padding: 10px var(--sp-3);
  border-radius: var(--r-md); background: var(--n-25); border: 1px solid #E8F0F8;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.pending-item:hover { border-color: #C9DEF2; transform: translateX(2px); }
.pi-ico { width: 34px; height: 34px; border-radius: var(--r-md); display: grid; place-items: center; flex: 0 0 auto; }
.pi-ico svg { width: 17px; height: 17px; }
.pi-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pi-text b { font-size: var(--fs-sm); color: var(--ink); }
.pi-count { font-size: var(--fs-md); font-weight: var(--fw-black); color: var(--c-navy-800); background: #EAF1F8; border-radius: var(--r-sm); padding: 3px 10px; }
.progress-list { display: flex; flex-direction: column; gap: 10px; }
.pl-row .pl-top { display: flex; justify-content: space-between; font-size: var(--fs-sm); margin-bottom: 4px; }
.pl-bar { height: 8px; background: #EDF3F9; border-radius: var(--r-pill); overflow: hidden; }
.pl-bar span { display: block; height: 100%; border-radius: var(--r-pill); }
.spark { width: 120px; height: 30px; }

/* ================================ 23. GLOBAL SEARCH =================== */
.search-trigger {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 36px; padding: 0 11px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .85); font-size: var(--fs-sm); cursor: pointer;
}
.search-trigger:hover { background: rgba(255, 255, 255, .2); }
.search-trigger svg { width: 16px; height: 16px; }
.search-trigger kbd {
  font-family: var(--font-mono); font-size: 10px; padding: 1px 5px; border-radius: var(--r-xs);
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .2);
}
dialog.palette {
  border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface);
  width: min(620px, calc(100vw - 24px)); margin-top: 12vh; box-shadow: var(--sh-xl);
  overflow: hidden; color: var(--ink);
}
dialog.palette::backdrop { background: rgba(5, 36, 66, .5); backdrop-filter: blur(3px); }
.palette-search { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.palette-search svg { width: 20px; height: 20px; color: var(--n-500); flex: 0 0 auto; }
.palette-search input {
  border: 0; background: none; font-size: var(--fs-lg); min-height: 32px; padding: 0;
  box-shadow: none !important;
}
.palette-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette-group { padding: var(--sp-2) 10px 4px; font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--muted-2); font-weight: var(--fw-black); }
.palette-item {
  display: flex; align-items: center; gap: var(--sp-3); padding: 9px 10px; border-radius: var(--r-sm);
  font-size: var(--fs-base); color: var(--n-700);
}
.palette-item:hover, .palette-item[aria-selected="true"] { background: var(--c-blue-100); color: var(--brand); }
.palette-item .pi-kind { font-size: 10px; background: var(--bg-subtle); padding: 2px 7px; border-radius: var(--r-pill); color: var(--muted); margin-left: auto; white-space: nowrap; }
.palette-foot { display: flex; gap: var(--sp-4); padding: 10px var(--sp-4); border-top: 1px solid var(--line); font-size: var(--fs-2xs); color: var(--muted); background: var(--bg-subtle); }
.palette-foot kbd { font-family: var(--font-mono); background: var(--n-0); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.palette-empty { padding: var(--sp-8) var(--sp-5); text-align: center; color: var(--muted); font-size: var(--fs-base); }

/* ================================ 24. AUTOSAVE ======================== */
.autosave-bar {
  display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs);
  color: var(--muted); min-height: 24px;
}
.autosave-bar .as-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--n-400); flex: 0 0 auto; }
.autosave-bar[data-state="saving"] .as-dot { background: var(--c-amber-600); animation: blink 1s infinite; }
.autosave-bar[data-state="saved"] .as-dot { background: var(--c-green-600); }
.autosave-bar[data-state="error"] .as-dot { background: var(--c-red-600); }
.unsaved-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--c-amber-100); border: 1px solid #F5DFB7; border-radius: var(--r-md);
  color: var(--c-amber-700); font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  margin-bottom: var(--sp-4);
}
.unsaved-banner svg { width: 17px; height: 17px; flex: 0 0 auto; }

/* ===================== 25. PENCEGAHAN OVERFLOW ======================== */
/* Flex/grid item harus boleh menyusut agar teks panjang tidak mendorong
   konten melewati lebar layar (masalah klasik pada judul & nama tim). */
.card-titlewrap { flex: 1 1 auto; min-width: 0; }
.card-titlewrap > div { min-width: 0; }
.card-head h2, .card-head h3, .card-head p { overflow-wrap: anywhere; }
.between > *, .row > * { min-width: 0; }
.match-top { flex-wrap: wrap; }
.match-cabor { min-width: 0; }
.match-cabor .ci, .match-round { flex: 0 0 auto; }
.page-head-text > div { min-width: 0; }
.page-head-text h1 { overflow-wrap: anywhere; }
.modal-head > div { min-width: 0; }
.kv dd { overflow-wrap: anywhere; }
.alert span { min-width: 0; }
.data-table td, .data-table th { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .card-head { gap: var(--sp-2); }
  .card-titlewrap { gap: var(--sp-2); }
  .card-ico { width: 30px; height: 30px; }
  .match-round { font-size: 10px; }
}

/* Sel checkbox pada mode kartu: ringkas, tanpa label teks */
@media (max-width: 720px) {
  .table-wrap.responsive td.cell-check { justify-content: flex-start; padding-top: 2px; }
  .table-wrap.responsive td.cell-check::before { display: none; }
  .table-wrap.responsive td.cell-check input { width: 20px; height: 20px; }
}
