/* Ayatara Integrated — gaya dasar, tanpa dependensi eksternal (jalan offline).
   Palet navy-biru: sidebar gelap dengan icon putih, konten terang, kartu KPI berwarna. */
:root {
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --border: #e3e7f0;
  --text: #1c2340;
  --muted: #6b7393;
  --brand: #2563eb;
  --brand-ink: #ffffff;
  --brand-soft: #e7efff;
  --accent: #c9a24a;
  --danger: #dc3545;
  --danger-soft: #fdecee;
  --warn: #c27c0e;
  --warn-soft: #fff4e0;
  --ok: #16a34a;
  --ok-soft: #e6f6ec;
  --info: #2563eb;
  --info-soft: #e7efff;
  --nav-bg: linear-gradient(180deg, #0b1437 0%, #101c4f 55%, #172766 100%);
  --nav-text: #c9d2f0;
  --nav-hover: rgba(255, 255, 255, .07);
  --nav-active: linear-gradient(90deg, #2563eb, #3b82f6);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 64, .04), 0 4px 16px rgba(16, 24, 64, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--brand); }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 700; letter-spacing: .01em; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 17px; height: 17px; }

/* ---------- Shell & sidebar ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 258px; flex: none; background: var(--nav-bg); color: var(--nav-text);
  padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.brand { display: flex; gap: 12px; align-items: center; color: #fff; text-decoration: none; padding: 2px 8px 18px; }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg, #3b82f6, #2563eb); display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .45); }
.brand-text strong { display: block; font-size: 17px; letter-spacing: .06em; line-height: 1.1; }
.brand-text small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: #60a5fa; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-main {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: #fff; text-decoration: none; font-weight: 600; font-size: 14.5px; cursor: pointer;
  list-style: none; user-select: none; transition: background .15s;
}
.nav-main::-webkit-details-marker { display: none; }
.nav-main .icon { color: #fff; }
.nav-main span { flex: 1; }
.nav-main:hover { background: var(--nav-hover); }
.nav-main.active { background: var(--nav-active); box-shadow: 0 8px 20px rgba(37, 99, 235, .4); }
.nav-group .chevron { width: 16px; height: 16px; opacity: .7; transition: transform .2s; }
.nav-group[open] > .nav-main .chevron { transform: rotate(180deg); }
.nav-group.has-active > .nav-main { background: rgba(255, 255, 255, .06); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px 22px; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .12); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--nav-text); text-decoration: none; font-size: 13.5px; transition: background .15s, color .15s; }
.nav-link .icon { color: #fff; opacity: .85; }
.nav-link:hover { background: var(--nav-hover); color: #fff; }
.nav-link.active { background: var(--nav-active); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(37, 99, 235, .35); }
.nav-link.active .icon { opacity: 1; }

.sidebar-card { margin-top: 16px; padding: 16px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); text-align: center; color: #fff; }
.sidebar-card-icon { width: 26px; height: 26px; color: #fff; }
.sidebar-card p { margin: 6px 0 2px; font-weight: 700; }
.sidebar-card small { color: var(--nav-text); font-size: 12px; }
.sidebar-backdrop { display: none; }

/* ---------- Topbar ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 16px 28px; background: rgba(243, 245, 251, .88); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.page-heading { flex: 1; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; min-width: 0; }
.page-title { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: .01em; color: #0f1a45; }
.page-date { color: var(--muted); font-size: 13px; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #3b82f6, #6d28d9); color: #fff; font-weight: 700; font-size: 13px; }
.user-name { color: var(--text); font-weight: 600; margin-right: 6px; }
.menu-toggle { display: inline-grid; }
@media (min-width: 901px) { body.nav-collapsed .sidebar { display: none; } }
.content { padding: 8px 28px 40px; }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 40px 16px; }
.error-code { font-size: 48px; font-weight: 800; color: var(--brand); }

/* KPI berwarna (seperti kartu ringkasan di referensi) */
.kpi-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 18px; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius); color: #fff; box-shadow: 0 10px 24px -10px rgba(16, 24, 64, .45); min-width: 0; }
.kpi-icon { width: 54px; height: 54px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .35); }
.kpi-icon .icon { width: 26px; height: 26px; color: #fff; }
.kpi-body { min-width: 0; }
.kpi-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .92; }
.kpi-value { font-size: clamp(18px, 1.7vw, 26px); font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-sub { font-size: 12px; opacity: .9; min-height: 1em; }
.kpi-blue { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.kpi-green { background: linear-gradient(135deg, #15803d, #22c55e); }
.kpi-purple { background: linear-gradient(135deg, #5b21b6, #8b5cf6); }
.kpi-orange { background: linear-gradient(135deg, #ea580c, #f59e0b); }
.kpi-teal { background: linear-gradient(135deg, #0e7490, #06b6d4); }
.kpi-red { background: linear-gradient(135deg, #b91c1c, #f43f5e); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--brand); border-color: var(--border); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-warn { background: var(--warn); border-color: var(--warn); }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px; cursor: pointer; text-decoration: none; }
.icon-btn:hover { color: var(--brand); border-color: #c7d4f5; }
.icon-btn .icon { width: 18px; height: 18px; }

.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--ok-soft); color: #11703a; border-color: #bfe6cd; }
.alert-error { background: var(--danger-soft); color: #a71d2a; border-color: #f5c2c8; }
.alert-info { background: var(--info-soft); color: #1d4ed8; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.field { margin-bottom: 12px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=month], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
textarea { min-height: 70px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 3px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: #101c4f; font-weight: 700; }
.table thead th:first-child { border-top-left-radius: 10px; }
.table thead th:last-child { border-top-right-radius: 10px; }
.table tbody tr:nth-child(even) td { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.inactive td { color: var(--muted); }
.table tfoot td { font-weight: 700; background: var(--brand-soft); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge-reserved { background: var(--info-soft); color: var(--info); border-color: #c9d9fb; }
.badge-in_service { background: var(--warn-soft); color: var(--warn); border-color: #f5ddb0; }
.badge-completed { background: var(--ok-soft); color: var(--ok); border-color: #bfe6cd; }
.badge-cancelled, .badge-no_show { background: var(--danger-soft); color: var(--danger); border-color: #f5c2c8; }

/* ---------- Spa board ---------- */
.board-wrap { overflow-x: auto; }
table.board { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 640px; table-layout: fixed; }
.board th, .board td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 0; height: 26px; }
.board thead th { background: #101c4f; color: #fff; padding: 10px 8px; font-size: 13px; position: sticky; top: 0; }
.board thead th .muted { color: #a9b6e0; }
.board .time { width: 64px; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; background: var(--surface-2); }
.board thead .time { color: #fff; background: #101c4f; }
.board tr.hour .time { color: var(--text); font-weight: 600; }
.board tr.hour td { border-top: 1px solid #cfd6e6; }
.slot-free a { display: block; height: 100%; min-height: 25px; color: transparent; text-decoration: none; font-size: 12px; padding: 3px 8px; }
.slot-free a:hover { background: var(--brand-soft); color: var(--brand); }
.slot-buffer { background: repeating-linear-gradient(45deg, #eef1f8, #eef1f8 6px, #e2e7f2 6px, #e2e7f2 12px); }
.slot-booking { vertical-align: top; padding: 3px !important; }
.bk { display: block; height: 100%; border-radius: 9px; padding: 6px 8px; text-decoration: none; color: var(--text); border-left: 4px solid var(--info); background: var(--info-soft); overflow: hidden; }
.bk:hover { filter: brightness(.97); }
.bk-in_service { border-color: var(--warn); background: var(--warn-soft); }
.bk-completed { border-color: var(--ok); background: var(--ok-soft); }
.bk-head { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }
.bk-guest { display: block; font-weight: 600; font-size: 13px; margin-top: 2px; }
.bk-line { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }

/* Booking form beds */
.bed-card { border: 1px dashed #c9d3ea; border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
.bed-card h3 { display: flex; justify-content: space-between; }
.price-preview { font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.total-bar { display: flex; gap: 24px; justify-content: flex-end; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.total-bar strong { font-size: 16px; }

dl.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

/* Tag list (GSI insights) & dialog */
.tag-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.tag-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.tag-list li:hover { background: var(--surface-2); }
dialog.dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; width: min(640px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.dialog::backdrop { background: rgba(11, 20, 55, .55); }
details summary { cursor: pointer; }

/* ---------- Guest (login) ---------- */
body.guest { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(circle at 20% 10%, #1d3a8a, transparent 45%), linear-gradient(160deg, #0b1437, #172766); }
.guest-wrap { width: 100%; max-width: 390px; padding: 16px; }
.login-card { background: var(--surface); border-radius: 18px; padding: 30px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card .brand-mark { margin: 0 auto 12px; width: 52px; height: 52px; font-size: 22px; }
.login-card h1 { text-align: center; font-size: 20px; margin: 0; }
.login-card p.sub { text-align: center; color: var(--muted); margin: 4px 0 20px; }
.login-card .btn { width: 100%; justify-content: center; padding: 11px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { position: fixed; left: -270px; z-index: 30; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(11, 20, 55, .45); }
  .menu-toggle { display: inline-grid; }
  .content { padding: 8px 16px 32px; }
  .topbar { padding: 12px 16px; }
  .user-name, .page-date { display: none; }
  .page-title { font-size: 18px; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .topbar, .no-print, .sidebar-backdrop { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; }
  .kpi { color: #000; background: none !important; border: 1px solid #ccc; box-shadow: none; }
}

/* ---------- Home: launcher kartu per sistem (gaya VHP) ---------- */
.launcher { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; margin: 4px 0 28px; }
.app-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 24px 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 2px 4px rgba(16, 24, 64, .05), 0 8px 20px rgba(16, 24, 64, .07);
  color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s;
}
a.app-card:hover { transform: translateY(-3px); border-color: #c7d4f5; box-shadow: 0 14px 30px -8px rgba(37, 99, 235, .3); }
a.app-card:focus-visible { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.app-tile { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; box-shadow: 0 10px 22px -8px rgba(16, 24, 64, .45); }
.app-tile .icon { width: 42px; height: 42px; color: #fff; stroke-width: 1.6; }
.app-name { font-weight: 700; font-size: 15px; margin-top: 6px; }
.app-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.app-card-soon { cursor: default; }
.app-card-soon .app-tile { filter: grayscale(.85); opacity: .55; box-shadow: none; }
.app-card-soon .app-name, .app-card-soon .app-desc { opacity: .6; }
.app-soon { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
@media (max-width: 600px) {
  .launcher { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .app-card { padding: 18px 10px 14px; }
  .app-tile { width: 64px; height: 64px; border-radius: 18px; }
  .app-tile .icon { width: 32px; height: 32px; }
  .app-desc { display: none; }
}

/* ---------- Dashboard analitik ---------- */
.dash-filter .toolbar { align-items: end; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; }
.seg-btn { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--nav-active); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .3); }
.dash-section { margin-top: 26px; }
.dash-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dash-head > div { flex: 1; }
.dash-head h2 { margin: 0; font-size: 18px; }
.dash-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.dash-icon .icon { color: #fff; width: 22px; height: 22px; }
.grid-dash { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.chart-box { position: relative; }
.card h3 { font-size: 14px; margin: 0 0 12px; }
.tag-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tag-mini { list-style: none; margin: 0; padding: 0; }
.tag-mini li { display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px; border-radius: 8px; margin-bottom: 4px; font-size: 12.5px; }
.tag-mini.good li { background: var(--ok-soft); }
.tag-mini.bad li { background: var(--danger-soft); }
.tag-mini b { font-variant-numeric: tabular-nums; }
.home-greeting { margin: 0 0 18px; }
.home-greeting h2 { font-size: 20px; margin: 0; }
@media (max-width: 1100px) {
  .grid-dash { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
}
@media print {
  .dash-section { break-inside: avoid; }
}

/* ---------- Icon duotone & sentuhan mewah ---------- */
.icon .i-fill { opacity: .22; }
.nav-main .icon .i-fill, .nav-link .icon .i-fill { opacity: .28; }
.nav-main.active .icon .i-fill, .nav-link.active .icon .i-fill { opacity: .45; }
.kpi-icon .icon .i-fill, .app-tile .icon .i-fill, .dash-icon .icon .i-fill { opacity: .38; }

/* Brand emas khas Ayatara */
.brand-mark { background: linear-gradient(140deg, #f6dfa0 0%, #d4a94e 45%, #a87b2a 100%); color: #3a2a08; box-shadow: 0 6px 18px rgba(212, 169, 78, .45), inset 0 1px 0 rgba(255,255,255,.6); }
.brand-text small { color: #e6c47a; }
.sidebar-card { border-color: rgba(230, 196, 122, .25); background: linear-gradient(160deg, rgba(230,196,122,.12), rgba(255,255,255,.03)); }

/* Tile kaca mengilap: highlight atas + garis tepi terang + bayangan berwarna */
.app-tile, .kpi-icon, .dash-icon { position: relative; overflow: hidden; }
.app-tile::before, .dash-icon::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,.08) 42%, rgba(255,255,255,0) 60%);
}
.app-tile::after, .dash-icon::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -10px 18px rgba(0,0,0,.12);
}
.app-tile .icon, .dash-icon .icon { position: relative; z-index: 1; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.app-tile { width: 88px; height: 88px; border-radius: 26px; }
.app-tile .icon { width: 46px; height: 46px; }
a.app-card:hover .app-tile { transform: scale(1.05) rotate(-2deg); }
.app-tile { transition: transform .2s; }
.kpi-icon { background: linear-gradient(160deg, rgba(255,255,255,.32), rgba(255,255,255,.08)); box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.kpi-icon .icon { filter: drop-shadow(0 2px 3px rgba(0,0,0,.2)); }
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.18), rgba(255,255,255,0) 70%); pointer-events: none; }

/* Level akses (role & user) */
.level { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.level-none { background: #f1f3f8; color: #9aa1b9; }
.level-view { background: #e7efff; color: #1d4ed8; border-color: #c9d9fb; }
.level-edit { background: #e6f6ec; color: #15803d; border-color: #bfe6cd; }
.level-admin { background: #f3e8ff; color: #7e22ce; border-color: #e1c8fb; }
.level-custom { background: #fff4e0; color: #b45309; border-color: #f5ddb0; }
.perm-list { display: grid; gap: 6px; }
.perm-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-weight: 500; cursor: pointer; margin: 0; }
.perm-item:hover { background: var(--surface-2); }
.perm-item input { width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.perm-text { flex: 1; }
.perm-text code { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.role-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 400; margin: 0; transition: border-color .15s, background .15s; }
.role-card:hover { border-color: #c7d4f5; }
.role-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.role-card.locked { opacity: .7; cursor: not-allowed; }
.role-card input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.role-body { display: flex; flex-direction: column; gap: 4px; }
.role-levels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.profile-head { display: flex; align-items: center; gap: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.user-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 3px 10px 3px 3px; border-radius: 999px; }
.user-chip:hover { background: var(--surface); }
.access-module { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.access-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.access-head strong { flex: 1; }
.access-head .dash-icon { width: 32px; height: 32px; border-radius: 9px; }
.access-head .dash-icon .icon { width: 18px; height: 18px; }
.access-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.access-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 8px; }
.access-list li span:nth-child(2) { flex: 1; }
.access-list li.yes .icon { color: var(--ok); }
.access-list li.no { color: var(--muted); }
.access-list li.no .icon { color: #c3c8d8; }

/* ---------- MOD Report (form & laporan) ---------- */
.mod-bar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0 12px; align-items: center; }
.mod-dept { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.mod-dept:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.mod-staff { display: flex; gap: 6px; margin-bottom: 6px; }
.mod-row { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: var(--surface-2); }
.mod-del { margin-top: 6px; }
.mod-photos { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.mod-attach { cursor: pointer; }
.mod-thumb { position: relative; display: inline-block; }
.mod-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.mod-thumb button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: var(--danger); color: #fff; cursor: pointer; line-height: 1; }
.rpt-table textarea { min-height: 44px; }
.rpt-cat td { background: var(--brand-soft); font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: .04em; color: #1d3a8a; }
.rpt-head { text-align: center; border-bottom: 2px solid var(--accent); padding-bottom: 10px; margin-bottom: 14px; }
.rpt-head h2 { font-size: 18px; text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.rpt-h { border-bottom: 2px solid var(--border); padding-bottom: 6px; margin: 22px 0 10px; text-transform: uppercase; letter-spacing: .04em; }
.rpt-kv { margin-bottom: 12px; }
.rpt-block { border-bottom: 1px solid var(--border); padding: 8px 0 12px; margin-bottom: 8px; }
.rpt-block p { margin: 4px 0; }
.rpt-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rpt-photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.rpt-yes { color: var(--ok); font-weight: 700; }
.rpt-no { color: var(--danger); font-weight: 700; }
.rpt-sign { margin: 32px 0 0 auto; width: 240px; text-align: center; display: grid; gap: 40px; }
.rpt-sign strong { border-top: 1px solid var(--text); padding-top: 4px; }
@media print {
  .rpt { padding: 0; }
  .rpt-block, .rpt-table tr { break-inside: avoid; }
  .rpt-cat td { background: #eee !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table th { background: #ddd !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Logo Ayatara ---------- */
.brand { flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 8px 20px; }
.brand-logo { display: block; width: 100%; max-width: 188px; height: auto; }
.brand-sub { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .32em; color: #e6c47a; padding-left: 2px; }
.login-logo { background: linear-gradient(160deg, #101c4f, #172766); margin: -30px -30px 20px; padding: 26px 30px; border-radius: 18px 18px 0 0; text-align: center; }
.login-logo img { width: 190px; max-width: 80%; height: auto; }

/* ---------- Mobile friendly ---------- */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
.sidebar { padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.topbar { padding-top: max(16px, env(safe-area-inset-top)); }
img, canvas, svg { max-width: 100%; }
.table-wrap { -webkit-overflow-scrolling: touch; }
body.nav-open { overflow: hidden; }
@media (max-width: 900px) {
  .sidebar { width: min(300px, 86vw); left: -320px; }
  .brand-logo { max-width: 170px; }
  .page-heading { gap: 2px 10px; }
  .page-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .icon-btn, .menu-toggle { width: 42px; height: 42px; }
  .nav-main, .nav-link { min-height: 44px; }
  .card { padding: 14px; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; gap: 10px; }
  .kpi-icon { width: 40px; height: 40px; }
  .kpi-icon .icon { width: 20px; height: 20px; }
  .toolbar > * { flex: 1 1 auto; }
  .table th, .table td { padding: 8px 8px; }
}
@media (max-width: 600px) {
  .kpi-row { grid-template-columns: 1fr; }
  .content { padding: 6px 12px 28px; }
  .btn { min-height: 42px; justify-content: center; }
  .btn-sm { min-height: 34px; }
  input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=month],
  input[type=search], input[type=time], input[type=tel], select, textarea { font-size: 16px; min-height: 42px; }
  .card-head { align-items: stretch; }
  .card-head .btn { width: 100%; }
  .form-actions { position: sticky; bottom: 0; z-index: 4; background: var(--surface); padding: 10px 0 max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); margin: 12px -2px 0; }
  .form-actions .btn { flex: 1; }
  .mod-bar { gap: 6px; }
  .mod-bar .btn { flex: 1 1 calc(50% - 6px); }
  .mod-bar .muted { flex: 1 1 100%; order: 5; }
  .seg { width: 100%; }
  .seg-btn { flex: 1; padding: 9px 6px; }
  .tag-cols { grid-template-columns: 1fr; }
  dialog.dialog { width: calc(100vw - 20px); padding: 14px; }
  .login-card { padding: 24px 20px; }
  .login-logo { margin: -24px -20px 18px; padding: 22px 20px; }
}
@media (hover: none) { .btn:hover { filter: none; } }

.sidebar-copy { margin-top: auto; padding: 14px 8px 4px; text-align: center; font-size: 11.5px; letter-spacing: .04em; color: rgba(201, 210, 240, .6); border-top: 1px solid rgba(255, 255, 255, .08); }

.nav-link.nav-link-sub { margin-left: 18px; padding: 6px 10px; font-size: 12.5px; min-height: 0; opacity: .92; }
.nav-link.nav-link-sub .icon { color: #fff; opacity: .9; width: 15px; height: 15px; }
.nav-status { margin-left: auto; font-size: 12px; line-height: 1; }

/* ---------- Quick actions & Ctrl+K ---------- */
.topbar-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 8px; }
.quick-menu { position: relative; }
.quick-btn { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; }
.quick-btn::-webkit-details-marker { display: none; }
.quick-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: #fff; border: 1px solid #E3E7F0; border-radius: 12px; box-shadow: 0 12px 30px rgba(11,20,55,.18); padding: 6px; z-index: 40; display: flex; flex-direction: column; }
.quick-list a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.quick-list a:hover { background: #EEF2FF; }
.cmdk { position: fixed; inset: 0; z-index: 100; background: rgba(11,20,55,.5); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.cmdk[hidden] { display: none; }
.cmdk-box { width: min(560px, 92vw); background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.35); overflow: hidden; }
.cmdk-box input { width: 100%; border: 0; border-bottom: 1px solid #E3E7F0; padding: 16px 18px; font-size: 16px; outline: none; }
.cmdk-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cmdk-item { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.cmdk-item small { color: #64748B; }
.cmdk-item.sel { background: #EEF2FF; }
@media (max-width: 700px) { .quick-btn span { display: none; } .topbar-tools { margin-right: 4px; } }

/* KPI card yang bisa diklik */
a.kpi-link { text-decoration: none; color: #fff; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
a.kpi-link:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgba(16, 24, 64, .55); }
a.kpi-link:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.kpi-go { margin-left: auto; align-self: center; font-size: 28px; line-height: 1; opacity: .6; transition: opacity .15s, transform .15s; flex: none; }
a.kpi-link:hover .kpi-go { opacity: 1; transform: translateX(3px); }
/* Overview 4 kartu: angka ringkas tidak dipotong; sub-teks boleh turun baris */
.kpi-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-row-4 .kpi-value { font-size: clamp(22px, 2.2vw, 30px); overflow-wrap: normal; white-space: nowrap; }
.kpi-row-4 .kpi-sub { white-space: normal; }
@media (max-width: 1100px) { .kpi-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpi-row-4 { grid-template-columns: 1fr; } }
@media print { .kpi-go { display: none; } }
