/* =====================================================================
   SIMAK BUTONRAYA — Design System
   Clean minimalist light mode, aksen peach-terracotta
   ===================================================================== */

:root {
  --sb-bg: #FAF7F3;
  --sb-white: #FFFFFF;
  --sb-accent-1: #E8A87C;
  --sb-accent-2: #D97757;
  --sb-blue: #DCEBFA;
  --sb-blue-text: #3B6FA0;
  --sb-lavender: #EAE3F7;
  --sb-lavender-text: #6B4FA0;
  --sb-text-dark: #1A1A1A;
  --sb-text-sub: #6B7280;
  --sb-border: #F0EAE3;
  --sb-radius-lg: 24px;
  --sb-radius-md: 20px;
  --sb-radius-sm: 14px;
  --sb-shadow: 0 8px 24px rgba(26,26,26,0.06);
  --sb-shadow-strong: 0 12px 32px rgba(217,119,87,0.20);
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

body.sb-body {
  margin: 0;
  background: var(--sb-bg);
  color: var(--sb-text-dark);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .sb-heading {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  color: var(--sb-text-dark);
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ============ SHELL / LAYOUT ============ */
.sb-shell {
  display: flex;
  min-height: 100vh;
}

.sb-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--sb-white);
  border-right: 1px solid var(--sb-border);
  display: none;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
@media (min-width: 1024px) {
  .sb-sidebar { display: flex; }
}

.sb-sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 8px 8px 24px; }
.sb-sidebar-brand-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, var(--sb-accent-1), var(--sb-accent-2));
  color: #fff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sb-sidebar-brand-icon--logo {
  background: transparent;
  border: none;
  padding: 0;
}
.sb-sidebar-brand-icon--logo img {
  width: 100%; height: 100%; object-fit: contain;
}
.sb-sidebar-brand-title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 15px; line-height: 1.2; }
.sb-sidebar-brand-sub { font-size: 12px; color: var(--sb-text-sub); }

.sb-sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.sb-sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 14px;
  color: var(--sb-text-sub); font-weight: 600; font-size: 14px;
  transition: background .15s ease, color .15s ease;
}
.sb-sidebar-link:hover { background: var(--sb-bg); color: var(--sb-text-dark); }
.sb-sidebar-link.active { background: linear-gradient(135deg, var(--sb-accent-1), var(--sb-accent-2)); color: #fff; box-shadow: var(--sb-shadow-strong); }
.sb-sidebar-link i { width: 19px; height: 19px; }

.sb-sidebar-logout {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 14px; color: #B45454; font-weight: 600; font-size: 14px;
  margin-top: 8px;
}
.sb-sidebar-logout:hover { background: #FBEAEA; }
.sb-sidebar-logout i { width: 18px; height: 18px; }

.sb-main { flex: 1; min-width: 0; padding-bottom: 96px; }
@media (min-width: 1024px) { .sb-main { padding-bottom: 32px; } }

/* ============ TOP BAR ============ */
.sb-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 8px;
}
@media (min-width: 1024px) { .sb-topbar { padding: 28px 32px 8px; } }

.sb-topbar-greet { display: flex; align-items: center; gap: 12px; }
.sb-topbar-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--sb-lavender); color: var(--sb-lavender-text);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sb-topbar-title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 17px; }
.sb-topbar-title span { color: var(--sb-accent-2); }
.sb-topbar-sub { font-size: 12.5px; color: var(--sb-text-sub); }

.sb-badge-authority {
  font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 999px;
  background: var(--sb-text-dark); color: #fff; white-space: nowrap;
}

.sb-content { padding: 12px 20px 24px; }
@media (min-width: 1024px) { .sb-content { padding: 12px 32px 32px; } }

/* ============ CARDS ============ */
.sb-card {
  background: var(--sb-white);
  border-radius: var(--sb-radius-lg);
  box-shadow: var(--sb-shadow);
  padding: 20px;
}
.sb-card-flat {
  background: var(--sb-white);
  border-radius: var(--sb-radius-md);
  padding: 16px;
  border: 1px solid var(--sb-border);
}

.sb-progress-card {
  border-radius: var(--sb-radius-lg);
  background: linear-gradient(135deg, var(--sb-accent-1), var(--sb-accent-2));
  color: #fff; padding: 22px; box-shadow: var(--sb-shadow-strong);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.sb-progress-card-title { font-family:'Plus Jakarta Sans',sans-serif; font-weight: 700; font-size: 15px; opacity: .95; }
.sb-progress-card-value { font-family:'Plus Jakarta Sans',sans-serif; font-weight: 800; font-size: 30px; margin-top: 2px; }
.sb-progress-ring { flex-shrink: 0; }

.sb-stat-card {
  border-radius: var(--sb-radius-md);
  padding: 16px; background: var(--sb-white); box-shadow: var(--sb-shadow);
}
.sb-stat-card .sb-stat-icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.sb-stat-card .sb-stat-value { font-family:'Plus Jakarta Sans',sans-serif; font-weight: 800; font-size: 22px; }
.sb-stat-card .sb-stat-label { font-size: 12.5px; color: var(--sb-text-sub); }
.sb-tone-peach  { background: #FCEBDD; color: var(--sb-accent-2); }
.sb-tone-blue   { background: var(--sb-blue); color: var(--sb-blue-text); }
.sb-tone-lav    { background: var(--sb-lavender); color: var(--sb-lavender-text); }
.sb-tone-green  { background: #E1F3E8; color: #2F8F5B; }
.sb-tone-rose   { background: #FBE3E3; color: #B25454; }

/* Warna cerah ala ikon aplikasi (GoPay-style) khusus menu cepat mobile */
.sb-vivid-orange { background: #FF7A45; color: #fff; }
.sb-vivid-blue   { background: #4F7CFF; color: #fff; }
.sb-vivid-teal   { background: #14B8A6; color: #fff; }
.sb-vivid-purple { background: #8B5CF6; color: #fff; }
.sb-vivid-green  { background: #22C55E; color: #fff; }
.sb-vivid-sky    { background: #0EA5E9; color: #fff; }
.sb-vivid-amber  { background: #F5A524; color: #fff; }
.sb-vivid-red    { background: #F0506E; color: #fff; }

/* Menu cepat (mobile) - menu yang tidak muat di bottom nav, tampil sebagai grid ikon */
.sb-quickmenu {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
  background: var(--sb-white);
  border-radius: var(--sb-radius-md);
  box-shadow: var(--sb-shadow);
  padding: 18px 10px;
  margin-top: 14px;
}
.sb-quickmenu-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; color: var(--sb-text-dark);
}
.sb-quickmenu-icon {
  width: 50px; height: 50px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}
.sb-quickmenu-icon i { width: 22px; height: 22px; }
.sb-quickmenu-item span:last-child { font-size: 11.5px; font-weight: 600; color: var(--sb-text-sub); line-height: 1.25; }
@media (min-width: 1024px) { .sb-quickmenu { display: none; } }

/* ============ BUTTONS ============ */
.sb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 16px; font-weight: 700; font-size: 14px;
  border: none; cursor: pointer; transition: transform .1s ease, box-shadow .15s ease, opacity .15s ease;
}
.sb-btn:active { transform: scale(0.97); }
.sb-btn-primary { background: linear-gradient(135deg, var(--sb-accent-1), var(--sb-accent-2)); color: #fff; box-shadow: var(--sb-shadow-strong); }
.sb-btn-primary:hover { opacity: .93; }
.sb-btn-dark { background: var(--sb-text-dark); color: #fff; }
.sb-btn-ghost { background: var(--sb-white); color: var(--sb-text-dark); border: 1px solid var(--sb-border); }
.sb-btn-ghost:hover { background: var(--sb-bg); }
.sb-btn-danger { background: #FBEAEA; color: #B23B3B; }
.sb-btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 12px; }
.sb-btn-block { width: 100%; }
.sb-btn:disabled { opacity: .5; cursor: not-allowed; }

.sb-fab {
  position: fixed; bottom: 88px; right: 20px; z-index: 40;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--sb-text-dark); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}
@media (min-width: 1024px) { .sb-fab { display: none; } }

/* ============ BOTTOM NAV (mobile) ============ */
.sb-bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--sb-white); border-top: 1px solid var(--sb-border);
  display: flex; align-items: center; justify-content: space-around;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 1024px) { .sb-bottomnav { display: none; } }

.sb-bottomnav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--sb-text-sub); font-size: 10.5px; font-weight: 600; padding: 4px 8px; }
.sb-bottomnav-item i { width: 21px; height: 21px; }
.sb-bottomnav-item.active { color: var(--sb-accent-2); }

.sb-bottomnav-fab {
  width: 52px; height: 52px; border-radius: 50%; background: var(--sb-text-dark); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-top: -30px; box-shadow: 0 10px 24px rgba(0,0,0,0.28);
  border: 4px solid var(--sb-bg);
}
.sb-bottomnav-fab i { width: 24px; height: 24px; }

/* ============ HORIZONTAL SCROLL (Kegiatan Terbaru) ============ */
.sb-hscroll {
  display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.sb-hscroll::-webkit-scrollbar { height: 0; }
.sb-hscroll-card {
  position: relative; flex: 0 0 240px; height: 140px; border-radius: var(--sb-radius-md);
  overflow: hidden; scroll-snap-align: start; box-shadow: var(--sb-shadow);
}
.sb-hscroll-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-hscroll-overlay {
  position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.65) 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; color: #fff;
}
.sb-hscroll-overlay .sb-hs-title { font-family:'Plus Jakarta Sans',sans-serif; font-weight: 700; font-size: 14px; }
.sb-hscroll-overlay .sb-hs-sub { font-size: 11.5px; opacity: .85; }

/* ============ TABS (tanggal absensi, dsb) ============ */
.sb-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; }
.sb-tabs::-webkit-scrollbar { height: 0; }
.sb-tab {
  flex: 0 0 auto; min-width: 56px; padding: 10px 6px; border-radius: 16px;
  background: var(--sb-white); border: 1px solid var(--sb-border);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 12px; font-weight: 600; color: var(--sb-text-sub);
}
.sb-tab .sb-tab-num { font-family:'Plus Jakarta Sans',sans-serif; font-weight: 800; font-size: 16px; color: var(--sb-text-dark); }
.sb-tab.active { background: var(--sb-text-dark); border-color: var(--sb-text-dark); }
.sb-tab.active, .sb-tab.active .sb-tab-num { color: #fff; }

/* ============ BADGES ============ */
.sb-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-hadir { background: #E1F3E8; color: #2F8F5B; }
.badge-tidak-hadir { background: #FBEAEA; color: #B23B3B; }
.badge-izin { background: var(--sb-blue); color: var(--sb-blue-text); }
.badge-sakit { background: var(--sb-lavender); color: var(--sb-lavender-text); }
.badge-belum { background: #F0EAE3; color: var(--sb-text-sub); }
.badge-draft { background: #F0EAE3; color: var(--sb-text-sub); }
.badge-berjalan { background: #FCEBDD; color: var(--sb-accent-2); }
.badge-selesai { background: #E1F3E8; color: #2F8F5B; }

/* ============ STATUS PILL BUTTONS (absensi input) ============ */
.sb-pill-group { display: flex; gap: 6px; flex-wrap: wrap; }
.sb-pill {
  padding: 8px 13px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--sb-border); background: var(--sb-white); color: var(--sb-text-sub);
  cursor: pointer; transition: all .12s ease;
}
.sb-pill:hover { border-color: var(--sb-accent-1); }
.sb-pill.selected-hadir { background: #E1F3E8; border-color: #2F8F5B; color: #2F8F5B; }
.sb-pill.selected-tidak_hadir { background: #FBEAEA; border-color: #B23B3B; color: #B23B3B; }
.sb-pill.selected-izin { background: var(--sb-blue); border-color: var(--sb-blue-text); color: var(--sb-blue-text); }
.sb-pill.selected-sakit { background: var(--sb-lavender); border-color: var(--sb-lavender-text); color: var(--sb-lavender-text); }

/* ============ FORMS ============ */
.sb-label { display: block; font-size: 13px; font-weight: 700; color: var(--sb-text-dark); margin-bottom: 6px; }
.sb-input, .sb-select, .sb-textarea {
  width: 100%; padding: 11px 14px; border-radius: 14px; border: 1.5px solid var(--sb-border);
  background: var(--sb-white); font-size: 14px; color: var(--sb-text-dark); font-family: inherit;
}
.sb-input:focus, .sb-select:focus, .sb-textarea:focus { outline: none; border-color: var(--sb-accent-2); }
.sb-field { margin-bottom: 16px; }
.sb-check-big {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid var(--sb-border); cursor: pointer; background: var(--sb-white);
}
.sb-check-big input[type=checkbox], .sb-check-big input[type=radio] { width: 20px; height: 20px; accent-color: var(--sb-accent-2); flex-shrink: 0; }
.sb-check-big.checked { border-color: var(--sb-accent-2); background: #FCEBDD; }

.sb-method-card {
  border-radius: var(--sb-radius-md); border: 2px solid var(--sb-border); background: var(--sb-white);
  padding: 18px; cursor: pointer; text-align: left; display:flex; flex-direction:column; gap:6px;
}
.sb-method-card.selected { border-color: var(--sb-accent-2); background: #FFF7F2; box-shadow: var(--sb-shadow-strong); }
.sb-method-card .sb-method-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--sb-bg); display:flex; align-items:center; justify-content:center; }

/* ============ TABLE ============ */
.sb-table-wrap { overflow-x: auto; border-radius: var(--sb-radius-md); border: 1px solid var(--sb-border); }
table.sb-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
table.sb-table th { text-align: left; padding: 13px 16px; background: var(--sb-bg); color: var(--sb-text-sub); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
table.sb-table td { padding: 13px 16px; border-top: 1px solid var(--sb-border); vertical-align: middle; }
table.sb-table tr:hover td { background: #FFFBF8; }

/* ============ MISC ============ */
.sb-empty { text-align: center; padding: 48px 20px; color: var(--sb-text-sub); }
.sb-empty i { width: 44px; height: 44px; margin-bottom: 12px; opacity: .5; }
.sb-section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; }
.sb-section-title h3 { font-size: 15.5px; margin: 0; }
.sb-section-title a { font-size: 12.5px; font-weight: 700; color: var(--sb-accent-2); display:flex; align-items:center; gap:2px; }

.sb-toast-region { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.sb-toast {
  padding: 12px 18px; border-radius: 14px; font-size: 13.5px; font-weight: 600; color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18); animation: sbToastIn .2s ease;
  display: flex; align-items: center; gap: 8px;
}
.sb-toast-success { background: #2F8F5B; }
.sb-toast-error { background: #B23B3B; }
@keyframes sbToastIn { from { opacity:0; transform: translateY(-8px);} to {opacity:1; transform:none;} }

.sb-modal-backdrop { position: fixed; inset:0; background: rgba(26,26,26,0.45); z-index: 60; display:flex; align-items:flex-end; justify-content:center; }
@media (min-width:768px){ .sb-modal-backdrop { align-items:center; } }
.sb-modal { background: var(--sb-white); border-radius: 24px 24px 0 0; width:100%; max-width: 560px; max-height: 88vh; overflow-y:auto; padding: 22px; }
@media (min-width:768px){ .sb-modal { border-radius: 24px; } }

.sb-login-shell { min-height: 100vh; display:flex; }
.sb-login-hero { display:none; flex:1; position:relative; }
@media (min-width:900px){ .sb-login-hero { display:block; } }
.sb-login-hero img { width:100%; height:100%; object-fit: cover; }
.sb-login-hero-overlay { position:absolute; inset:0; background: linear-gradient(180deg, rgba(26,26,26,0.1), rgba(26,26,26,0.55)); display:flex; align-items:flex-end; padding:40px; }
.sb-login-form-side { flex: 1; display:flex; align-items:center; justify-content:center; padding: 32px 20px; background: var(--sb-bg); }
.sb-login-box { width:100%; max-width: 380px; }

.sb-scope-locked { background: var(--sb-bg); border: 1.5px dashed var(--sb-border); border-radius: 14px; padding: 10px 14px; font-size: 12.5px; color: var(--sb-text-sub); display:flex; gap:8px; align-items:flex-start; }


/* ============ TOPBAR PROFIL BUTTON ============ */
.sb-topbar-profil-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sb-bg);
  border: 1.5px solid var(--sb-border);
  color: var(--sb-text-sub);
  text-decoration: none;
  transition: background .18s, color .18s;
  flex-shrink: 0;
}
.sb-topbar-profil-btn:hover { background: var(--sb-accent-2); color: #fff; border-color: var(--sb-accent-2); }
@media (min-width: 1024px) { .sb-topbar-profil-btn { display: none; } }

/* Make topbar avatar clickable */
a.sb-topbar-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: opacity .18s;
}
a.sb-topbar-avatar:hover { opacity: .8; }
