/* =========================================================
   FINAL POLISHING PROFESIONAL - CRS ULP / OTA / LMS / CBT
   Tujuan: merapikan semua halaman tanpa menghapus fitur/logic.
   Aman: hanya style layer terakhir, responsive, print, form/table/card.
   ========================================================= */
:root{
  --fp-primary:var(--pri,#0ea5e9);
  --fp-secondary:var(--pri2,#2563eb);
  --fp-ink:#0f172a;
  --fp-muted:#64748b;
  --fp-soft:#f8fafc;
  --fp-line:#e2e8f0;
  --fp-card:#ffffff;
  --fp-radius:22px;
  --fp-radius-sm:14px;
  --fp-shadow:0 22px 55px rgba(15,23,42,.09);
  --fp-shadow-sm:0 12px 28px rgba(15,23,42,.08);
  --fp-grad:linear-gradient(135deg,var(--fp-primary),var(--fp-secondary));
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;text-size-adjust:100%;-webkit-text-size-adjust:100%}
body{
  color:var(--fp-ink);
  background:
    radial-gradient(circle at top left,rgba(14,165,233,.14),transparent 34%),
    radial-gradient(circle at top right,rgba(16,185,129,.10),transparent 30%),
    #f4f7fb;
  -webkit-font-smoothing:antialiased;
  text-rendering:geometricPrecision;
}
a{color:inherit}
img,svg,video,canvas{max-width:100%;height:auto}
button,input,select,textarea{font:inherit}

/* Shell dan ruang konten */
.app-body .app-shell{min-height:100vh}
.main-content,main,.content,.page-content{
  max-width:1420px;
  width:100%;
}
.main-content > :first-child,main > :first-child{margin-top:0}

/* Kartu, panel dan section dibuat satu standar */
.card,.panel,.box,.content-card,.dashboard-primary-panel,.dashboard-clean-hero,
.role-separated-panel,.saas-card,.cbt-card,.report-card,.setting-card,.form-card,
.table-card,.admin-card,.feature-card,.pricing-card{
  border:1px solid rgba(226,232,240,.92)!important;
  border-radius:var(--fp-radius)!important;
  background:rgba(255,255,255,.94)!important;
  box-shadow:var(--fp-shadow-sm)!important;
  overflow:hidden;
}
.card:hover,.panel:hover,.dashboard-primary-panel:hover,.feature-card:hover,.pricing-card:hover{
  box-shadow:var(--fp-shadow)!important;
}
.card h1,.card h2,.card h3,.panel h1,.panel h2,.panel h3,
.dashboard-primary-panel h1,.dashboard-primary-panel h2,.dashboard-primary-panel h3{
  letter-spacing:-.035em;
}

/* Hero halaman internal */
.dashboard-clean-hero,.role-separated-hero,.page-hero,.saas-hero,.cbt-hero{
  background:
    linear-gradient(135deg,rgba(8,47,73,.96),rgba(14,116,144,.92)),
    radial-gradient(circle at 85% 20%,rgba(52,211,153,.26),transparent 38%)!important;
  color:#fff!important;
  border:0!important;
  position:relative;
}
.dashboard-clean-hero::after,.role-separated-hero::after,.page-hero::after,.saas-hero::after,.cbt-hero::after{
  content:"";position:absolute;inset:auto 22px 18px auto;width:170px;height:170px;border-radius:999px;
  background:radial-gradient(circle,rgba(255,255,255,.18),transparent 65%);pointer-events:none;
}
.eyebrow,.badge,.status-badge,.pill,.label-soft{
  border-radius:999px!important;
  display:inline-flex;align-items:center;gap:7px;
  font-weight:900!important;letter-spacing:.02em;
}

/* Tombol */
.btn,button[type="submit"],.button,.action-btn,.btn-primary,.btn-secondary,
a.btn,a.button,.dashboard-important-buttons a,.side-nav a{
  transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease,color .16s ease;
}
.btn:hover,button[type="submit"]:hover,.button:hover,.action-btn:hover,
.dashboard-important-buttons a:hover,.side-nav a:hover{transform:translateY(-1px)}
.btn-primary,button[type="submit"],.primary-btn,.action-primary{
  background:var(--fp-grad)!important;
  color:#fff!important;
  border:0!important;
  box-shadow:0 16px 30px rgba(37,99,235,.20)!important;
}
.btn-secondary,.secondary-btn,.btn-outline,.action-secondary{
  background:#fff!important;
  color:#0f172a!important;
  border:1px solid var(--fp-line)!important;
}

/* Form semua halaman */
input[type="text"],input[type="password"],input[type="email"],input[type="number"],
input[type="date"],input[type="time"],input[type="datetime-local"],input[type="file"],select,textarea{
  width:100%;
  min-height:44px;
  border:1px solid #dbe3ef!important;
  background:#fff!important;
  color:#0f172a!important;
  border-radius:14px!important;
  padding:11px 13px!important;
  outline:none!important;
  box-shadow:0 1px 0 rgba(15,23,42,.02)!important;
}
textarea{min-height:118px;resize:vertical;line-height:1.55}
input:focus,select:focus,textarea:focus{
  border-color:rgba(14,165,233,.78)!important;
  box-shadow:0 0 0 4px rgba(14,165,233,.12)!important;
}
label{font-weight:850;color:#334155;margin-bottom:7px;display:inline-block}
.form-grid,.grid-form,.filter-grid,.controls-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;align-items:end;
}
.form-actions,.action-row,.btn-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}

/* Table profesional */
.table-responsive,.table-wrap,.responsive-table,.data-table-wrap{width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
table{border-collapse:separate!important;border-spacing:0!important;width:100%}
th{
  background:#f8fafc!important;
  color:#334155!important;
  font-size:12px!important;
  text-transform:uppercase;
  letter-spacing:.045em;
  font-weight:1000!important;
  white-space:nowrap;
}
th,td{border-bottom:1px solid #e2e8f0!important;padding:12px 13px!important;vertical-align:top}
td{color:#1e293b;font-weight:650}
tbody tr:hover{background:#fbfdff!important}
tbody tr:last-child td{border-bottom:0!important}
.table-empty,.empty-state{
  border:1px dashed #cbd5e1;border-radius:18px;background:#f8fafc;padding:24px;text-align:center;color:#64748b;font-weight:750;
}

/* Sidebar */
.sidebar{
  background:linear-gradient(180deg,#07162f 0%,#0b2f5e 54%,#073b4c 100%)!important;
  border-right:1px solid rgba(255,255,255,.08)!important;
}
.side-brand,.app-sidebar-brand{border-bottom:1px solid rgba(255,255,255,.10)!important}
.side-nav .menu-title{
  color:rgba(255,255,255,.63)!important;
  font-weight:1000!important;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.side-nav a{
  border:1px solid rgba(255,255,255,.08)!important;
  border-radius:16px!important;
  margin:5px 8px!important;
}
.side-nav a.active{
  background:rgba(255,255,255,.16)!important;
  border-color:rgba(255,255,255,.28)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 14px 28px rgba(0,0,0,.18)!important;
}

/* Alert/notifikasi */
.alert,.notice,.flash,.info-box,.notification-box{
  border-radius:18px!important;border:1px solid rgba(226,232,240,.9)!important;
  box-shadow:var(--fp-shadow-sm)!important;
}
.alert-success,.notice-success{background:#ecfdf5!important;border-color:#bbf7d0!important;color:#065f46!important}
.alert-warning,.notice-warning{background:#fffbeb!important;border-color:#fde68a!important;color:#92400e!important}
.alert-danger,.notice-danger{background:#fef2f2!important;border-color:#fecaca!important;color:#991b1b!important}
.alert-info,.notice-info{background:#eff6ff!important;border-color:#bfdbfe!important;color:#1e3a8a!important}

/* CBT lebih rapi */
.cbt-layout,.cbt-question-list,.exam-layout{gap:18px!important}
.cbt-question,.question-card,.exam-question{
  border:1px solid #e2e8f0!important;border-radius:20px!important;background:#fff!important;box-shadow:var(--fp-shadow-sm)!important;
}
.cbt-option,.answer-option{
  border:1px solid #dbe3ef!important;border-radius:14px!important;background:#fff!important;padding:12px!important;
}
.cbt-option:hover,.answer-option:hover{border-color:rgba(14,165,233,.7)!important;background:#f8fbff!important}

/* Print resmi pendidikan */
@media print{
  body{background:#fff!important;color:#000!important;font-size:11pt!important}
  .sidebar,.topbar,.app-footer-pro,.btn,.button,button,.no-print,.form-actions,.dashboard-clean-hero{display:none!important}
  .app-shell,.main-content,main,.content{display:block!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important}
  .card,.panel,.report-card,.table-card{box-shadow:none!important;border:0!important;border-radius:0!important;background:#fff!important;overflow:visible!important}
  table{font-size:10pt!important;page-break-inside:auto!important}
  thead{display:table-header-group!important}
  tr{page-break-inside:avoid!important;page-break-after:auto!important}
  th,td{border:1px solid #000!important;padding:6px 7px!important;color:#000!important;background:#fff!important}
  a{text-decoration:none!important;color:#000!important}
}

/* Mobile-first cleanup */
.mobile-menu-toggle,.mobile-sidebar-close{
  display:none;
  border:0;border-radius:14px;background:var(--fp-grad);color:#fff;font-weight:1000;
  min-height:42px;padding:0 14px;box-shadow:0 12px 26px rgba(37,99,235,.22);
}
.mobile-sidebar-close{position:sticky;top:10px;z-index:5;margin:10px 10px 4px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.2)}
.mobile-sidebar-backdrop{position:fixed;inset:0;background:rgba(2,6,23,.52);z-index:999;display:none;backdrop-filter:blur(4px)}
body.sidebar-open .mobile-sidebar-backdrop{display:block}
@media(max-width:1024px){
  .mobile-menu-toggle,.mobile-sidebar-close{display:inline-flex;align-items:center;justify-content:center;gap:8px}
  .sidebar{position:fixed!important;z-index:1000!important;inset:0 auto 0 0;width:min(330px,86vw)!important;transform:translateX(-105%);transition:transform .22s ease;overflow:auto!important}
  body.sidebar-open .sidebar{transform:translateX(0)}
  .main-content,main,.content,.page-content{width:100%!important;max-width:100%!important;margin-left:0!important;padding-left:14px!important;padding-right:14px!important}
  .topbar,.navbar,.app-topbar{position:sticky;top:0;z-index:60;backdrop-filter:blur(16px)}
  .dashboard-important-buttons,.role-separated-buttons{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))!important}
}
@media(max-width:720px){
  body{font-size:14px}
  .card,.panel,.dashboard-primary-panel,.dashboard-clean-hero,.role-separated-panel{border-radius:18px!important}
  .dashboard-clean-hero,.role-separated-hero,.page-hero{padding:22px 18px!important}
  .dashboard-clean-hero h1,.dashboard-clean-hero h2,.page-hero h1{font-size:clamp(24px,8vw,36px)!important;line-height:1.08!important}
  .dashboard-panel-head{display:block!important}
  .form-actions,.action-row,.btn-row{display:grid;grid-template-columns:1fr;gap:9px}
  .form-actions .btn,.action-row .btn,.btn-row .btn,.form-actions button,.action-row button,.btn-row button{width:100%;justify-content:center}
  th,td{padding:10px 11px!important;font-size:13px!important}
  .dashboard-important-buttons,.role-separated-buttons{grid-template-columns:1fr!important}
  .control-user-card{width:100%!important;margin-top:12px}
}
@media(max-width:520px){
  .hide-mobile{display:none!important}
  .table-responsive table,.table-wrap table,.responsive-table table{min-width:720px}
  input,select,textarea{font-size:16px!important}
}


/* FINAL POLISH CTA BERLANGGANAN SEKOLAH/GURU */
body.public-body .ulp-subscribe-pro,
.ulp-subscribe-pro{
  position:relative!important;overflow:hidden!important;
  background:linear-gradient(135deg,#083b91 0%,#0b7cff 48%,#14c6d8 100%)!important;
  color:#fff!important;border:1px solid rgba(255,255,255,.42)!important;
  box-shadow:0 18px 40px rgba(11,124,255,.30), inset 0 1px 0 rgba(255,255,255,.35)!important;
  text-shadow:none!important;font-weight:1000!important;text-decoration:none!important;
}
body.public-body .ulp-subscribe-pro:before,.ulp-subscribe-pro:before{
  content:"";position:absolute;inset:-2px;background:linear-gradient(120deg,transparent 0%,rgba(255,255,255,.34) 38%,transparent 68%);transform:translateX(-120%);transition:transform .55s ease;
}
body.public-body .ulp-subscribe-pro:hover:before,.ulp-subscribe-pro:hover:before{transform:translateX(120%)}
body.public-body .ulp-subscribe-pro:hover,.ulp-subscribe-pro:hover{transform:translateY(-2px)}
.ulp-subscribe-pro>*{position:relative;z-index:2}
.ulp-subscribe-login{width:100%!important;height:auto!important;min-height:62px!important;justify-content:flex-start!important;padding:12px 16px!important;border-radius:18px!important;gap:12px!important}
.ulp-subscribe-login .sub-ico{width:42px;height:42px;display:grid;place-items:center;flex:0 0 42px;border-radius:14px;background:rgba(255,255,255,.18);font-size:22px}
.ulp-subscribe-login span:last-child{display:grid;gap:2px;text-align:left;line-height:1.2}
.ulp-subscribe-login b{font-size:15px;font-weight:1000;color:#fff}
.ulp-subscribe-login small{font-size:11px;font-weight:850;color:rgba(255,255,255,.88)}
.public-nav-links a[href*="subscribe_school"]{background:linear-gradient(135deg,#083b91,#0b7cff)!important;color:#fff!important;box-shadow:0 10px 24px rgba(11,124,255,.22)!important}
@media(max-width:640px){.ulp-subscribe-login{min-height:58px!important}.ulp-subscribe-login b{font-size:14px}.ulp-subscribe-login small{font-size:10.5px}}
