/* =====================================================================
   Tema visual terinspirasi dari referensi "Admins" dashboard (lavender/
   purple, kartu putih membulat, badge status pill). Dipakai bersama
   Tailwind (CDN) - file ini isinya hal-hal yang tidak praktis dilakukan
   lewat utility class saja: gradient background, sticky table, dsb.
   ===================================================================== */

:root{
  --brand: #6D5DFB;
  --brand-dark: #5A4BE0;
  --brand-soft: #EFECFF;
  --page-bg-from: #EDE9FE;
  --page-bg-to: #F7F5FF;
}

body{
  background: radial-gradient(1200px 600px at 10% -10%, #E9E4FF 0%, transparent 60%),
              radial-gradient(1000px 500px at 110% 10%, #FDE7F3 0%, transparent 55%),
              linear-gradient(180deg, var(--page-bg-from), var(--page-bg-to));
  min-height: 100vh;
}

.app-shell{
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px;
}

.app-frame{
  background: #fff;
  border-radius: 28px;
  border: 1px solid #ECE9FB;
  box-shadow: 0 20px 60px -20px rgba(109, 93, 251, .25);
  overflow: hidden;
}

/* ---------- topbar ---------- */
.topnav a.nav-link{
  color: #6B7280;
  font-weight: 500;
  font-size: 14px;
  padding: 6px 2px;
}
.topnav a.nav-link.active{
  color: #111827;
  font-weight: 700;
  border-bottom: 2px solid #111827;
}

/* ---------- pill toggle (Table / Chat / Calendar) ---------- */
.pill-toggle{
  background:#F3F2FA;
  border-radius: 999px;
  padding: 4px;
  display:inline-flex;
  gap: 2px;
}
.pill-toggle a{
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color:#6B7280;
}
.pill-toggle a.active{
  background:#fff;
  color: var(--brand-dark);
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

/* ---------- status pill badges ---------- */
.status-pill{
  display:inline-flex; align-items:center; gap:6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.status-pill .dot{ width:6px; height:6px; border-radius:999px; }
.status-pill.amber{ background:#FFF3DF; color:#A5690A; } .status-pill.amber .dot{ background:#F2A93B; }
.status-pill.green{ background:#E4F8EC; color:#1A9A5D; } .status-pill.green .dot{ background:#22C55E; }
.status-pill.blue{  background:#E8F1FF; color:#2159C9; } .status-pill.blue .dot{  background:#5B93F0; }
.status-pill.gray{  background:#F1F1F5; color:#6B7280; } .status-pill.gray .dot{  background:#9CA3AF; }
.status-pill.red{   background:#FDE9EA; color:#C22F3A; } .status-pill.red .dot{   background:#E5525F; }

/* ---------- avatar ---------- */
.avatar-initials{
  width: 34px; height: 34px; border-radius: 999px;
  display:flex; align-items:center; justify-content:center;
  font-size: 12px; font-weight:700; color:#fff; flex-shrink:0;
  box-shadow: 0 0 0 2px #fff;
}

/* ---------- data table: freeze header & freeze column ---------- */
.dt-wrapper{
  overflow: auto;
  border-radius: 16px;
  border: 1px solid #EEF0F4;
}
.dt-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  min-width: 920px;
}
.dt-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;
  background: #FAFAFD;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #8B8FA3;
  font-weight: 700;
  padding: 13px 16px;
  border-bottom: 1px solid #EEF0F4;
  white-space: nowrap;
}
.dt-table tbody td{
  padding: 12px 16px;
  border-bottom: 1px solid #F3F4F8;
  vertical-align: middle;
  background: #fff;
}
.dt-table tbody tr:hover td{ background: #FAFAFF; }
.dt-table tbody tr:last-child td{ border-bottom: none; }

.dt-freeze{
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 1px 0 0 0 #EEF0F4;
}
.dt-table thead th.dt-freeze{ z-index: 3; background:#FAFAFD; }
.dt-table tbody tr:hover td.dt-freeze{ background:#FAFAFF; }

.dt-sort-link{ display:inline-flex; align-items:center; gap:4px; color:#8B8FA3; }
.dt-sort-link:hover{ color:#111827; text-decoration:none; }
.dt-sort-ic{ font-size: 10px; color: var(--brand); }

/* ---------- misc ---------- */
.card-soft{
  background:#fff; border:1px solid #EEF0F4; border-radius: 18px;
}
.btn-primary{
  background: var(--brand); color:#fff; font-weight:600; font-size:13.5px;
  padding: 10px 18px; border-radius: 12px; display:inline-flex; align-items:center; gap:8px;
}
.btn-primary:hover{ background: var(--brand-dark); color:#fff; text-decoration:none; }
.btn-outline{
  background:#fff; color:#374151; font-weight:600; font-size:13.5px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid #E5E7EB;
  display:inline-flex; align-items:center; gap:8px;
}
.btn-outline:hover{ background:#F9FAFB; text-decoration:none; }

.input-field{
  background:#F7F7FB; border:1px solid #EEF0F4; border-radius: 12px;
  padding: 9px 14px; font-size: 13.5px; width:100%;
}
.input-field:focus{ outline:none; border-color: var(--brand); background:#fff; box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- tambahan step 2 ---------- */
[x-cloak]{ display:none !important; }
.menu-panel{
  position:absolute; left:0; top:100%; margin-top:8px; min-width:230px;
  background:#fff; border:1px solid #EEF0F4; border-radius:14px;
  box-shadow:0 12px 32px -12px rgba(30,20,80,.25); padding:6px; z-index:60;
}
.menu-panel a{ display:block; padding:8px 12px; border-radius:9px; font-size:13.5px; color:#374151; }
.menu-panel a:hover{ background:#F5F3FF; color:#4C3FD0; text-decoration:none; }
.menu-panel .menu-title{ padding:8px 12px 4px; font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#9CA3AF; }
.kpi-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; }
.kpi-card{ background:#fff; border:1px solid #EEF0F4; border-radius:16px; padding:16px 18px; }
.kpi-card .lbl{ font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:#8B8FA3; }
.kpi-card .val{ font-size:22px; font-weight:800; margin-top:6px; letter-spacing:-.01em; }
.kpi-card .sub{ font-size:12px; color:#9CA3AF; margin-top:2px; }
.num{ text-align:right; font-variant-numeric:tabular-nums; }
.btn-sm{ padding:7px 14px !important; font-size:12.5px !important; border-radius:10px !important; }
.btn-danger{ background:#fff; color:#C22F3A; border:1px solid #F5C6CB; font-weight:600; font-size:12.5px; padding:7px 14px; border-radius:10px; }
.btn-danger:hover{ background:#FDE9EA; }
.stepper{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.stepper .st{ padding:6px 14px; border-radius:999px; font-size:12px; font-weight:700; background:#F1F1F5; color:#9CA3AF; }
.stepper .st.done{ background:#E4F8EC; color:#1A9A5D; }
.stepper .st.now{ background:#6D5DFB; color:#fff; }
.note-box{ background:#FFF8E6; border:1px solid #F4DFA0; color:#7A5B00; border-radius:12px; padding:10px 14px; font-size:12.5px; }
.print-only{ display:none; }
@media print{
  body{ background:#fff !important; }
  .no-print{ display:none !important; }
  .app-shell{ padding:0; max-width:none; }
  .app-frame{ border:none; box-shadow:none; border-radius:0; }
}

/* =====================================================================
   LAYOUT BARU: sidebar (tetap / ringkas / melayang) + konten lebar penuh
   ===================================================================== */
.shell{ display:flex; min-height:100vh; }
.main-wrap{ flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar{
  position:sticky; top:0; z-index:30; display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 32px; background:rgba(255,255,255,.82); backdrop-filter:blur(10px); border-bottom:1px solid #EEECFA;
}
.content{ flex:1; padding:28px 36px 64px; width:100%; max-width:1920px; margin:0 auto; }
@media (max-width: 1023px){ .content{ padding:20px 16px 48px; } .topbar{ padding:10px 16px; } }

.icon-btn{
  width:38px; height:38px; border-radius:11px; display:inline-flex; align-items:center; justify-content:center;
  background:#fff; border:1px solid #ECEAF8; color:#4B5563; cursor:pointer;
}
.icon-btn:hover{ background:#F6F5FD; color:#4C3FD0; }

/* --- sidebar --- */
.sb{ background:#fff; display:flex; flex-direction:column; }
.sb-pinned{ position:sticky; top:0; height:100vh; width:276px; flex-shrink:0; border-right:1px solid #ECEAF8; }
.sb-rail{ position:sticky; top:0; height:100vh; width:76px; flex-shrink:0; border-right:1px solid #ECEAF8; z-index:40; }
.sb-floating{
  position:fixed; top:12px; bottom:12px; left:12px; width:300px; z-index:60; border-radius:22px; border:1px solid #ECEAF8;
  box-shadow:0 28px 70px -14px rgba(40,30,110,.38); transform:translateX(-125%); transition:transform .22s ease; overflow:hidden;
}
.sb-floating.open{ transform:translateX(0); }
.sb-backdrop{ position:fixed; inset:0; background:rgba(20,16,50,.28); z-index:55; }

.sb-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:18px 18px 10px; }
.sb-logo{ display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:-.01em; color:#111827; }
.sb-logo .mark{ width:34px; height:34px; border-radius:11px; background:#6D5DFB; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; }
.sb-modes{ display:inline-flex; background:#F3F2FA; border-radius:10px; padding:3px; gap:2px; }
.sb-modes button{ width:28px; height:26px; border-radius:8px; display:flex; align-items:center; justify-content:center; color:#8B8FA3; }
.sb-modes button:hover{ color:#4C3FD0; }
.sb-modes button.on{ background:#fff; color:#4C3FD0; box-shadow:0 1px 3px rgba(0,0,0,.08); }

.sb-search{ margin:6px 16px 8px; display:flex; align-items:center; gap:8px; padding:8px 12px; border:1px solid #E6E4F4; border-radius:11px; color:#9CA3AF; }
.sb-search input{ border:0; outline:0; background:transparent; width:100%; font-size:13px; color:#111827; }

.sb-scroll{ flex:1; overflow-y:auto; padding:6px 12px 12px; }
.sb-item{ display:flex; align-items:center; gap:11px; padding:9px 11px; border-radius:11px; font-size:13.5px; color:#4B5563; width:100%; text-align:left; }
.sb-item:hover{ background:#F6F5FD; color:#111827; text-decoration:none; }
.sb-item.active{ background:#F1EFFF; color:#4C3FD0; font-weight:600; }
.sb-group-head{ display:flex; align-items:center; justify-content:space-between; width:100%; padding:9px 11px; border-radius:11px; font-size:13.5px; color:#374151; font-weight:500; }
.sb-group-head:hover{ background:#F6F5FD; }
.sb-group-head .lbl{ display:flex; align-items:center; gap:11px; }
.sb-group-head .tg{ color:#9CA3AF; }
.sb-group-head.has-active{ color:#4C3FD0; }
.sb-sub{ margin:2px 0 6px 21px; padding-left:12px; border-left:1.5px solid #E7E5F5; }
.sb-sub .sb-item{ padding:7px 11px; font-size:13px; }

.sb-foot{ border-top:1px solid #F0EEF9; padding:12px 14px; display:flex; align-items:center; gap:10px; }
.sb-foot .who{ min-width:0; flex:1; }
.sb-foot .who b{ display:block; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sb-foot .who span{ display:block; font-size:11.5px; color:#9CA3AF; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* mode ringkas (rail) */
.sb-rail .sb-head{ flex-direction:column; padding:16px 0 8px; }
.sb-rail .sb-scroll{ overflow:visible; padding:6px 0; }
.rail-btn{
  position:relative; width:46px; height:46px; margin:4px auto; border-radius:13px; display:flex; align-items:center; justify-content:center;
  color:#4B5563; cursor:pointer;
}
.rail-btn:hover{ background:#F6F5FD; color:#4C3FD0; }
.rail-btn.active{ background:#EFEDFB; color:#4C3FD0; }
.flyout{ position:absolute; left:100%; top:-4px; padding-left:12px; z-index:80; }
.flyout .box{ min-width:236px; background:#fff; border:1px solid #ECEAF8; border-radius:14px; box-shadow:0 18px 44px -12px rgba(40,30,110,.3); padding:6px; }
.flyout .ttl{ padding:7px 11px 4px; font-size:10.5px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:#9CA3AF; }
.sb-rail .sb-foot{ justify-content:center; padding:12px 0; position:relative; }

/* --- roster grid --- */
.roster-wrap{ overflow:auto; border:1px solid #EEF0F4; border-radius:16px; max-height:max(460px, calc(100vh - 360px)); background:#fff; }
.roster-table{ border-collapse:separate; border-spacing:0; font-size:12.5px; min-width:100%; }
.roster-table th, .roster-table td{ border-bottom:1px solid #F3F4F8; border-right:1px solid #F6F6FA; background:#fff; }
.roster-table thead th{ position:sticky; top:0; z-index:3; background:#FAFAFD; padding:7px 4px; text-align:center; font-size:11px; color:#8B8FA3; min-width:50px; }
.roster-table thead th.wk{ background:#F7F3F3; color:#C22F3A; }
.roster-table thead th.hol{ background:#FDE9EA; color:#C22F3A; }
.roster-table thead th.emp, .roster-table td.emp{ position:sticky; left:0; z-index:4; min-width:250px; text-align:left; padding:8px 12px; box-shadow:1px 0 0 #EEF0F4; }
.roster-table thead th.emp{ z-index:6; }
.roster-table td.rc{ padding:4px; text-align:center; cursor:pointer; min-width:50px; height:42px; }
.roster-table td.rc:hover{ background:#F6F5FD; }
.roster-table td.rc.wk{ background:#FCFAFA; }
.roster-table td.rc.hol{ background:#FFF3F4; }
.chip{ display:inline-block; min-width:40px; padding:4px 6px; border-radius:8px; font-size:11px; font-weight:700; color:#fff; line-height:1.1; }
.chip.off{ background:#EEF0F4; color:#8B8FA3; }
.chip.empty{ background:transparent; color:#D1D5DB; font-weight:500; }
.cell-menu{ position:fixed; z-index:90; min-width:210px; background:#fff; border:1px solid #ECEAF8; border-radius:14px; box-shadow:0 18px 44px -12px rgba(40,30,110,.35); padding:6px; }
.cell-menu button{ display:flex; align-items:center; gap:10px; width:100%; padding:8px 10px; border-radius:9px; font-size:13px; text-align:left; }
.cell-menu button:hover{ background:#F6F5FD; }
.cell-menu .sw{ width:12px; height:12px; border-radius:4px; flex-shrink:0; }
.legend-chip{ display:inline-flex; align-items:center; gap:7px; padding:5px 11px; border-radius:999px; background:#F7F7FB; font-size:12px; font-weight:600; color:#374151; }
.legend-chip i{ width:10px; height:10px; border-radius:4px; display:inline-block; }

/* ---------- kalender ---------- */
.cal-grid{ display:grid; grid-template-columns:repeat(7, minmax(0,1fr)); border:1px solid #EEF0F4; border-radius:16px; overflow:hidden; background:#fff; }
.cal-head{ padding:10px; text-align:center; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:#8B8FA3; background:#FAFAFD; border-bottom:1px solid #EEF0F4; }
.cal-head.wk{ color:#C22F3A; }
.cal-cell{ min-height:118px; padding:6px 7px; border-right:1px solid #F3F4F8; border-bottom:1px solid #F3F4F8; background:#fff; overflow:hidden; }
.cal-cell:nth-child(7n){ border-right:0; }
.cal-cell.out{ background:#FAFAFC; opacity:.55; }
.cal-cell.wk{ background:#FCFAFA; }
.cal-cell.today{ box-shadow:inset 0 0 0 2px #6D5DFB; }
.cal-day{ font-size:12px; font-weight:700; color:#374151; margin-bottom:4px; }
.cal-cell.today .cal-day{ color:#4C3FD0; }
.cal-item{ font-size:11px; font-weight:600; padding:2px 6px; border-radius:6px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cal-more{ font-size:11px; color:#8B8FA3; padding-left:4px; }
@media (max-width: 760px){ .cal-cell{ min-height:84px; } .cal-item{ font-size:10px; } }

/* ---------- kalender: tampilan tahun & grid per jam (minggu/hari) ---------- */
.yr-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:2px; text-align:center; }
.yr-h{ font-size:10px; font-weight:700; color:#9CA3AF; padding-bottom:2px; }
.yr-d{ position:relative; display:flex; align-items:center; justify-content:center; height:28px; font-size:12px; border-radius:8px; color:#374151; }
a.yr-d:hover{ background:#F1EFFF; text-decoration:none; }
.yr-d.wk{ color:#C22F3A; } .yr-d.hol{ background:#FDE9EA; color:#C22F3A; font-weight:700; }
.yr-d.today{ background:#6D5DFB; color:#fff; font-weight:700; }
.yr-dot{ position:absolute; bottom:2px; left:50%; transform:translateX(-50%); width:4px; height:4px; border-radius:50%; background:#6D5DFB; }
.yr-d.today .yr-dot{ background:#fff; }

.tg-scroll{ max-height:68vh; overflow:auto; border:1px solid #EEF0F4; border-radius:16px; background:#fff; }
.tg{ min-width:640px; }
.tg-top, .tg-allday, .tg-grid{ display:grid; grid-template-columns:56px repeat(var(--cols), minmax(0,1fr)); }
.tg-top{ position:sticky; top:0; z-index:6; background:#FAFAFD; border-bottom:1px solid #EEF0F4; }
.tg-allday{ position:sticky; top:58px; z-index:5; background:#fff; border-bottom:1px solid #EEF0F4; }
.tg-corner{ border-right:1px solid #F0F0F6; }
.tg-corner.small{ font-size:10px; color:#9CA3AF; display:flex; align-items:center; justify-content:center; text-align:center; }
.tg-dayhead{ display:flex; flex-direction:column; align-items:center; justify-content:center; padding:8px 4px; border-right:1px solid #F0F0F6; color:#4B5563; height:58px; }
.tg-dayhead .dow{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:#8B8FA3; }
.tg-dayhead .num{ font-size:18px; font-weight:800; line-height:1.1; margin-top:2px; }
.tg-dayhead.wk .dow, .tg-dayhead.wk .num{ color:#C22F3A; }
.tg-dayhead.today .num{ background:#6D5DFB; color:#fff; border-radius:999px; min-width:30px; height:30px; display:flex; align-items:center; justify-content:center; }
.tg-allcell{ padding:4px; border-right:1px solid #F0F0F6; min-height:34px; }
.tg-allcell.wk{ background:#FCFAFA; }
.tg-grid{ position:relative; }
.tg-hours{ position:relative; border-right:1px solid #F0F0F6; }
.tg-hour{ position:absolute; right:6px; transform:translateY(-7px); font-size:10px; color:#9CA3AF; background:#fff; padding:0 2px; }
.tg-col{ position:relative; border-right:1px solid #F0F0F6;
         background-image:repeating-linear-gradient(to bottom, #EFEFF6 0, #EFEFF6 1px, transparent 1px, transparent 56px); }
.tg-col.wk{ background-color:#FCFAFA; }
.tg-block{ position:absolute; box-sizing:border-box; padding:2px 6px; border-radius:7px; font-size:11px; font-weight:600; overflow:hidden; line-height:1.25; }
.tg-block .sub{ font-weight:400; opacity:.85; font-size:10px; }
.tg-now{ position:absolute; left:0; right:0; height:0; border-top:2px solid #E5525F; z-index:3; }
.tg-now::before{ content:''; position:absolute; left:-4px; top:-5px; width:8px; height:8px; border-radius:50%; background:#E5525F; }

.mbar-simple{ height:8px; border-radius:6px; background:#EEF0F4; overflow:hidden; }
.mbar-simple i{ display:block; height:100%; background:#6D5DFB; border-radius:6px; }
