/* ==========================================================
   Mabar Badminton: tema modern minimalis
   ========================================================== */
:root {
  --c-bg: #f6f7f9;
  --c-surface: #ffffff;
  --c-border: #e6e8ec;
  --c-text: #111827;
  --c-muted: #6b7280;
  --c-primary: #059669;
  --c-primary-dark: #047857;
  --c-primary-soft: #ecfdf5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);

  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-color: var(--c-text);
  --bs-border-color: var(--c-border);
}

[x-cloak] { display: none !important; }

body {
  font-family: var(--bs-body-font-family);
  background: var(--c-bg);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: -.015em; }
h4, .h4 { font-size: 1.35rem; }
h5, .h5 { font-size: 1.05rem; }
.text-muted { color: var(--c-muted) !important; }
a { color: var(--c-primary-dark); }

.section-title {
  font-size: .75rem; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--c-muted); margin: 0 0 .75rem;
}

/* ===== Navigasi ===== */
.app-nav { background: #fff; border-bottom: 1px solid var(--c-border); padding: .6rem 0; }
.app-nav .navbar-brand { font-weight: 700; letter-spacing: -.01em; color: var(--c-text); display: flex; align-items: center; gap: .55rem; }
.brand-dot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-soft); }
.app-nav .nav-link { color: var(--c-muted); font-weight: 500; border-radius: 8px; padding: .4rem .8rem !important; }
.app-nav .nav-link:hover { color: var(--c-text); background: #f3f4f6; }
.app-nav .nav-link.active { color: var(--c-primary-dark); background: var(--c-primary-soft); }

/* ===== Tombol ===== */
.btn { border-radius: 10px; font-weight: 500; }
.btn-gor { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-gor:hover, .btn-gor:focus, .btn-gor:active { background: var(--c-primary-dark) !important; border-color: var(--c-primary-dark) !important; color: #fff !important; }
.btn-gor:disabled { opacity: .55; }
.btn-outline-success { color: var(--c-primary-dark); border-color: var(--c-border); background: #fff; }
.btn-outline-success:hover { background: var(--c-primary-soft); color: var(--c-primary-dark); border-color: #a7f3d0; }
.btn-outline-secondary { color: #374151; border-color: var(--c-border); background: #fff; }
.btn-outline-secondary:hover { background: #f3f4f6; color: #111827; border-color: #d1d5db; }

/* ===== Kartu ===== */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: #fff !important; border-bottom: 1px solid var(--c-border); font-weight: 600; padding: .9rem 1.1rem; border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-body { padding: 1.1rem; }

/* ===== Form ===== */
.form-label { font-size: .85rem; font-weight: 500; color: #374151; margin-bottom: .3rem; }
.form-control, .form-select { border-radius: 10px; border-color: #d9dce3; }
.form-control:focus, .form-select:focus { border-color: var(--c-primary); box-shadow: 0 0 0 .2rem rgba(5, 150, 105, .15); }

/* ===== Tabel ===== */
.table { --bs-table-bg: transparent; }
.table thead th, .table-light { --bs-table-bg: #fafafa; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); font-weight: 600; border-bottom: 1px solid var(--c-border); }
.table > :not(caption) > * > * { border-bottom-color: #f0f1f4; padding-top: .7rem; padding-bottom: .7rem; }

/* ===== Badge (warna lembut) ===== */
.badge { font-weight: 600; border-radius: 999px; padding: .38em .7em; }
.badge.bg-success { background: #d1fae5 !important; color: #065f46 !important; }
.badge.bg-danger { background: #fee2e2 !important; color: #991b1b !important; }
.badge.bg-secondary { background: #f3f4f6 !important; color: #4b5563 !important; }
.badge.bg-warning { background: #fef3c7 !important; color: #92400e !important; }
.badge.bg-light { background: #f3f4f6 !important; color: #374151 !important; }
.level-1 { background: #d1fae5 !important; color: #065f46 !important; }
.level-2 { background: #dbeafe !important; color: #1e40af !important; }
.level-3 { background: #ede9fe !important; color: #5b21b6 !important; }

/* ===== Alert (lembut) ===== */
.alert { border-radius: 12px; border-width: 1px; }
.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; }

/* ===== Kartu ringkasan ===== */
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--c-text); }
.stat-card .stat-label { font-size: .75rem; font-weight: 500; color: var(--c-muted); margin-top: .2rem; }

/* ===== Kartu lapangan ===== */
.court-card { border-top: 3px solid #e5e7eb; }
.court-card .card-header { display: flex; justify-content: space-between; align-items: center; }
.court-playing { border-top-color: var(--c-primary); }
.court-draft   { border-top-color: #f59e0b; }
.court-state { font-size: .68rem; font-weight: 700; letter-spacing: .07em; padding: .22rem .6rem; border-radius: 999px; background: #f3f4f6; color: #6b7280; }
.court-playing .court-state { background: #d1fae5; color: #065f46; }
.court-draft .court-state { background: #fef3c7; color: #92400e; }

.team-box { background: #fff; border: 1px solid var(--c-border); border-radius: 12px; padding: .7rem .95rem; text-align: left; }
.team-box.team-a { box-shadow: inset 3px 0 0 #3b82f6; }
.team-box.team-b { box-shadow: inset 3px 0 0 #f43f5e; }
.team-box .player { font-weight: 600; }
.vs-badge { display: block; text-align: center; font-size: .68rem; font-weight: 700; letter-spacing: .18em; color: #9ca3af; margin: .4rem 0; }

/* ===== Antrean berikutnya ===== */
.queue-item { border: 1px dashed #cbd5e1; border-radius: 12px; padding: .9rem; background: #fff; height: 100%; }
.queue-item.is-next { border-style: solid; border-color: #a7f3d0; background: #f7fefb; }
.queue-no { width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--c-primary-soft); color: var(--c-primary-dark); font-weight: 700; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; }

/* ===== Sorotan match baru (halaman live) ===== */
.highlight-new-match { animation: sorotan 1.2s ease-in-out infinite; }
@keyframes sorotan {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
  50%      { box-shadow: 0 0 0 .55rem rgba(5, 150, 105, .28); }
}

/* ===== Toast dashboard ===== */
.toast-float { position: fixed; top: 4.8rem; right: 1rem; left: 1rem; z-index: 2000; max-width: 420px; margin-left: auto; }
.toast-float .alert { box-shadow: 0 8px 24px rgba(16, 24, 40, .14); }

/* ===== Mobile ===== */
@media (max-width: 576px) {
  .stat-card .stat-value { font-size: 1.3rem; }
  .btn-group-status .btn { padding: .22rem .38rem; font-size: .72rem; }
  .card-body { padding: .95rem; }
}