
/* ============================================================
   SIMPONPES GLOBAL THEME v1
   Satu sumber warna untuk Portal, PSB, Akademik, Guru, Eksekutif.
   ============================================================ */
:root{
  --sim-primary:#0b3b82;
  --sim-primary-2:#1769b0;
  --sim-primary-3:#2384d1;
  --sim-accent:#f4ad16;
  --sim-bg:#eef5fb;
  --sim-surface:#ffffff;
  --sim-soft:#f5f9fe;
  --sim-text:#10233f;
  --sim-muted:#71839a;
  --sim-border:#cbddef;
  --sim-success:#20ad73;

  /* aliases used by existing modules */
  --blue:var(--sim-primary) !important;
  --blue2:var(--sim-primary-2) !important;
  --blue3:var(--sim-primary-3) !important;
  --gold:var(--sim-accent) !important;
  --bg:var(--sim-bg) !important;
  --panel:var(--sim-surface) !important;
  --panel2:var(--sim-soft) !important;
  --soft:var(--sim-soft) !important;
  --text:var(--sim-text) !important;
  --muted:var(--sim-muted) !important;
  --border:var(--sim-border) !important;
  --line:var(--sim-border) !important;
  --green:var(--sim-success) !important;
}
html,body,button,input,select,textarea,table{
  font-family:Arial,Helvetica,sans-serif !important;
}

/* Sidebar/header common treatment */
.sidebar,.guru-sidebar,.exec-sidebar{
  background:linear-gradient(180deg,var(--sim-primary),var(--sim-primary-2)) !important;
}
header,.topbar,.guru-header,.exec-header{
  background:linear-gradient(90deg,var(--sim-primary),var(--sim-primary-2)) !important;
}

/* PSB uses its own class names in older builds: force common dark areas blue. */
body:not(.theme-dark) .sidebar,
body:not(.theme-dark) .app-sidebar,
body:not(.theme-dark) .psb-sidebar{
  background:linear-gradient(180deg,var(--sim-primary),var(--sim-primary-2)) !important;
}
body:not(.theme-dark) .topbar,
body:not(.theme-dark) .app-topbar,
body:not(.theme-dark) .psb-topbar{
  background:linear-gradient(90deg,var(--sim-primary),var(--sim-primary-2)) !important;
}

/* Main backgrounds/cards */
main,.content,.main-content,.guru-content,.exec-content{
  background:var(--sim-bg);
}
.card,.panel,.box,.stat,.module-card{
  border-color:var(--sim-border) !important;
}

/* Global accent */
.btn-primary,.btn-gold,.primary-button{
  background:linear-gradient(135deg,var(--sim-primary),var(--sim-primary-2)) !important;
  border-color:var(--sim-primary) !important;
  color:#fff !important;
}


/* ============================================================
   v1.1 - PSB LIGHT MODE FIX
   PSB lama mempunyai selector dark yang lebih kuat.
   Di mode terang, seluruh panel konten dipaksa mengikuti theme global.
   ============================================================ */
body.light,
body:not(.theme-dark){
  background:var(--sim-bg) !important;
  color:var(--sim-text) !important;
}

/* area kerja PSB */
body.light main,
body.light .main,
body.light .main-content,
body.light .content,
body.light .content-wrapper,
body.light .page-content,
body.light .psb-main,
body:not(.theme-dark) .main-content,
body:not(.theme-dark) .content-wrapper{
  background:var(--sim-bg) !important;
  color:var(--sim-text) !important;
}

/* cards/panels PSB */
body.light .card,
body.light .panel,
body.light .box,
body.light .stat,
body.light .stat-card,
body.light .dashboard-card,
body.light .process-card,
body.light .flow-card,
body.light .table-card,
body.light .form-card,
body.light .content-card,
body.light .section-card,
body.light .settings-card{
  background:var(--sim-surface) !important;
  color:var(--sim-text) !important;
  border-color:var(--sim-border) !important;
}

/* PSB build memakai body tanpa .light pada initial render */
body:not(.theme-dark) .stat,
body:not(.theme-dark) .stat-card,
body:not(.theme-dark) .dashboard-card,
body:not(.theme-dark) .process-card,
body:not(.theme-dark) .flow-card{
  background:var(--sim-surface) !important;
  color:var(--sim-text) !important;
  border-color:var(--sim-border) !important;
}

/* teks di card */
body.light .card h1,body.light .card h2,body.light .card h3,
body.light .panel h1,body.light .panel h2,body.light .panel h3,
body.light .stat b,body.light .stat-card b,
body.light .flow-card h2,body.light .process-card h2{
  color:var(--sim-text) !important;
}
body.light .card p,body.light .card small,
body.light .stat small,body.light .stat-card small{
  color:var(--sim-muted) !important;
}

/* tombol/alur kecil tetap terang */
body.light .flow-step,
body.light .step,
body.light .process-step,
body.light .flow-card a:not(.btn-primary),
body.light .process-card a:not(.btn-primary){
  background:var(--sim-soft) !important;
  color:var(--sim-text) !important;
  border-color:var(--sim-border) !important;
}

/* tabel/form */
body.light table,
body.light tbody,
body.light td{
  background:var(--sim-surface);
  color:var(--sim-text);
}
body.light input,
body.light select,
body.light textarea{
  background:var(--sim-soft) !important;
  color:var(--sim-text) !important;
  border-color:var(--sim-border) !important;
}

/* Sidebar/header tetap biru di mode terang */
body.light .sidebar,
body.light .app-sidebar,
body.light .psb-sidebar{
  background:linear-gradient(180deg,var(--sim-primary),var(--sim-primary-2)) !important;
  color:#fff !important;
}
body.light header,
body.light .topbar,
body.light .app-topbar,
body.light .psb-topbar{
  background:linear-gradient(90deg,var(--sim-primary),var(--sim-primary-2)) !important;
  color:#fff !important;
}

/* ===== MIBS v11.3 - Header logo lebih gelap ===== */
.sidebar .brand{
  background:#082f63!important;
  margin:-14px -12px 12px!important;
  padding:16px 14px!important;
  min-height:82px!important;
  border-bottom:1px solid rgba(255,255,255,.18)!important;
}
.sidebar .brand-logo{
  width:62px!important;
  height:62px!important;
  object-fit:contain!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  padding:0!important;
  box-shadow:none!important;
  flex:0 0 62px!important;
}
.sidebar .brand b,
.sidebar .brand .brand-name{
  color:#fff!important;
}
.sidebar .brand small{
  color:#d8eaff!important;
}

/* ===== MIBS v11.4 - Logo lebih kontras ===== */
.sidebar .brand{
  background:#082f63!important;
  min-height:92px!important;
}
.sidebar .brand-logo{
  width:72px!important;
  height:72px!important;
  flex:0 0 72px!important;
  object-fit:contain!important;
  background:#ffffff!important;
  border:2px solid #f1cf3a!important;
  border-radius:16px!important;
  padding:5px!important;
  box-shadow:0 3px 10px rgba(0,0,0,.18)!important;
}
.sidebar .brand > div:last-child{
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
}
.sidebar .brand b,
.sidebar .brand .brand-name{
  color:#ffffff!important;
  font-size:17px!important;
  line-height:1.05!important;
}
.sidebar .brand small{
  color:#dcecff!important;
  font-size:11px!important;
  margin-top:3px!important;
}

/* ===== MIBS KEBUMEN v12 ===== */
.sidebar .brand b,.sidebar .brand .brand-name{
  white-space:normal!important;
  word-break:normal!important;
  line-height:1.08!important;
}

/* ===== MIBS v12.1 - Komposisi Header Sidebar Seragam ===== */
.sidebar .brand{
  min-height:96px!important;
  height:96px!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  padding:14px 16px!important;
  margin:0!important;
  background:#082f63!important;
  border-bottom:1px solid rgba(255,255,255,.18)!important;
}
.sidebar .brand-logo{
  width:58px!important;
  height:58px!important;
  min-width:58px!important;
  flex:0 0 58px!important;
  object-fit:contain!important;
  background:#fff!important;
  border:2px solid #f1cf3a!important;
  border-radius:14px!important;
  padding:4px!important;
  box-sizing:border-box!important;
  box-shadow:none!important;
}
.sidebar .brand > div:last-child{
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
}
.sidebar .brand b,
.sidebar .brand .brand-name{
  display:block!important;
  margin:0!important;
  color:#fff!important;
  font-size:17px!important;
  font-weight:800!important;
  line-height:1.08!important;
  white-space:normal!important;
}
.sidebar .brand small{
  display:block!important;
  margin-top:4px!important;
  color:#dcecff!important;
  font-size:11px!important;
  line-height:1.1!important;
  font-weight:500!important;
}

/* ===== MIBS v118 - Guru desktop header text must stay white ===== */
@media (min-width:761px){
  body.mibs-guru-v27 .guru27-header .header-left strong,
  body.mibs-guru-v27 .guru27-header .guru27-user b,
  body.mibs-guru-v27 .guru27-header .guru27-user small,
  body.mibs-guru-v27 .guru27-header .header-right > a:last-child{
    color:#fff !important;
  }
  body.mibs-guru-v27 .guru27-header .header-right > a:last-child:hover{
    color:#fff !important;
    opacity:.88;
  }
}
