/* =========================================================
   TRACER STUDY SMA KALSEL — Tema Premium
   ========================================================= */
:root {
  --brand-1: #1e3a8a;
  --brand-2: #2563eb;
  --brand-3: #0ea5a4;
  --brand-grad: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0ea5a4 100%);
  --radius: 1rem;
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, .05), 0 18px 36px -16px rgba(15, 23, 42, .25);
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
  --bs-link-color: #2563eb;
  --bs-link-color-rgb: 37, 99, 235;
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
[data-bs-theme="dark"] {
  --shadow-soft: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  --bs-body-bg: #0f172a;
  --bs-tertiary-bg: #0b1222;
  --bs-tertiary-bg-rgb: 11, 18, 34;
}

body { font-family: var(--bs-body-font-family); font-size: .925rem; letter-spacing: -.005em; }
.bg-body-tertiary { background-color: #f3f6fb !important; }
[data-bs-theme="dark"] .bg-body-tertiary { background-color: #0b1222 !important; }
.fw-800 { font-weight: 800; }
.bg-gradient-brand { background: var(--brand-grad) !important; color: #fff; }
.text-gradient { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Buttons ---------- */
.btn { border-radius: .65rem; font-weight: 600; }
.btn-primary { --bs-btn-bg: #2563eb; --bs-btn-border-color: #2563eb; --bs-btn-hover-bg: #1d4ed8; --bs-btn-hover-border-color: #1d4ed8; --bs-btn-active-bg: #1e40af; box-shadow: 0 6px 16px -8px rgba(37,99,235,.7); }
.btn-gradient { background: var(--brand-grad); color: #fff; border: 0; box-shadow: 0 8px 20px -10px rgba(37,99,235,.8); }
.btn-gradient:hover { color: #fff; filter: brightness(1.07); }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Sidebar ---------- */
.app-sidebar.sidebar-brand-gradient { background: linear-gradient(180deg, #0f1f4d 0%, #0b1533 100%) !important; }
.app-sidebar .sidebar-brand { border-bottom: 1px solid rgba(255,255,255,.08) !important; height: auto; min-height: 3.6rem; padding: .6rem .9rem; }
.app-sidebar .brand-link { display: flex; align-items: center; gap: .6rem; padding: 0 !important; }
.app-sidebar .brand-image { width: 38px; height: 38px; object-fit: contain; max-height: none; margin: 0 !important; background: rgba(255,255,255,.95); border-radius: .7rem; padding: 3px; box-shadow: 0 6px 14px -6px rgba(0,0,0,.6); float: none !important; }
.app-sidebar .brand-text { color: #fff; font-size: .95rem; white-space: nowrap; }
.app-sidebar .brand-sub { font-size: .7rem; font-weight: 500; }
.sidebar-menu .nav-header { font-size: .68rem; letter-spacing: .09em; color: rgba(255,255,255,.4) !important; padding-top: 1rem; font-weight: 700; }
.sidebar-menu .nav-link { border-radius: .7rem !important; margin: 2px 8px; color: rgba(255,255,255,.72) !important; transition: all .2s ease; }
.sidebar-menu .nav-link:hover { background: rgba(255,255,255,.07) !important; color: #fff !important; }
.sidebar-menu .nav-link.active { background: var(--brand-grad) !important; color: #fff !important; box-shadow: 0 8px 18px -8px rgba(37,99,235,.9); }
.sidebar-menu .nav-link .nav-icon { font-size: 1rem; }

/* ---------- Header ---------- */
.app-header { border-bottom: 1px solid rgba(15,23,42,.06); backdrop-filter: saturate(180%) blur(8px); }
.avatar-initial { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; box-shadow: 0 4px 10px -4px rgba(37,99,235,.7); }
.avatar-initial.avatar-lg { width: 64px; height: 64px; font-size: 1.6rem; display: flex; border: 3px solid rgba(255,255,255,.4); }
.user-menu .user-header { height: auto !important; padding: 1.2rem; text-align: center; }
.user-menu .user-header small { display: block; opacity: .85; font-size: .78rem; }
.user-menu .user-footer { padding: .75rem; background: var(--bs-tertiary-bg); }

.app-content-header { padding: 1.25rem .5rem .75rem; }
.page-title { font-weight: 800; letter-spacing: -.02em; font-size: 1.45rem; }
.breadcrumb a { text-decoration: none; }

/* ---------- Cards ---------- */
.card { border: 1px solid rgba(15,23,42,.06); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
[data-bs-theme="dark"] .card { border-color: rgba(255,255,255,.06); background: #111c33; }
.card-header { background: transparent; border-bottom: 1px solid rgba(15,23,42,.06); padding: 1rem 1.25rem; }
[data-bs-theme="dark"] .card-header { border-color: rgba(255,255,255,.06); }
.card-header .card-title { font-weight: 700; font-size: 1rem; margin: 0; }
.card-body { padding: 1.25rem; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

/* Stat card */
.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: .9rem; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-card .stat-value { font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat-card .stat-label { font-size: .8rem; color: var(--bs-secondary-color); font-weight: 600; }
.stat-card .stat-foot { font-size: .75rem; }
.stat-card::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: currentColor; opacity: .04; }

.icon-soft-primary   { background: rgba(37,99,235,.12);  color: #2563eb; }
.icon-soft-success   { background: rgba(22,163,74,.12);  color: #16a34a; }
.icon-soft-info      { background: rgba(8,145,178,.12);  color: #0891b2; }
.icon-soft-warning   { background: rgba(245,158,11,.15); color: #d97706; }
.icon-soft-danger    { background: rgba(239,68,68,.12);  color: #dc2626; }
.icon-soft-secondary { background: rgba(139,92,246,.12); color: #7c3aed; }
.icon-soft-dark      { background: rgba(100,116,139,.15); color: #475569; }
[data-bs-theme="dark"] .icon-soft-dark { color: #cbd5e1; }

/* Hero */
.hero-card { background: var(--brand-grad); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero-card::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle at 85% 20%, rgba(255,255,255,.18) 0, transparent 40%), radial-gradient(circle at 10% 110%, rgba(255,255,255,.12) 0, transparent 45%); }
.hero-card > * { position: relative; }
.hero-card .hero-big { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }

/* Soft badges */
.badge { font-weight: 600; border-radius: .5rem; padding: .4em .65em; }
.badge-soft-primary   { background: rgba(37,99,235,.12);  color: #1d4ed8; }
.badge-soft-success   { background: rgba(22,163,74,.12);  color: #15803d; }
.badge-soft-info      { background: rgba(8,145,178,.12);  color: #0e7490; }
.badge-soft-warning   { background: rgba(245,158,11,.16); color: #b45309; }
.badge-soft-danger    { background: rgba(239,68,68,.12);  color: #b91c1c; }
.badge-soft-secondary { background: rgba(139,92,246,.13); color: #6d28d9; }
.badge-soft-dark      { background: rgba(100,116,139,.16); color: #334155; }
[data-bs-theme="dark"] .badge-soft-primary { color: #93c5fd; }
[data-bs-theme="dark"] .badge-soft-success { color: #86efac; }
[data-bs-theme="dark"] .badge-soft-info { color: #67e8f9; }
[data-bs-theme="dark"] .badge-soft-warning { color: #fcd34d; }
[data-bs-theme="dark"] .badge-soft-danger { color: #fca5a5; }
[data-bs-theme="dark"] .badge-soft-secondary { color: #c4b5fd; }
[data-bs-theme="dark"] .badge-soft-dark { color: #cbd5e1; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); font-weight: 700; background: var(--bs-tertiary-bg) !important; border-bottom-width: 1px; white-space: nowrap; padding-top: .8rem; padding-bottom: .8rem; }
.table > tbody td { vertical-align: middle; padding-top: .75rem; padding-bottom: .75rem; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(37,99,235,.04); }
.table-rekap td, .table-rekap th { text-align: center; }
.table-rekap td:nth-child(2), .table-rekap th:nth-child(2) { text-align: left; }
.person-cell { display: flex; align-items: center; gap: .7rem; }
.person-avatar { width: 38px; height: 38px; border-radius: .75rem; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.person-avatar.L { background: rgba(37,99,235,.12); color: #2563eb; }
.person-avatar.P { background: rgba(236,72,153,.12); color: #db2777; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: .65rem; padding: .55rem .85rem; border-color: rgba(15,23,42,.14); }
.form-control:focus, .form-select:focus { border-color: #60a5fa; box-shadow: 0 0 0 .22rem rgba(37,99,235,.15); }
.form-label { font-weight: 600; font-size: .83rem; margin-bottom: .35rem; }
.form-label .req { color: #ef4444; }
.input-group-text { border-radius: .65rem; background: var(--bs-tertiary-bg); }
.form-section { border-left: 4px solid var(--brand-2); }
.section-title { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1rem; }
.section-title .num { width: 28px; height: 28px; border-radius: .55rem; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }

/* Status picker (radio card) */
.status-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .65rem; }
.status-picker input { position: absolute; opacity: 0; pointer-events: none; }
.status-picker label { display: flex; flex-direction: column; gap: .35rem; padding: .9rem; border: 1.5px solid rgba(15,23,42,.1); border-radius: .9rem; cursor: pointer; transition: all .15s ease; height: 100%; font-weight: 600; font-size: .85rem; background: var(--bs-body-bg); }
.status-picker label i { font-size: 1.3rem; }
.status-picker label:hover { border-color: #93c5fd; transform: translateY(-1px); }
.status-picker input:checked + label { border-color: var(--brand-2); background: rgba(37,99,235,.06); box-shadow: 0 0 0 .2rem rgba(37,99,235,.12); }
.status-picker input:focus-visible + label { outline: 2px solid var(--brand-2); }

.rating-group { display: flex; gap: .4rem; flex-wrap: wrap; }
.rating-group input { display: none; }
.rating-group label { min-width: 44px; padding: .45rem .7rem; border-radius: .6rem; border: 1.5px solid rgba(15,23,42,.12); text-align: center; cursor: pointer; font-weight: 700; font-size: .85rem; }
.rating-group input:checked + label { background: var(--brand-grad); color: #fff; border-color: transparent; }

.cond-section { display: none; }
.cond-section.show { display: block; animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-top: 1px solid rgba(15,23,42,.08); padding: .85rem 1rem; margin: 0 -.5rem; border-radius: var(--radius) var(--radius) 0 0; }
[data-bs-theme="dark"] .sticky-actions { background: rgba(15,23,42,.9); border-color: rgba(255,255,255,.08); }

/* Filter bar */
.filter-bar .form-select, .filter-bar .form-control { font-size: .85rem; }

/* Detail list */
.dl-grid { display: grid; grid-template-columns: 170px 1fr; gap: .55rem 1rem; font-size: .9rem; }
.dl-grid dt { color: var(--bs-secondary-color); font-weight: 600; }
.dl-grid dd { margin: 0; font-weight: 500; }
@media (max-width: 575.98px) { .dl-grid { grid-template-columns: 1fr; gap: .1rem; } .dl-grid dd { margin-bottom: .6rem; } }

/* Progress */
.progress { border-radius: 50rem; background: rgba(15,23,42,.07); }
.progress-thin { height: 7px; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--bs-secondary-color); }
.empty-state i { font-size: 3rem; opacity: .35; }

/* Chart */
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 240px; }

/* Legend list */
.legend-list li { display: flex; align-items: center; justify-content: space-between; padding: .45rem 0; border-bottom: 1px dashed rgba(15,23,42,.08); font-size: .85rem; }
.legend-list li:last-child { border-bottom: 0; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: .5rem; }

/* ---------- Login ---------- */
.login-page-x { min-height: 100vh; display: flex; background: #f3f6fb; }
.login-hero { flex: 1.1; background: var(--brand-grad); color: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 3rem; }
.login-hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle at 80% 15%, rgba(255,255,255,.2) 0, transparent 35%), radial-gradient(circle at 15% 90%, rgba(255,255,255,.14) 0, transparent 40%); }
.login-hero::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(circle at 50% 50%, #000 0, transparent 75%); }
.login-hero > * { position: relative; z-index: 1; }
.login-hero h1 { font-weight: 800; font-size: 2.6rem; letter-spacing: -.03em; line-height: 1.1; }
.login-hero .feature { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; }
.login-hero .feature i { width: 40px; height: 40px; border-radius: .8rem; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.login-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.login-card { width: 100%; max-width: 420px; }
.login-logo { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 1rem; padding: 6px; box-shadow: var(--shadow-soft); }
.login-card .form-control { padding: .75rem 1rem; }
@media (max-width: 991.98px) {
  .login-hero { display: none; }
  .login-form-side { background: var(--brand-grad); }
  .login-card { background: var(--bs-body-bg); border-radius: 1.25rem; padding: 1.75rem; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); }
}
[data-bs-theme="dark"] .login-page-x { background: #0b1222; }

/* ---------- Mobile ---------- */
@media (max-width: 767.98px) {
  .page-title { font-size: 1.2rem; }
  .app-content-header { padding: 1rem .25rem .5rem; }
  .card-body { padding: 1rem; }
  .stat-card .stat-value { font-size: 1.35rem; }
  .hero-card .hero-big { font-size: 2rem; }
  .table-mobile-cards thead { display: none; }
  .table-mobile-cards tbody tr { display: block; border: 1px solid rgba(15,23,42,.08); border-radius: .9rem; margin: .65rem; padding: .35rem .25rem; }
  .table-mobile-cards tbody td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .35rem .6rem; text-align: right; }
  .table-mobile-cards tbody td::before { content: attr(data-label); font-weight: 600; color: var(--bs-secondary-color); text-align: left; font-size: .78rem; }
  .table-mobile-cards tbody td.td-main { display: block; text-align: left; }
  .table-mobile-cards tbody td.td-main::before { display: none; }
}

/* ---------- Print ---------- */
@media print {
  .app-sidebar, .app-header, .app-footer, .no-print, .sticky-actions { display: none !important; }
  .app-main { margin: 0 !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: #fff !important; }
}

/* ---------- Utilitas tambahan ---------- */
.min-w-0 { min-width: 0; }
.sidebar-menu .nav-link p { display: inline-flex; align-items: center; width: calc(100% - 2rem); }
.nav-badge { font-size: .68rem; padding: .25em .55em; border-radius: 50rem; }
.nav-tabs-soft { gap: .4rem; border: 0; }
.nav-tabs-soft .nav-link { border: 0; border-radius: .7rem; font-weight: 600; color: var(--bs-secondary-color); padding: .5rem 1rem; }
.nav-tabs-soft .nav-link.active { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 14px -8px rgba(37,99,235,.8); }
.logo-preview { width: 96px; height: 96px; object-fit: contain; border-radius: 1rem; border: 1px dashed rgba(15,23,42,.2); padding: 8px; background: #fff; }
