/* ================================================================
   SK@S PPD Besut — Main Stylesheet v2.0
   Design: Professional Admin Console + Google Sites Embeddable
================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Custom Properties ── */
:root {
  --font:        'Inter', system-ui, sans-serif;

  /* Brand */
  --brand:       #1d4ed8;
  --brand-light: #dbeafe;
  --brand-dark:  #1e3a8a;

  /* Neutrals */
  --bg:          #f1f5f9;
  --surface:     #ffffff;
  --surface-2:   #f8fafc;
  --border:      #e2e8f0;
  --border-dark: #cbd5e1;

  /* Text */
  --text:        #0f172a;
  --text-2:      #334155;
  --text-muted:  #64748b;
  --text-faint:  #94a3b8;

  /* Status */
  --green:       #16a34a;
  --green-bg:    #dcfce7;
  --yellow:      #d97706;
  --yellow-bg:   #fef9c3;
  --red:         #dc2626;
  --red-bg:      #fee2e2;
  --blue:        #2563eb;
  --blue-bg:     #dbeafe;
  --purple:      #7c3aed;
  --purple-bg:   #ede9fe;

  /* Standard colors */
  --s1:  #7c3aed;
  --s2:  #1d4ed8;
  --s3:  #0891b2;
  --s4:  #059669;
  --s5:  #d97706;
  --sa:  #dc2626;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.14);

  /* Radius */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  24px;

  /* Transition */
  --ease:  all .2s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ================================================================
   APP NAVIGATION
================================================================ */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  height: 56px;
  gap: 1rem;
}

.nav-left  { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.nav-right { display: flex; align-items: center; gap: .5rem;  flex-shrink: 0; position: relative; }

.nav-btn {
  border: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .9rem;
  transition: var(--ease);
  flex-shrink: 0;
  text-decoration: none;
}
.nav-btn:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }
.nav-btn-accent {
  width: auto;
  padding: 0 .75rem;
  gap: .4rem;
  color: var(--brand);
  border-color: var(--brand-light);
  background: var(--brand-light);
  font-size: .78rem;
  font-weight: 700;
}
.nav-btn-accent:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.nav-btn-label { font-size: .75rem; font-weight: 700; }

.nav-brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-logo {
  background: linear-gradient(135deg, var(--brand) 0%, var(--purple) 100%);
  color: #fff;
  font-weight: 900;
  font-size: .85rem;
  letter-spacing: -.5px;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-main { font-size: .85rem; font-weight: 800; color: var(--text); }
.brand-sub  { font-size: .68rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* User pill */
.nav-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .6rem;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--ease);
  border: 1px solid transparent;
}
.nav-user:hover { background: var(--surface-2); border-color: var(--border); }
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--purple));
  color: #fff;
  font-weight: 800;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; line-height: 1.15; }
.user-name { font-size: .78rem; font-weight: 700; color: var(--text); }
.user-role { font-size: .65rem; color: var(--text-muted); font-weight: 500; }

/* Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 999;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: var(--ease);
}
.user-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-header { padding: .85rem 1rem; background: var(--surface-2); }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem 1rem;
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-2);
  transition: var(--ease);
}
.dropdown-item:hover { background: var(--surface-2); color: var(--brand); }
.dropdown-item i { width: 16px; text-align: center; color: var(--text-muted); }
.dropdown-item:hover i { color: var(--brand); }
.dropdown-item.text-danger { color: var(--red); }
.dropdown-item.text-danger:hover { background: var(--red-bg); }
.dropdown-item.text-danger i { color: var(--red); }
.dropdown-divider { height: 1px; background: var(--border); }

/* ================================================================
   PAGE LAYOUT
================================================================ */
.page-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.25rem 1rem 5rem;
}
.page-container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* ================================================================
   WELCOME / HERO BANNER
================================================================ */
.hero-banner {
  background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
  border-radius: var(--r-xl);
  padding: 1.5rem 1.5rem 1.25rem;
  color: #fff;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(29,78,216,.35);
}
.hero-banner::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}
.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -30px; left: 30%;
  width: 120px; height: 120px;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
}
.hero-eyebrow {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: .75;
  margin-bottom: .35rem;
}
.hero-title {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: .35rem;
}
.hero-sub {
  font-size: .82rem;
  opacity: .8;
  font-weight: 500;
}
.hero-stats {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid rgba(255,255,255,.2);
}
.hero-stat { flex: 1; }
.hero-stat-val { font-size: 1.4rem; font-weight: 900; line-height: 1; }
.hero-stat-lbl { font-size: .68rem; opacity: .75; margin-top: .15rem; }

/* ================================================================
   STANDARD CARDS (Dashboard Navigation)
================================================================ */
.std-grid { display: flex; flex-direction: column; gap: .65rem; }

.std-card-new {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: var(--ease);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.std-card-new:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-dark);
  transform: translateY(-1px);
}
.std-card-new:hover .std-arrow { opacity: 1; transform: translateX(3px); }

.std-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: #fff;
}
.std-body { flex: 1; min-width: 0; }
.std-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.std-title { font-size: .95rem; font-weight: 800; color: var(--text); margin-top: .05rem; }
.std-meta  { font-size: .72rem; color: var(--text-muted); margin-top: .15rem; font-weight: 500; }
.std-right { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; flex-shrink: 0; }
.std-arrow { font-size: .85rem; color: var(--text-faint); transition: var(--ease); opacity: .6; }

/* Progress mini */
.prog-mini { width: 60px; }
.prog-mini-bar {
  height: 4px;
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
}
.prog-mini-fill { height: 100%; border-radius: 50px; transition: width 1s ease; }
.prog-mini-label { font-size: .65rem; font-weight: 700; margin-top: .2rem; text-align: right; }

/* Color variants for std icons */
.bg-s1 { background: var(--s1); }
.bg-s2 { background: var(--s2); }
.bg-s3 { background: var(--s3); }
.bg-s4 { background: var(--s4); }
.bg-s5 { background: var(--s5); }
.bg-sa { background: var(--sa); }
.text-s1 { color: var(--s1); }
.text-s2 { color: var(--s2); }
.text-s3 { color: var(--s3); }
.text-s4 { color: var(--s4); }
.text-s5 { color: var(--s5); }
.text-sa { color: var(--sa); }

/* ================================================================
   ASPEK LIST TABLE
================================================================ */
.aspek-table {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.aspek-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.aspek-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--ease);
}
.aspek-row:last-child { border-bottom: none; }
.aspek-row:hover { background: var(--surface-2); }
.aspek-code {
  min-width: 52px;
  font-size: .72rem;
  font-weight: 800;
  padding: .25rem .5rem;
  border-radius: var(--r-sm);
  background: var(--blue-bg);
  color: var(--blue);
  text-align: center;
  flex-shrink: 0;
}
.aspek-name { flex: 1; font-size: .87rem; font-weight: 600; color: var(--text-2); line-height: 1.35; }
.badge-ev {
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
}
.badge-ok     { background: var(--green-bg); color: var(--green); }
.badge-empty  { background: var(--red-bg);   color: var(--red); }
.badge-partial{ background: var(--yellow-bg);color: var(--yellow); }

/* ================================================================
   SECTION TITLE
================================================================ */
.section-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: .65rem;
  margin-top: 1.5rem;
}
.section-title:first-child { margin-top: 0; }

/* ================================================================
   STAT CARDS (Admin Dashboard)
================================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 1.1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  border-radius: 0 var(--r-lg) 0 60px;
  opacity: .07;
}
.stat-card.blue  { border-top: 3px solid var(--blue);   }
.stat-card.blue::before  { background: var(--blue);   }
.stat-card.green { border-top: 3px solid var(--green);  }
.stat-card.green::before { background: var(--green);  }
.stat-card.yellow{ border-top: 3px solid var(--yellow); }
.stat-card.yellow::before{ background: var(--yellow); }
.stat-card.red   { border-top: 3px solid var(--red);    }
.stat-card.red::before   { background: var(--red);    }
.stat-card.purple{ border-top: 3px solid var(--purple); }
.stat-card.purple::before{ background: var(--purple); }
.stat-val  { font-size: 2rem; font-weight: 900; line-height: 1; color: var(--text); }
.stat-lbl  { font-size: .75rem; color: var(--text-muted); font-weight: 600; margin-top: .35rem; }
.stat-icon { position: absolute; top: .85rem; right: .85rem; font-size: 1.3rem; opacity: .15; }

/* ================================================================
   TABLE (Admin)
================================================================ */
.data-table-wrap {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.data-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.data-table-title { font-size: .9rem; font-weight: 800; color: var(--text); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  font-weight: 700;
  padding: .6rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.data-table td {
  padding: .75rem 1rem;
  font-size: .85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-2);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }

/* Progress bar in table */
.prog-row-wrap { display: flex; align-items: center; gap: .5rem; }
.prog-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
  min-width: 60px;
}
.prog-bar-fill {
  height: 100%;
  border-radius: 50px;
  transition: width 1s ease;
}
.prog-bar-fill.green  { background: var(--green); }
.prog-bar-fill.yellow { background: var(--yellow); }
.prog-bar-fill.red    { background: var(--red); }

/* ================================================================
   LOGIN PAGE
================================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #1e3a8a 100%);
}
.login-card {
  background: rgba(255,255,255,.97);
  border-radius: var(--r-xl);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
}
.login-logo {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--brand), var(--purple));
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  margin: 0 auto 1.25rem;
}
.login-title { text-align: center; font-size: 1.2rem; font-weight: 900; color: var(--text); margin-bottom: .25rem; }
.login-sub   { text-align: center; font-size: .83rem; color: var(--text-muted); margin-bottom: 1.75rem; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  width: 100%;
  padding: .85rem 1.25rem;
  background: #fff;
  border: 2px solid var(--border-dark);
  border-radius: var(--r-md);
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: var(--ease);
  text-decoration: none;
}
.btn-google:hover {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}
.btn-google img { width: 20px; height: 20px; }

/* Dev login  */
.dev-login-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}
.dev-notice {
  font-size: .72rem;
  color: var(--text-faint);
  text-align: center;
  margin-bottom: .75rem;
  font-weight: 600;
}

/* ================================================================
   FORMS
================================================================ */
.form-group { margin-bottom: .9rem; }
.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: .35rem;
}
.form-control {
  width: 100%;
  padding: .6rem .8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: .87rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: var(--ease);
  box-sizing: border-box;
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29,78,216,.1); }

/* ================================================================
   BUTTONS
================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .65rem 1.25rem;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--ease);
  text-decoration: none;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); box-shadow: var(--shadow-sm); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
}
.btn-outline:hover { background: var(--brand-light); }
.btn-sm { padding: .4rem .75rem; font-size: .78rem; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.w-100 { width: 100%; }

/* ================================================================
   CHART / DONUT PLACEHOLDER
================================================================ */
.chart-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.chart-card-title { font-size: .85rem; font-weight: 800; color: var(--text); margin-bottom: 1rem; }

/* ================================================================
   EMPTY STATE
================================================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-faint);
}
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .75rem; }
.empty-state p { font-size: .88rem; font-weight: 500; }

/* ================================================================
   ALERT / INFO BOX
================================================================ */
.alert {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  padding: .75rem 1rem;
  border-radius: var(--r-md);
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.alert-info    { background: #eff6ff; border-left: 3px solid var(--blue);   color: #1e40af; }
.alert-warning { background: var(--yellow-bg); border-left: 3px solid var(--yellow); color: #78350f; }
.alert-success { background: var(--green-bg);  border-left: 3px solid var(--green);  color: #14532d; }
.alert-danger  { background: var(--red-bg);    border-left: 3px solid var(--red);    color: #7f1d1d; }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 600px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-sub  { max-width: 120px; }
  .nav-btn-label { display: none; }
  .nav-btn-accent { width: 34px; padding: 0; }
  .user-info  { display: none; }
}

/* ================================================================
   GOOGLE SITES EMBED MODE
   Papar tanpa nav apabila ?embed=1 dalam URL
================================================================ */
body.embed-mode .app-nav { display: none; }
body.embed-mode { background: transparent; }
body.embed-mode .page-container,
body.embed-mode .page-container-wide { padding-top: .5rem; }

/* ================================================================
   PRINT
================================================================ */
@media print {
  .app-nav { display: none; }
  .page-container, .page-container-wide { max-width: 100%; padding: 0; }
}

/* ================================================================
   LEGACY COMPAT (untuk fail lama yang masih guna class lama)
================================================================ */
.dashboard-container { max-width: 680px; margin: 0 auto; padding: 1.25rem 1rem 5rem; }
.top-nav { display: none; }   /* gantikan dengan .app-nav */
.section-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: .5rem;
  margin-top: 1.25rem;
}
.table-container {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  margin-bottom: 1rem;
}
.upload-panel {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}
.upload-panel h3 { font-size: .9rem; font-weight: 800; margin-bottom: 1rem; }

/* ================================================================
   ADMIN CONSOLE LAYOUT & NAVIGATOR (v2.5)
   Piawaian Reka Bentuk Moden: Sidebar, Topbar, Modal & Embed
================================================================ */
.console-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg);
}

/* ── Sidebar ── */
.console-sidebar {
  width: 275px;
  flex-shrink: 0;
  background: #0b1329;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 500;
  border-right: 1px solid #1e293b;
  box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  transition: transform .25s ease, width .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid #1e293b;
  background: #080e1e;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.brand-badge-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: .5px;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
}

.brand-text-block .brand-title {
  font-size: .95rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: .5px;
  line-height: 1.2;
}

.brand-text-block .brand-subtitle {
  font-size: .68rem;
  color: #94a3b8;
  font-weight: 600;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: .25rem;
}

/* ── Context Card (Sekolah Aktif & Peranan) ── */
.sidebar-context-card {
  margin: 1rem 1.1rem .5rem;
  padding: .85rem 1rem;
  background: #131d36;
  border: 1px solid #1e293b;
  border-radius: var(--r-md);
  position: relative;
}

.context-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #64748b;
  margin-bottom: .25rem;
}

.status-indicator-live {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: #22c55e;
  font-size: .62rem;
  font-weight: 800;
}
.status-indicator-live i { font-size: .45rem; animation: pulse 2s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.context-school-name {
  font-size: .84rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.3;
  margin-bottom: .4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-code-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .6rem;
}

.school-code-chip {
  background: #1e293b;
  color: #94a3b8;
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 5px;
  border: 1px solid #334155;
}

.role-pill-badge {
  font-size: .65rem;
  font-weight: 800;
  padding: .15rem .5rem;
  border-radius: 50px;
  letter-spacing: .3px;
}
.role-pill-badge.role-admin_sekolah { background: #dbeafe; color: #1d4ed8; }
.role-pill-badge.role-ppd           { background: #f3e8ff; color: #7e22ce; }
.role-pill-badge.role-guru          { background: #dcfce7; color: #15803d; }

.btn-context-switch {
  width: 100%;
  padding: .45rem .65rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 7px;
  color: #cbd5e1;
  font-size: .73rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  transition: var(--ease);
}
.btn-context-switch:hover { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Panel Tukar Peranan Dropdown */
.context-dropdown-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: var(--r-md);
  padding: .85rem;
  z-index: 600;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  margin-top: .4rem;
}
.context-dropdown-panel.open { display: block; }
.context-dropdown-header { font-size: .7rem; font-weight: 800; color: #94a3b8; text-transform: uppercase; margin-bottom: .4rem; }

.role-switch-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .35rem;
}
.btn-role {
  font-size: .68rem;
  font-weight: 700;
  padding: .4rem .3rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #cbd5e1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  transition: var(--ease);
}
.btn-role i { font-size: .85rem; }
.btn-role.active { background: #2563eb; color: #fff; border-color: #3b82f6; }
.btn-role:hover:not(.active) { background: #334155; color: #fff; }

/* ── Nav Scrollable Area ── */
.sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: .5rem 1rem 1.5rem;
}
.sidebar-nav-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-nav-scroll::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }

.nav-section-heading {
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #475569;
  margin: 1.2rem .35rem .4rem;
}

.nav-list { list-style: none; display: flex; flex-direction: column; gap: .2rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  font-size: .83rem;
  font-weight: 600;
  color: #94a3b8;
  transition: var(--ease);
  position: relative;
}
.nav-link:hover {
  background: #131d36;
  color: #f8fafc;
}
.nav-link.active {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
  font-weight: 700;
  border-left: 3px solid #3b82f6;
}

.nav-icon { font-size: .95rem; width: 18px; text-align: center; color: #64748b; }
.nav-link.active .nav-icon { color: #60a5fa; }
.nav-text { flex: 1; }

.std-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-badge-pill {
  font-size: .65rem;
  font-weight: 800;
  padding: .15rem .45rem;
  background: #1e293b;
  color: #94a3b8;
  border-radius: 50px;
}
.nav-arrow { font-size: .65rem; opacity: .5; transition: transform .2s ease; }
.nav-item.has-submenu.open .nav-arrow { transform: rotate(90deg); }

.nav-submenu {
  list-style: none;
  padding-left: 1.8rem;
  display: none;
  flex-direction: column;
  gap: .15rem;
  margin: .2rem 0 .4rem;
}
.nav-item.has-submenu.open .nav-submenu { display: flex; }

.sub-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .6rem;
  font-size: .78rem;
  font-weight: 500;
  color: #64748b;
  border-radius: 6px;
  transition: var(--ease);
}
.sub-link:hover { color: #f8fafc; background: #131d36; }
.sub-link.active { color: #93c5fd; font-weight: 700; background: rgba(37, 99, 235, 0.12); }
.sub-code {
  font-size: .68rem;
  font-weight: 800;
  background: #1e293b;
  color: #94a3b8;
  padding: .05rem .35rem;
  border-radius: 4px;
}
.sub-link.active .sub-code { background: #1d4ed8; color: #fff; }

/* Sidebar User Footer */
.sidebar-user-footer {
  padding: .85rem 1.1rem;
  border-top: 1px solid #1e293b;
  background: #080e1e;
  display: flex;
  align-items: center;
  gap: .65rem;
}

.user-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .85rem;
  flex-shrink: 0;
}

.user-meta-info { flex: 1; min-width: 0; }
.user-display-name {
  font-size: .8rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email-text {
  font-size: .68rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  font-size: .85rem;
  transition: var(--ease);
}
.btn-logout-icon:hover { background: #ef4444; color: #fff; }

/* ── Main Content Area ── */
.console-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* ── Topbar Header ── */
.console-topbar {
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
  gap: 1rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}

.topbar-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--ease);
  font-size: 1rem;
  flex-shrink: 0;
}
.topbar-toggle-btn:hover { background: var(--border); color: var(--text); }

.console-breadcrumbs {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .83rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb-root { color: var(--brand); }
.crumb-separator { color: var(--text-faint); font-size: .65rem; }
.crumb-item { color: var(--text-muted); }
.crumb-item.active { color: var(--text); font-weight: 700; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-shrink: 0;
}

/* Quick Jump Button */
.btn-quick-jump {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .85rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--ease);
}
.btn-quick-jump:hover { border-color: var(--brand); color: var(--text); background: #fff; }
.shortcut-kbd {
  background: #fff;
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  padding: .1rem .35rem;
  font-size: .68rem;
  font-family: monospace;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
}

.btn-top-action {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--ease);
}
.btn-embed-pill {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.btn-embed-pill:hover { background: #1d4ed8; color: #fff; }

.topbar-user-badge {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50px;
  cursor: pointer;
  transition: var(--ease);
}
.topbar-user-badge:hover { background: #fff; border-color: var(--border-dark); }
.role-indicator-badge {
  font-size: .62rem;
  font-weight: 800;
  padding: .1rem .45rem;
  border-radius: 50px;
  text-transform: uppercase;
}
.role-indicator-badge.role-admin_sekolah { background: #dbeafe; color: #1d4ed8; }
.role-indicator-badge.role-ppd           { background: #f3e8ff; color: #7e22ce; }
.role-indicator-badge.role-guru          { background: #dcfce7; color: #15803d; }
.user-shortname { font-size: .8rem; font-weight: 700; color: var(--text); }

/* ── Content Body ── */
.console-content-body {
  flex: 1;
  padding: 1.5rem;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* ── Console Footer ── */
.console-footer {
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--text-muted);
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-right { display: flex; align-items: center; gap: 1rem; }
.footer-status-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: #f0fdf4;
  color: #15803d;
  padding: .2rem .55rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: .72rem;
  border: 1px solid #bbf7d0;
}
.footer-link { color: var(--brand); font-weight: 600; }
.footer-link:hover { text-decoration: underline; }

/* ================================================================
   MODALS: EMBED & COMMAND PALETTE
================================================================ */
.console-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.console-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.console-modal-card {
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform .2s ease;
}
.console-modal-overlay.active .console-modal-card {
  transform: scale(1);
}

.modal-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.modal-close-icon {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-faint);
  cursor: pointer;
  line-height: 1;
}
.modal-close-icon:hover { color: var(--text); }

.modal-card-body { padding: 1.5rem; }
.modal-card-footer {
  padding: 1rem 1.5rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

.copy-input-group {
  display: flex;
  gap: .4rem;
}
.copy-input-group .form-control { flex: 1; font-family: monospace; font-size: .8rem; }

.embed-instructions-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem;
}
.inst-title {
  font-size: .82rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.inst-steps {
  font-size: .78rem;
  color: var(--text-2);
  line-height: 1.8;
  padding-left: 1.25rem;
}

/* Quick Jump Palette */
.quick-jump-card { max-width: 620px; }
.quick-jump-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: .75rem;
}
.quick-jump-icon { font-size: 1.1rem; color: var(--brand); }
.quick-jump-input {
  flex: 1;
  border: none;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  outline: none;
}
.quick-jump-results {
  max-height: 380px;
  overflow-y: auto;
  padding: .5rem;
}
.quick-jump-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem 1rem;
  border-radius: var(--r-md);
  transition: var(--ease);
  cursor: pointer;
}
.quick-jump-item:hover { background: var(--surface-2); }
.qj-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.qj-info { flex: 1; min-width: 0; }
.qj-title { font-size: .85rem; font-weight: 700; color: var(--text); }
.qj-std   { font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.qj-arrow { font-size: .8rem; color: var(--text-faint); opacity: 0; transition: var(--ease); }
.quick-jump-item:hover .qj-arrow { opacity: 1; transform: translateX(3px); color: var(--brand); }

.quick-jump-footer {
  padding: .65rem 1.25rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-size: .72rem;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
}

/* Toast */
.console-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: var(--r-md);
  font-size: .83rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  transform: translateY(20px);
  transition: all .25s ease;
  pointer-events: none;
}
.console-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   GOOGLE SITES EMBED ADAPTATION (embed-mode)
================================================================ */
body.embed-mode .console-sidebar { display: none !important; }
body.embed-mode .console-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: 50px;
  padding: 0 1rem;
}
body.embed-mode .topbar-toggle-btn { display: none; }
body.embed-mode .console-content-body { padding: 1rem .75rem; max-width: 100%; }
body.embed-mode .console-footer { display: none; }
body.embed-mode .btn-embed-pill { display: none; }

/* ================================================================
   RESPONSIVE: MOBILE & COLLAPSED
================================================================ */
@media (max-width: 992px) {
  .console-sidebar {
    position: fixed;
    transform: translateX(-100%);
    width: 280px;
  }
  .console-sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-close-btn { display: block; }
  .sidebar-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 490;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  .sidebar-mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
  }
  .btn-quick-jump .quick-jump-label,
  .btn-quick-jump .shortcut-kbd { display: none; }
  .user-shortname { display: none; }
}

body.sidebar-collapsed .console-sidebar {
  width: 72px;
}
body.sidebar-collapsed .brand-text-block,
body.sidebar-collapsed .sidebar-context-card,
body.sidebar-collapsed .nav-section-heading,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-badge-pill,
body.sidebar-collapsed .nav-arrow,
body.sidebar-collapsed .nav-submenu,
body.sidebar-collapsed .user-meta-info,
body.sidebar-collapsed .btn-logout-icon {
  display: none !important;
}
body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: .75rem;
}
body.sidebar-collapsed .sidebar-user-footer {
  justify-content: center;
}
