/* ===================================================================
   Hallo Hotel - Dashboard Styles (profesional & responsif)
   =================================================================== */
:root {
    --bg:        #f1f5f9;
    --card:      #ffffff;
    --ink:       #0f172a;
    --ink-soft:  #334155;
    --muted:     #64748b;
    --line:      #e2e8f0;
    --primary:   #2563eb;
    --primary-d: #1d4ed8;
    --primary-l: #eff4ff;
    --sidebar-1: #0f172a;
    --sidebar-2: #1e293b;
    --radius:    14px;
    --radius-sm: 9px;
    --shadow:    0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.06);
    --shadow-lg: 0 12px 40px rgba(15,23,42,.12);
    --sidebar-w: 248px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
h1, h2, h3 { line-height: 1.25; }

/* ---------- Layout (gaya sim_klinik, warna default hotel) ---------- */
.layout { display: flex; min-height: 100vh; }

/* Sidebar (LeftBar) */
.sidebar {
    width: var(--sidebar-w); color: #c4d2e3;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    overflow-y: auto; overflow-x: hidden;
    display: flex; flex-direction: column;
    background: linear-gradient(165deg, var(--sidebar-2) 0%, var(--sidebar-1) 60%, #0b1120 100%);
    box-shadow: 4px 0 24px rgba(15,23,42,.28);
    transition: width .24s cubic-bezier(.4,0,.2,1), transform .25s ease;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }

/* Brand */
.brand {
    padding: 18px; color: #fff; white-space: nowrap;
    display: flex; align-items: center; gap: 13px;
    border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 6px;
}
.brand-ico {
    width: 42px; height: 42px; min-width: 42px; flex: none; overflow: hidden;
    display: flex; align-items: center; justify-content: center; border-radius: 13px;
    background: linear-gradient(135deg, #3b82f6, var(--primary)); box-shadow: 0 6px 16px rgba(37,99,235,.45);
}
.brand-ico.has-logo { background: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.brand-ico img { width: 100%; height: 100%; object-fit: cover; }
.brand-ico svg { width: 23px; height: 23px; color: #fff; }
.login-box .brand .brand-ico { color: var(--primary); }
.brand-text { font-size: 18px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { display: block; font-size: 11px; font-weight: 400; color: #8ea6c4; margin-top: 2px; }

/* Nav */
.sidebar nav { flex: 1; padding: 8px 12px 16px; }
.sidebar nav a {
    position: relative; display: flex; align-items: center; gap: 13px;
    padding: 10px 13px; margin: 2px 0; border-radius: 11px;
    white-space: nowrap; color: #c4d2e3; font-weight: 500; font-size: 14.5px;
    transition: background .16s, color .16s, box-shadow .16s, transform .12s;
}
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a:active { transform: scale(.98); }
.sidebar nav a.active {
    color: #fff; font-weight: 600;
    background: linear-gradient(135deg, #3b82f6 0%, var(--primary) 100%);
    box-shadow: 0 8px 18px rgba(37,99,235,.45);
}
.sidebar nav a .ico { width: 24px; min-width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.sidebar nav a .ico svg { width: 20px; height: 20px; opacity: .92; }
.sidebar nav a.active .ico svg { opacity: 1; }
.sidebar nav a .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
/* Badge notifikasi (chat / permintaan) */
.sidebar nav a .nav-badge {
    margin-left: auto; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
    min-width: 19px; height: 19px; border-radius: 999px; display: inline-flex; align-items: center;
    justify-content: center; padding: 0 6px; flex: none; box-shadow: 0 0 0 2px rgba(239,68,68,.25);
}
.sidebar nav a.active .nav-badge { background: #fff; color: var(--primary); box-shadow: none; }

/* Judul kelompok (section) */
.sidebar nav .label { font-size: 10.5px; text-transform: uppercase; color: #5f7da1; white-space: nowrap; font-weight: 700; padding: 15px 12px 6px; letter-spacing: 1.3px; }

/* Sub-menu (dropdown) di sidebar */
.sidebar nav .nav-group { margin: 2px 0; }
.sidebar nav .nav-parent { display: flex; align-items: center; border-radius: 11px; color: #c4d2e3; transition: background .16s, color .16s; }
.sidebar nav .nav-parent:hover, .sidebar nav .nav-group.open .nav-parent { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav .nav-parent.active { color: #fff; font-weight: 600; background: linear-gradient(135deg, #3b82f6 0%, var(--primary) 100%); box-shadow: 0 8px 18px rgba(37,99,235,.45); }
.sidebar nav .nav-parent .np-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 13px; padding: 10px 13px; color: inherit; font-size: 14.5px; font-weight: inherit; font-family: inherit; white-space: nowrap; background: none; border: none; cursor: pointer; text-align: left; }
.sidebar nav .nav-parent .ico { width: 24px; min-width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.sidebar nav .nav-parent .ico svg { width: 20px; height: 20px; opacity: .92; }
.sidebar nav .nav-parent .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.sidebar nav .nav-parent .np-caret { display: flex; align-items: center; justify-content: center; width: 34px; align-self: stretch; background: none; border: none; cursor: pointer; color: inherit; border-radius: 0 11px 11px 0; transition: background .14s; }
.sidebar nav .nav-parent .np-caret:hover { background: rgba(255,255,255,.1); }
.sidebar nav .nav-parent .np-caret svg { width: 16px; height: 16px; transition: transform .22s; }
.sidebar nav .nav-group.open .nav-parent .np-caret svg { transform: rotate(90deg); }
.sidebar nav .nav-sub { max-height: 0; overflow: hidden; transition: max-height .26s ease; margin-left: 24px; border-left: 1px solid rgba(255,255,255,.1); padding-left: 10px; }
.sidebar nav .nav-group.open .nav-sub { max-height: 340px; }
.sidebar nav .nav-sub a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 2px 0; border-radius: 9px; color: #9fb3cc; font-size: 14px; font-weight: 500; }
.sidebar nav .nav-sub a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav .nav-sub a.active { color: #fff; background: rgba(59,130,246,.20); font-weight: 600; }
.sidebar nav .nav-sub a .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; flex: none; }
.sidebar nav .nav-sub a .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }

/* Tombol Keluar di bawah sidebar */
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); margin-top: auto; }
.sidebar-foot .logout-link {
    display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: 11px;
    color: #f0a8a8; font-size: 14.5px; font-weight: 500; white-space: nowrap; transition: background .16s, color .16s;
}
.sidebar-foot .logout-link:hover { background: rgba(239,68,68,.16); color: #fff; }
.sidebar-foot .logout-link .ico { width: 24px; min-width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.sidebar-foot .logout-link .ico svg { width: 20px; height: 20px; }

/* Main + topbar (Header) */
.main {
    flex: 1; min-width: 0; margin-left: var(--sidebar-w);
    display: flex; flex-direction: column; min-height: 100vh;
    transition: margin-left .24s cubic-bezier(.4,0,.2,1);
}
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    background: var(--card); min-height: 66px; padding: 12px 24px;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.menu-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex: none; border: none; cursor: pointer;
    background: var(--bg); color: var(--ink-soft); border-radius: 11px; transition: background .15s, color .15s;
}
.menu-toggle:hover { background: var(--primary); color: #fff; }
.menu-toggle svg { width: 21px; height: 21px; }
.topbar .page-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Kotak pencarian menu di topbar (menggantikan judul) */
.topbar-search { position: relative; }
.topbar-search .ts-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.topbar-search .ts-ico svg { width: 17px; height: 17px; }
.topbar-search input {
    width: 240px; padding: 10px 14px 10px 40px; border: 1px solid var(--line);
    border-radius: 10px; font-size: 14px; background: var(--bg); color: var(--ink); transition: width .15s, background .15s, border-color .15s, box-shadow .15s;
}
.topbar-search input::placeholder { color: #94a3b8; }
.topbar-search input:focus { outline: none; width: 300px; background: var(--card); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* Chip akun + dropdown di kanan topbar */
.user-dropdown { position: relative; }
.user-chip {
    display: flex; align-items: center; gap: 11px; padding: 6px 14px 6px 6px; border-radius: 40px;
    background: var(--bg); border: 1px solid var(--line); cursor: pointer; color: inherit;
    transition: border-color .14s, box-shadow .14s;
}
.user-chip:hover { border-color: #bfdbfe; box-shadow: 0 2px 10px rgba(37,99,235,.18); }
.user-chip .avatar {
    width: 38px; height: 38px; border-radius: 50%; flex: none; font-size: 13.5px; font-weight: 700; color: #fff;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #6366f1, var(--primary)); box-shadow: 0 3px 8px rgba(37,99,235,.35);
}
.user-chip .user-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-chip .user-name { font-weight: 600; font-size: 13.5px; }
.user-chip .user-role { font-size: 12px; color: var(--muted); }
.user-chip .user-caret { display: flex; color: var(--muted); transition: transform .16s; }
.user-chip .user-caret svg { width: 16px; height: 16px; }
.user-dropdown.open .user-chip .user-caret { transform: rotate(180deg); }
.user-menu {
    position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px; z-index: 200;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .14s, transform .14s, visibility .14s;
}
.user-dropdown.open .user-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.user-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink); }
.user-menu a:hover { background: var(--bg); }
.user-menu a .ico { display: flex; }
.user-menu a .ico svg { width: 18px; height: 18px; }
.user-menu a.danger { color: #dc2626; }
.user-menu a.danger:hover { background: #fef2f2; }
.user-menu-sep { height: 1px; background: var(--line); margin: 5px 6px; }

/* Konten + footer */
.content { padding: 24px 28px; flex: 1; min-width: 0; }
.footer { padding: 16px 24px; color: var(--muted); font-size: 13px; text-align: center; }

/* Scrim untuk sidebar off-canvas (mobile) */
.sidebar-scrim {
    position: fixed; inset: 0; z-index: 40; background: rgba(15,23,42,.5);
    opacity: 0; pointer-events: none; transition: opacity .25s;
}

/* ---------- Flash ---------- */
.flash { margin: 0 0 18px; padding: 13px 16px; border-radius: var(--radius-sm); font-weight: 500; border: 1px solid transparent; }
.flash-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.flash-error   { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.flash-info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }

/* ---------- Pengumuman ---------- */
.announce-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.announce { background: #fffbeb; border: 1px solid #fde68a; border-left: 4px solid #f59e0b; border-radius: var(--radius); padding: 13px 16px; }
.announce-title { font-weight: 700; }
.announce-body { color: #92400e; font-size: 14px; margin-top: 3px; }
.announce-time { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow);
    position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
.stat .num { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.stat .lbl { color: var(--muted); margin-top: 4px; font-size: 12.5px; }

/* ---------- Cards ---------- */
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.card h2 { font-size: 15px; margin-bottom: 16px; font-weight: 700; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }
code { background: var(--bg); padding: 2px 7px; border-radius: 6px; font-size: 12.5px; border: 1px solid var(--line); }

/* ---------- Badge status ---------- */
.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.blue   { background: #dbeafe; color: #1e40af; }
.badge.orange { background: #ffedd5; color: #9a3412; }
.badge.purple { background: #ede9fe; color: #5b21b6; }
.badge.green  { background: #dcfce7; color: #166534; }
.badge.red    { background: #fee2e2; color: #991b1b; }
.badge.gray   { background: #e5e7eb; color: #374151; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--primary); color: #fff; border: 1px solid var(--primary);
    padding: 9px 17px; border-radius: var(--radius-sm); font-size: 14px; cursor: pointer;
    font-weight: 600; transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--primary-d); border-color: var(--primary-d); box-shadow: 0 6px 18px rgba(37,99,235,.3); }
.btn:active { transform: translateY(1px); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: var(--primary-l); color: var(--primary); border-color: transparent; }
.btn.ghost:hover { background: #e0e9ff; box-shadow: none; }
.btn.secondary { background: var(--bg); color: var(--ink-soft); border-color: var(--line); }
.btn.secondary:hover { background: #e7ecf3; border-color: #cbd5e1; color: var(--ink); box-shadow: none; }
.btn.danger { background: #ef4444; border-color: #ef4444; }
.btn.danger:hover { background: #dc2626; border-color: #dc2626; }

/* ---------- Forms ---------- */
input, select, textarea {
    width: 100%; padding: 10px 13px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }

/* ---------- Filter chips ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chips a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 500; transition: all .15s; }
.chips a:hover { border-color: var(--primary); color: var(--primary); }
.chips a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--ink-soft); font-size: 12px; font-weight: 700; line-height: 1; }
.chips a.active .chip-count { background: rgba(255,255,255,.28); color: #fff; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: linear-gradient(135deg, var(--sidebar-1), var(--sidebar-2)); }
.login-box { background: #fff; padding: 38px; border-radius: 20px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-box .brand { color: var(--ink); padding: 0 0 6px; border: none; font-size: 22px; justify-content: center; }
.login-box p.sub { color: var(--muted); margin-bottom: 24px; text-align: center; }
.login-box .btn { width: 100%; padding: 12px; }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.empty { color: var(--muted); padding: 40px 20px; text-align: center; }

/* ---------- Halaman Pengaturan ---------- */
.settings-wrap { max-width: 1100px; margin-left: auto; margin-right: auto; }
.settings-cover {
    display: flex; align-items: center; gap: 22px; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
    color: #fff; border-radius: var(--radius); padding: 28px 30px; margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.settings-cover:after {
    content: ""; position: absolute; right: -50px; top: -50px; width: 200px; height: 200px;
    background: rgba(255,255,255,.06); border-radius: 50%;
}
.sc-logo {
    width: 78px; height: 78px; border-radius: 20px; flex: none; z-index: 1;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.sc-logo img { width: 100%; height: 100%; object-fit: cover; }
.sc-logo svg { width: 38px; height: 38px; color: #fff; }
.sc-info { z-index: 1; min-width: 0; }
.sc-info h2 { font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.sc-meta { color: rgba(255,255,255,.85); margin-top: 5px; font-size: 14px; }
.sc-tz {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
    background: rgba(255,255,255,.16); padding: 5px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
}
.sc-tz svg { width: 14px; height: 14px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; }
.settings-grid .full { grid-column: 1 / -1; }
.logo-input-row { display: flex; gap: 12px; align-items: center; }
.logo-input-row input { flex: 1; }
.logo-thumb {
    width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--line); flex: none;
    object-fit: cover; background: var(--bg);
}
.settings-actions { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
    .settings-grid { grid-template-columns: 1fr; }
    .settings-cover { flex-direction: column; text-align: center; align-items: center; }
    .sc-meta, .sc-info h2 { word-break: break-word; }
}

/* ---------- Sel pengguna (avatar + nama) di tabel ---------- */
.user-cell { display: flex; align-items: center; gap: 11px; }
.avatar-sm {
    width: 38px; height: 38px; border-radius: 50%; flex: none; color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
    box-shadow: 0 2px 6px rgba(15,23,42,.15);
}
.uc-name { font-weight: 600; }
.uc-you { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--primary); background: var(--primary-l); padding: 1px 7px; border-radius: 999px; vertical-align: middle; }
.row-actions { display: flex; gap: 8px; flex-wrap: nowrap; justify-content: center; }
.row-actions form { margin: 0; }
.btn svg { width: 14px; height: 14px; flex: none; }
.btn.iconly { padding: 8px; width: 34px; height: 34px; }
.btn.iconly svg { width: 16px; height: 16px; }

/* ---------- Grid kartu laporan (tinggi sama) ---------- */
.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.report-cols > .card { margin-bottom: 0; }
@media (max-width: 640px) { .report-cols { grid-template-columns: 1fr; } }

/* ---------- Chat ---------- */
.chat-layout { display: grid; grid-template-columns: 330px 1fr; gap: 20px; height: calc(100vh - 142px); min-height: 480px; }
.chat-list, .chat-main { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.chat-list-head { padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.chat-list-head .count { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--bg); padding: 2px 10px; border-radius: 999px; }
.conv-scroll { flex: 1; overflow-y: auto; padding: 8px; }
.conv { display: flex; gap: 11px; padding: 11px; border-radius: 10px; margin-bottom: 2px; transition: background .12s; }
.conv:hover { background: var(--bg); }
.conv.active { background: var(--primary-l); }
.conv-avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), #6366f1); }
.conv-body { flex: 1; min-width: 0; }
.conv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-room { font-weight: 600; }
.conv-time { font-size: 11px; color: var(--muted); flex: none; }
.conv-guest { font-size: 12px; color: var(--muted); }
.conv-last { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-unread { background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

.chat-head { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.chat-head .conv-avatar { width: 40px; height: 40px; }
.chat-head .ch-name { font-weight: 700; }
.chat-head .ch-sub { font-size: 12px; color: var(--muted); }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, #f8fafc, #eef2f7); }
.msg { max-width: 72%; align-self: flex-start; }
.msg.me { align-self: flex-end; }
.msg .bubble { padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; word-wrap: break-word; }
.msg.me .bubble { border-radius: 14px 14px 4px 14px; background: linear-gradient(135deg, var(--primary), var(--primary-d)); color: #fff; border-color: transparent; }
.msg .b-meta { font-size: 11px; color: var(--muted); margin-top: 4px; padding: 0 4px; }
.msg.me .b-meta { text-align: right; }
.chat-composer { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--card); }
.chat-composer input { flex: 1; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); gap: 12px; text-align: center; padding: 30px; }
.chat-empty svg { width: 46px; height: 46px; opacity: .4; }
@media (max-width: 900px) {
    .chat-layout { grid-template-columns: 1fr; height: auto; }
    .conv-scroll { max-height: 280px; }
    .chat-body { min-height: 340px; }
}

/* ---------- Header kartu (judul + aksi) ---------- */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { margin-bottom: 0; }

/* ---------- Modal ---------- */
.modal {
    position: fixed; inset: 0; z-index: 60; display: none;
    align-items: flex-start; justify-content: center; padding: 48px 16px; overflow: auto;
    background: rgba(15,23,42,.5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.modal.open { display: flex; }
.modal-card { background: #fff; border-radius: var(--radius); width: 100%; max-width: 640px; box-shadow: var(--shadow-lg); animation: modalIn .18s ease; }
@keyframes modalIn { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; }
.modal-head .modal-close { background: none; border: none; font-size: 17px; cursor: pointer; color: var(--muted); width: 34px; height: 34px; border-radius: 8px; line-height: 1; }
.modal-head .modal-close:hover { background: var(--bg); color: var(--ink); }
.modal form { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- Toast notifikasi ---------- */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .25s;
    max-width: 320px;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- DataTables overrides ---------- */
.dataTables_wrapper { width: 100%; }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.dataTables_wrapper .dataTables_filter { text-align: right; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    width: auto; display: inline-block; margin-left: 8px; padding: 7px 11px; font-size: 13px;
}
.dataTables_wrapper .dataTables_info { font-size: 12.5px; color: var(--muted); padding-top: 20px; margin-top: 6px; }
.dataTables_wrapper .dataTables_paginate { padding-top: 18px; margin-top: 6px; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px !important; margin: 0 2px; border-radius: var(--radius-sm) !important;
    border: 1px solid var(--line) !important; background: #fff !important; color: var(--ink-soft) !important;
    cursor: pointer; font-size: 13px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--primary-l) !important; border-color: var(--primary) !important; color: var(--primary) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover { opacity: .45; background: #fff !important; color: var(--muted) !important; border-color: var(--line) !important; cursor: default; }
table.dataTable thead th { border-bottom: 2px solid var(--line); }
/* DataTables memaksa header rata kiri; kembalikan untuk kolom rata kanan/tengah */
table.dataTable thead th.text-right, table.dataTable tbody td.text-right { text-align: right; }
table.dataTable thead th.text-center, table.dataTable tbody td.text-center { text-align: center; }
table.dataTable thead th.sorting:after, table.dataTable thead th.sorting_asc:after, table.dataTable thead th.sorting_desc:after { opacity: .4; }
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before {
    background: var(--primary); border: none; box-shadow: none; line-height: 1.1; font-weight: 700;
}
table.dataTable > tbody > tr.child ul.dtr-details { width: 100%; }
table.dataTable > tbody > tr.child span.dtr-title { min-width: 110px; color: var(--muted); font-weight: 600; }

/* ===================================================================
   Sidebar collapsed (icon-only, desktop — gaya sim_klinik)
   =================================================================== */
.layout.collapsed .sidebar { width: 82px; }
.layout.collapsed .main { margin-left: 82px; }
.layout.collapsed .brand { justify-content: center; padding: 18px 0; }
.layout.collapsed .brand-text { display: none; }
.layout.collapsed .sidebar nav { padding: 6px 0 16px; }
.layout.collapsed .sidebar nav a { justify-content: center; padding: 0; margin: 8px auto; width: 50px; height: 50px; border-radius: 14px; gap: 0; }
.layout.collapsed .sidebar nav a .txt { display: none; }
.layout.collapsed .sidebar nav a .nav-badge { display: none !important; }
.layout.collapsed .sidebar nav a .ico { width: auto; min-width: 0; }
.layout.collapsed .sidebar nav a .ico svg { width: 22px; height: 22px; }
/* Dropdown saat sidebar ciut: tampil ikon saja, sub-menu disembunyikan */
.layout.collapsed .sidebar nav .label { display: none; }
.layout.collapsed .sidebar nav .nav-parent { justify-content: center; margin: 8px auto; width: 50px; height: 50px; border-radius: 14px; }
.layout.collapsed .sidebar nav .nav-parent .np-link { justify-content: center; padding: 0; gap: 0; }
.layout.collapsed .sidebar nav .nav-parent .txt,
.layout.collapsed .sidebar nav .nav-parent .np-caret { display: none; }
.layout.collapsed .sidebar nav .nav-parent .ico svg { width: 22px; height: 22px; }
.layout.collapsed .sidebar nav .nav-sub { display: none; }
.layout.collapsed .sidebar-foot { padding: 10px 0; }
.layout.collapsed .sidebar-foot .logout-link { justify-content: center; padding: 0; margin: 0 auto; width: 50px; height: 50px; border-radius: 14px; gap: 0; }
.layout.collapsed .sidebar-foot .logout-link .txt { display: none; }

/* Tooltip hover saat collapsed: tampilkan label di kanan ikon */
.layout.collapsed .sidebar nav a::after {
    content: attr(title);
    position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
    background: #1e293b; color: #fff; font-size: 12px; font-weight: 500;
    padding: 5px 10px; border-radius: 6px; white-space: nowrap;
    pointer-events: none; opacity: 0; transition: opacity .15s;
    box-shadow: 0 4px 12px rgba(0,0,0,.25); z-index: 100;
}
.layout.collapsed .sidebar nav a:hover::after { opacity: 1; }

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 1024px) {
    .content { padding: 20px; }
    .topbar { padding: 10px 18px; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    .layout.sidebar-open .sidebar { transform: translateX(0); box-shadow: 0 0 50px rgba(15,23,42,.5); }
    .main, .layout.collapsed .main { margin-left: 0; }
    .layout.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
    .layout.sidebar-open { overflow: hidden; }
    /* Saat collapsed di mobile jangan terapkan width ciut */
    .layout.collapsed .sidebar { width: var(--sidebar-w); }
    .content { padding: 16px; }
    .topbar { padding: 8px 14px; }
    .topbar .page-title { font-size: 17px; }
    .topbar-search { display: none; }
    .user-chip { padding: 4px; }
    .user-chip .user-meta { display: none; }
}

@media (max-width: 640px) {
    body { font-size: 13.5px; }
    .card { padding: 16px; border-radius: 12px; }
    .stat .num { font-size: 20px; }
    .row { gap: 14px; }
    /* kolom dua-panel jadi tumpuk penuh di HP (override min-width inline) */
    .row > * { min-width: 0 !important; flex: 1 1 100% !important; }
    .dataTables_wrapper .dataTables_filter { text-align: left; }
    .dataTables_wrapper .dataTables_filter input { margin-left: 0; width: 100%; }
}
