/* =====================================================================
   TIKET IT - RS AWAL BROS GROUP
   Design system: diselaraskan dengan Sistem Farmasi RSAB & ABE Office
   (teal brand, netral slate, font Inter, kartu bersih bersudut lembut).

   Struktur:
     1. Font
     2. Design tokens  (warna, tipografi, radius, shadow, layout)
     3. Alias token lama (supaya view lama tetap jalan)
     4. Base
     5. Layout: sidebar, topbar, main
     6. Komponen: card, stat, table, badge, button, form, alert,
        filter, detail, timeline, modal, attachment, progress, empty
     7. Login
     8. Utilities
     9. Responsive
   ===================================================================== */

/* ===== 1. FONT (self-hosted, aman untuk jaringan intranet) ===== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations'),
         url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
}

/* ===== 2. DESIGN TOKENS ===== */
:root {
    /* Brand (teal RS Awal Bros) */
    --brand-50:  #ecfaf7;
    --brand-100: #d2f3ec;
    --brand-200: #a6e7da;
    --brand-300: #6fd6c3;
    --brand-400: #34c2ab;
    --brand-500: #17b3a0;
    --brand-600: #0f8f83;
    --brand-700: #0e6f6c;
    --brand-800: #0d5c5b;
    --brand-900: #0b4648;
    --accent-red: #e53935;

    /* Netral (slate) */
    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --white: #ffffff;

    /* Semantik: warna utama / latar lembut / teks di atas latar lembut */
    --success: #16a34a;  --success-bg: #f0fdf4;  --success-fg: #166534;  --success-border: #bbf7d0;
    --warning: #d97706;  --warning-bg: #fffbeb;  --warning-fg: #92400e;  --warning-border: #fde68a;
    --danger:  #dc2626;  --danger-bg:  #fef2f2;  --danger-fg:  #b91c1c;  --danger-border:  #fecaca;
    --info:    #2563eb;  --info-bg:    #eff6ff;  --info-fg:    #1e40af;  --info-border:    #bfdbfe;
    --purple:  #7c3aed;  --purple-bg:  #f5f3ff;  --purple-fg:  #5b21b6;
    --indigo:  #4f46e5;  --indigo-bg:  #eef2ff;  --indigo-fg:  #3730a3;

    /* Tipografi */
    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif,
                 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --text-xs: 11px;
    --text-sm: 12.5px;
    --text-base: 14px;
    --text-lg: 16px;
    --text-xl: 18px;
    --text-2xl: 22px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadow */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
    --ring: 0 0 0 4px var(--brand-100);
    --ring-danger: 0 0 0 4px #fee2e2;

    /* Layout */
    --sidebar-width: 256px;
    --topbar-height: 64px;
    --transition: 0.2s ease;
}

/* ===== 3. ALIAS TOKEN LAMA =====
   View lama memakai --primary, --gray-*, --teal-*, --red, dll.
   Dipetakan ke token baru supaya semuanya ikut tema yang sama.
   Hapus bertahap setelah semua view dirapikan. */
:root {
    --primary: var(--brand-600);
    --primary-dark: var(--brand-700);
    --primary-light: var(--brand-50);
    --primary-bg: var(--brand-700);

    --teal-50:  var(--brand-50);
    --teal-100: var(--brand-100);
    --teal-500: var(--brand-500);
    --teal-700: var(--brand-700);
    --teal-900: var(--brand-900);

    --gray-50:  var(--slate-50);
    --gray-100: var(--slate-100);
    --gray-200: var(--slate-200);
    --gray-300: var(--slate-300);
    --gray-400: var(--slate-400);
    --gray-500: var(--slate-500);
    --gray-600: var(--slate-600);
    --gray-700: var(--slate-700);
    --gray-800: var(--slate-800);

    --red: var(--danger);
    --orange: #ea580c;
    --green: var(--success);
    --blue: var(--info);
    --yellow: var(--warning);

    --shadow: var(--shadow-md);
    --radius: var(--radius-md);
}

/* ===== 4. BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--slate-100);
    color: var(--slate-800);
    font-size: var(--text-base);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: var(--brand-700); transition: color var(--transition); }
a:hover { color: var(--brand-800); }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img, svg { vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--slate-200); }

:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

::selection { background: var(--brand-100); color: var(--brand-900); }

/* ===== 5. LAYOUT ===== */

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--brand-700);
    color: var(--white);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition);
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tombol tutup sidebar — hanya tampil di layar kecil */
.sidebar-close {
    display: none;
    padding: 4px;
    border: none;
    border-radius: var(--radius-sm);
    background: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}
.sidebar-close:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 950;
    background: rgba(15, 23, 42, 0.4);
}
.sidebar-overlay[hidden] { display: none; }

.sidebar-brand .brand-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-red);
}

.sidebar-brand .brand-name span.brand-rs,
.sidebar-brand .brand-name span.brand-full { color: var(--accent-red); }

.sidebar-brand .brand-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

.sidebar-user {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user .user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role,
.sidebar-user .user-unit {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 12px 24px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-left-color: var(--brand-300);
    font-weight: 600;
}

.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.9; }

/* Tombol (mis. Keluar) yang tampil seperti item menu */
button.nav-item {
    width: 100%;
    background: none;
    border-top: none;
    border-right: none;
    border-bottom: none;
    text-align: left;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-footer {
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Topbar --- */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    z-index: 900;
    transition: left var(--transition);
}

.topbar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--slate-600);
    padding: 8px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    transition: background var(--transition);
}

.topbar-toggle:hover { background: var(--slate-100); }

.topbar-title {
    flex: 1;
    min-width: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--slate-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-full);
    background: var(--slate-100);
    color: var(--slate-500);
    cursor: pointer;
    border: none;
    transition: background var(--transition), color var(--transition);
}

.topbar-icon:hover { background: var(--brand-50); color: var(--brand-700); }
.topbar-icon svg { width: 18px; height: 18px; }

/* Chip user di kanan topbar (tautan ke profil) */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 4px 4px 12px;
    border-radius: var(--radius-full);
    color: var(--slate-700);
    transition: background var(--transition);
}
.topbar-user:hover { background: var(--slate-100); color: var(--slate-900); }

.topbar-user-text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.topbar-user-name { font-size: 13px; font-weight: 600; color: var(--slate-800); }
.topbar-user-role { font-size: 11.5px; color: var(--slate-500); }

.avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    background: var(--brand-100);
    color: var(--brand-800);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* --- Main --- */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
}

.page-content { flex: 1; padding: 32px; }

/* Header halaman (judul + aksi) — dipakai bertahap di view baru */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.page-title { font-size: var(--text-2xl); font-weight: 700; color: var(--slate-900); letter-spacing: -0.01em; }
.page-subtitle { font-size: var(--text-base); color: var(--slate-500); margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* --- Sidebar collapsed (desktop) --- */
.sidebar.collapsed { transform: translateX(-100%); }
.topbar.sidebar-collapsed { left: 0; }
.main-content.sidebar-collapsed { margin-left: 0; }

/* ===== 6. KOMPONEN ===== */

/* --- Card --- */
.card {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--slate-200);
}

.card-header-left { display: flex; align-items: center; gap: 10px; }

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--slate-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-subtitle { font-size: var(--text-sm); color: var(--slate-500); }

.card-body { padding: 24px; }

.card-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--slate-200);
    background: var(--slate-50);
}

/* --- Stat card --- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    position: relative;
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    transition: box-shadow var(--transition), border-color var(--transition);
}

/* Aksen warna tipis di kiri */
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--brand-500);
}

a.stat-card:hover, .stat-card:hover { box-shadow: var(--shadow-md); border-color: var(--slate-300); }
.stat-card.orange::before { background: var(--orange); }
.stat-card.red::before    { background: var(--danger); }
.stat-card.blue::before   { background: var(--info); }
.stat-card.green::before  { background: var(--success); }
.stat-card.yellow::before { background: var(--warning); }

.stat-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-500);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--slate-900);
    font-variant-numeric: tabular-nums;
}

/* --- Table --- */
.table-container { position: relative; overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

thead tr {
    background: var(--slate-50);
    border-bottom: 1px solid var(--slate-200);
}

th {
    padding: 11px 16px;
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-500);
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--slate-100);
    vertical-align: middle;
    color: var(--slate-700);
}

tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--slate-50); }
tbody tr:last-child td { border-bottom: none; }

.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--brand-700); }

/* --- Badge --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    background: var(--slate-100);
    color: var(--slate-600);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

/* Status tiket */
.badge-draft       { background: var(--slate-100);  color: var(--slate-600); }
.badge-submitted   { background: var(--info-bg);    color: var(--info-fg); }
.badge-progress    { background: #fff7ed;           color: #c2410c; }
.badge-development { background: var(--purple-bg);  color: var(--purple-fg); }
.badge-testing     { background: var(--warning-bg); color: var(--warning-fg); }
.badge-qc          { background: var(--indigo-bg);  color: var(--indigo-fg); }
.badge-uat         { background: var(--brand-50);   color: var(--brand-800); }
.badge-selesai     { background: var(--success-bg); color: var(--success-fg); }
.badge-ditolak     { background: var(--danger-bg);  color: var(--danger-fg); }

/* Prioritas */
.badge-low      { background: var(--success-bg); color: var(--success-fg); }
.badge-medium   { background: var(--warning-bg); color: var(--warning-fg); }
.badge-high     { background: #fff1f2;           color: #be123c; }
.badge-critical { background: var(--danger);     color: var(--white); box-shadow: none; }

/* Nada umum (untuk kategori, tipe, verifikasi, dll.) */
.badge-gray   { background: var(--slate-100);  color: var(--slate-600); }
.badge-brand  { background: var(--brand-50);   color: var(--brand-800); }
.badge-blue   { background: var(--info-bg);    color: var(--info-fg); }
.badge-green  { background: var(--success-bg); color: var(--success-fg); }
.badge-yellow { background: var(--warning-bg); color: var(--warning-fg); }
.badge-red    { background: var(--danger-bg);  color: var(--danger-fg); }
.badge-purple { background: var(--purple-bg);  color: var(--purple-fg); }
.badge-indigo { background: var(--indigo-bg);  color: var(--indigo-fg); }
.badge-plain  { text-transform: none; letter-spacing: 0; }

/* --- Button --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), box-shadow var(--transition);
}

.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn.disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary { background: var(--brand-600); color: var(--white); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--brand-700); color: var(--white); }

.btn-outline { background: var(--white); color: var(--brand-700); border-color: var(--brand-200); }
.btn-outline:hover { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-800); }

.btn-secondary,
.btn-gray { background: var(--white); color: var(--slate-700); border-color: var(--slate-300); }
.btn-secondary:hover,
.btn-gray:hover { background: var(--slate-50); color: var(--slate-900); border-color: var(--slate-400); }

.btn-ghost { background: transparent; color: var(--slate-600); }
.btn-ghost:hover { background: var(--slate-100); color: var(--slate-900); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #b91c1c; color: var(--white); }
.btn-danger:focus-visible { box-shadow: var(--ring-danger); }

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #15803d; color: var(--white); }

.btn-warning { background: var(--warning); color: var(--white); }
.btn-warning:hover { background: #b45309; color: var(--white); }

.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-block { width: 100%; }

/* --- Form --- */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-600);
    margin-bottom: 8px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    color: var(--slate-900);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:hover { border-color: var(--slate-400); }

.form-control:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: var(--ring);
}

.form-control:disabled,
.form-control[readonly] { background: var(--slate-50); color: var(--slate-500); }

.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: var(--ring-danger); }
.form-control::placeholder { color: var(--slate-400); }

textarea.form-control { resize: vertical; min-height: 110px; line-height: 1.6; }

select.form-control,
.filter-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

select[multiple].form-control { background-image: none; padding-right: 14px; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-600); width: 16px; height: 16px; }

.form-hint { font-size: 12px; color: var(--slate-500); margin-top: 6px; }
.invalid-feedback { font-size: 12.5px; color: var(--danger-fg); margin-top: 6px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* --- Alert --- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid;
    border-radius: var(--radius-lg);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--brand-50);   color: var(--brand-800);  border-color: var(--brand-200); }
.alert-error,
.alert-danger  { background: var(--danger-bg);  color: var(--danger-fg);  border-color: var(--danger-border); }
.alert-info    { background: var(--info-bg);    color: var(--info-fg);    border-color: var(--info-border); }
.alert-warning { background: var(--warning-bg); color: var(--warning-fg); border-color: var(--warning-border); }

.alert-body { flex: 1; min-width: 0; }
.alert-title { font-weight: 600; margin-bottom: 2px; }
.alert-with-action { align-items: center; flex-wrap: wrap; }
.alert-with-action .btn { flex-shrink: 0; }

/* --- Filter bar --- */
.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 24px;
    background: var(--slate-50);
    border-bottom: 1px solid var(--slate-200);
}

.filter-bar .search-input { flex: 1; min-width: 240px; position: relative; }

.filter-bar .search-input svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--slate-400);
    pointer-events: none;
}

.filter-bar .search-input input { padding-left: 38px; width: 100%; }

.filter-select {
    min-width: 140px;
    padding: 9px 36px 9px 12px;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    color: var(--slate-800);
    background-color: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-select:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--ring); }

.pagination-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 24px;
    font-size: 13px;
    color: var(--slate-500);
    border-top: 1px solid var(--slate-100);
}

/* --- Ticket link --- */
.ticket-link {
    color: var(--brand-700);
    font-weight: 600;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.ticket-link:hover { color: var(--brand-800); text-decoration: underline; }

/* --- Detail grid --- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; }

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--slate-100);
}

.detail-item:nth-child(odd) { border-right: 1px solid var(--slate-100); }

.detail-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-500);
}

.detail-value { font-size: var(--text-base); color: var(--slate-900); font-weight: 500; }

.detail-full { padding: 16px 24px; border-bottom: 1px solid var(--slate-100); }

/* --- Timeline --- */
.timeline { padding: 4px 24px 20px; }

.timeline-item {
    position: relative;
    display: flex;
    gap: 14px;
    padding: 12px 0 12px 22px;
    margin-left: 6px;
    border-left: 2px solid var(--slate-200);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 17px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--white);
    border: 3px solid var(--brand-500);
}

.timeline-item:last-child { border-left-color: transparent; }

.timeline-meta   { font-size: 12px; color: var(--slate-500); margin-top: 2px; }
.timeline-action { font-weight: 600; color: var(--slate-900); text-transform: capitalize; }
.timeline-note   { font-size: 13px; color: var(--slate-600); margin-top: 4px; }

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.hidden { display: none; }

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--slate-200);
}

.modal-title { font-size: var(--text-lg); font-weight: 600; color: var(--slate-900); }
.modal-body { padding: 20px 24px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--slate-200);
    background: var(--slate-50);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--slate-400);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}

.modal-close:hover { color: var(--slate-800); background: var(--slate-100); }

/* --- Attachment --- */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--white);
    transition: border-color var(--transition), background var(--transition);
}

.attachment-item:hover { border-color: var(--brand-200); background: var(--brand-50); }
.attachment-icon { color: var(--brand-600); }

/* --- Progress --- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--slate-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--brand-500);
    transition: width 0.5s ease;
}

/* --- Empty state --- */
.empty-state { padding: 56px 24px; text-align: center; color: var(--slate-500); }
.empty-state svg { width: 44px; height: 44px; margin-bottom: 12px; color: var(--slate-300); }
.empty-state p { font-size: var(--text-base); }

/* --- Footer --- */
.footer-text {
    text-align: center;
    padding: 0 24px 24px;
    font-size: 12px;
    color: var(--slate-400);
}

/* ===== 7. LOGIN (split panel, seragam dengan Farmasi & ABE Office) ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: linear-gradient(135deg, var(--slate-100) 0%, var(--slate-200) 50%, var(--slate-100) 100%);
}

.login-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 1000px;
    min-height: 520px;
    overflow: hidden;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(148, 163, 184, 0.45);
}

.login-left {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px 48px;
    color: var(--white);
    background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-800) 50%, var(--brand-600) 100%);
}

/* Lingkaran dekoratif */
.login-left::before,
.login-left::after {
    content: '';
    position: absolute;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}
.login-left::before { width: 288px; height: 288px; top: -96px; right: -96px; }
.login-left::after  { width: 320px; height: 320px; bottom: -128px; left: -64px; }
.login-left > * { position: relative; }

.login-brand {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.login-brand .brand-rs { color: inherit; }

.login-subtitle { margin-top: 4px; font-size: 18px; font-weight: 600; color: var(--brand-300); }
.login-desc { margin: 24px 0 32px; font-size: 15px; line-height: 1.7; color: rgba(255, 255, 255, 0.9); }

.login-features { display: flex; flex-direction: column; gap: 16px; list-style: none; }

.login-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
}

.login-feature svg { width: 18px; height: 18px; margin-top: 2px; color: var(--brand-300); flex-shrink: 0; }

.login-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
}

.login-title { font-size: 24px; font-weight: 700; color: var(--slate-900); }
.login-tagline { margin: 4px 0 32px; font-size: 15px; color: var(--slate-500); }

.login-right .form-control { padding: 12px 16px; }
.login-right .btn-primary { width: 100%; padding: 12px 16px; font-size: 15px; background: var(--brand-500); }
.login-right .btn-primary:hover { background: var(--brand-600); }

.login-right .alert { margin-bottom: 24px; }

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 24px;
    font-size: 13.5px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--slate-600);
    cursor: pointer;
}

.login-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: center;
    margin-top: 24px;
    font-size: 13.5px;
    font-weight: 500;
}

/* Brand ringkas di atas form, hanya di layar kecil */
.login-brand-mobile { display: none; margin-bottom: 28px; }
.login-brand-mobile-name { font-size: 20px; font-weight: 700; color: var(--brand-800); }
.login-brand-mobile-sub { font-size: 14px; font-weight: 600; color: var(--brand-600); }

.login-footer { margin-top: 40px; text-align: center; font-size: 12px; color: var(--slate-400); }

/* ===== 8. UTILITIES ===== */
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.no-scroll { overflow: hidden; }

.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none !important; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 0; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-4 { padding: 16px; }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: 12px; }
.text-base { font-size: var(--text-base); }
.text-muted { color: var(--slate-500); }
.text-subtle { color: var(--slate-400); }
.text-strong { color: var(--slate-900); }
.text-brand { color: var(--brand-700); }
.text-danger { color: var(--danger-fg); }
.text-success { color: var(--success-fg); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }
.tabular { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }

/* ===== 9. RESPONSIVE ===== */
@media (max-width: 1024px) {
    .page-content { padding: 24px; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar.collapsed { transform: translateX(-100%); }
    .sidebar-close { display: block; }
    .topbar, .topbar.sidebar-collapsed { left: 0; padding: 0 16px; }
    .topbar-title { font-size: 15px; }
    .topbar-user-text { display: none; }
    .topbar-user { padding: 2px; }
    .main-content, .main-content.sidebar-collapsed { margin-left: 0; }
    .page-content { padding: 16px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-item:nth-child(odd) { border-right: none; }
    .card-header, .card-body { padding-left: 16px; padding-right: 16px; }
    .filter-bar { padding: 12px 16px; }
    .filter-bar .search-input { min-width: 100%; }
}

@media (max-width: 767px) {
    .login-card { grid-template-columns: 1fr; max-width: 440px; min-height: 0; }
    .login-left { display: none; }
    .login-right { padding: 40px 28px; }
    .login-brand-mobile { display: block; }
}

@media print {
    .sidebar, .topbar, .footer-text { display: none !important; }
    .main-content { margin-left: 0; padding-top: 0; }
    body { background: var(--white); }
}

/* =====================================================================
   10. POLA HALAMAN (dipakai mulai modul Tiket; bisa dipakai modul lain)
   ===================================================================== */

/* --- Utilitas tambahan --- */
.min-w-0 { min-width: 0; }
.block { display: block; }
.text-warning { color: var(--warning-fg); }
.icon-xs { width: 14px; height: 14px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
fieldset { border: 0; min-width: 0; }
legend { padding: 0; }

/* --- Header halaman detail --- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-500);
}
.back-link:hover { color: var(--brand-700); }

.header-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ticket-no {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--slate-500);
    font-variant-numeric: tabular-nums;
}

/* --- Tag tipe tiket --- */
.type-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.type-bug     { background: var(--danger-bg); color: var(--danger-fg); }
.type-request { background: var(--brand-50);  color: var(--brand-800); }

.badge-xs { padding: 0 7px; font-size: 10.5px; }

/* --- Notifikasi ringkas di atas daftar --- */
.notice-card {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--success-border);
    border-radius: var(--radius-lg);
    background: var(--success-bg);
}
.notice-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--success-fg);
}
.notice-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.notice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--slate-800);
}
.notice-item:hover { background: rgba(255, 255, 255, 0.7); color: var(--slate-900); }
.notice-item-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-item-meta { flex-shrink: 0; font-size: 12px; color: var(--slate-500); }

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 4px;
    padding: 0 16px;
    overflow-x: auto;
    border-bottom: 1px solid var(--slate-200);
    scrollbar-width: thin;
}
.tab {
    flex-shrink: 0;
    padding: 12px 12px 10px;
    border-bottom: 2px solid transparent;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--slate-500);
    white-space: nowrap;
}
.tab:hover { color: var(--slate-900); }
.tab.active { color: var(--brand-700); border-bottom-color: var(--brand-600); font-weight: 600; }

.filter-date { min-width: 150px; padding-right: 12px; background-image: none; }

/* --- Tabel tiket --- */
.table-tickets td { vertical-align: top; }
.row-link { cursor: pointer; }
.cell-ticket { min-width: 260px; max-width: 460px; }
.ticket-title {
    display: block;
    font-weight: 600;
    color: var(--slate-900);
    line-height: 1.4;
}
.row-link:hover .ticket-title { color: var(--brand-700); }
.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--slate-500);
}
.ticket-meta .ticket-no { font-size: 12px; }
.cell-strong { font-weight: 500; color: var(--slate-800); }
.cell-muted { margin-top: 3px; font-size: 12px; color: var(--slate-500); }
.cell-nowrap { white-space: nowrap; }

.empty-title { font-size: 15px; font-weight: 600; color: var(--slate-700); margin-bottom: 4px; }

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 24px;
    border-top: 1px solid var(--slate-200);
    font-size: 13px;
}
.per-page { display: inline-flex; align-items: center; gap: 8px; color: var(--slate-500); }
.per-page .filter-select { min-width: 72px; padding-top: 6px; padding-bottom: 6px; }

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    flex: 1;
}
.table-footer .pagination { justify-content: flex-end; }
.pagination-summary { font-size: 13px; color: var(--slate-500); }
.pagination-pages { display: flex; align-items: center; gap: 4px; }
.page-btn {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    background: var(--white);
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-600);
    transition: background var(--transition), border-color var(--transition);
}
a.page-btn:hover { background: var(--slate-50); border-color: var(--slate-300); color: var(--slate-900); }
.page-btn.is-active { background: var(--brand-600); border-color: var(--brand-600); color: var(--white); }
.page-btn.is-disabled { color: var(--slate-300); cursor: not-allowed; }
.page-btn.is-gap { border-color: transparent; background: none; }

/* --- Stepper progres status --- */
.stepper {
    display: flex;
    list-style: none;
    counter-reset: step;
}
.step {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    min-width: 0;
}
/* garis penghubung */
.step:not(:first-child)::before {
    content: '';
    position: absolute;
    top: 15px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: var(--slate-200);
    z-index: 0;
}
.step.is-done::before,
.step.is-current::before,
.step.is-rejected::before { background: var(--brand-500); }
.step-dot {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 2px solid var(--slate-300);
    background: var(--white);
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-400);
}
.step-dot svg { width: 16px; height: 16px; stroke-width: 2.4; }
.step-label { font-size: 12.5px; font-weight: 500; color: var(--slate-500); line-height: 1.3; }
.step.is-done .step-dot { background: var(--brand-600); border-color: var(--brand-600); color: var(--white); }
.step.is-done .step-label { color: var(--slate-700); }
.step.is-current .step-dot {
    border-color: var(--brand-600);
    color: var(--brand-700);
    box-shadow: 0 0 0 4px var(--brand-100);
}
.step.is-current .step-label { color: var(--brand-800); font-weight: 700; }
.step.is-rejected .step-dot { background: var(--danger); border-color: var(--danger); color: var(--white); }
.step.is-rejected .step-label { color: var(--danger-fg); font-weight: 700; }

.status-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--brand-50);
    color: var(--brand-800);
    font-size: 13.5px;
    font-weight: 500;
}
.status-hint svg { margin-top: 2px; }
.status-hint.is-danger  { background: var(--danger-bg);  color: var(--danger-fg); }
.status-hint.is-success { background: var(--success-bg); color: var(--success-fg); }
.status-hint.is-muted   { background: var(--slate-100);  color: var(--slate-600); }

/* --- Layout detail (isi + panel samping) --- */
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}
.detail-aside { display: flex; flex-direction: column; gap: 0; position: sticky; top: calc(var(--topbar-height) + 24px); }

/* --- Callout --- */
.callout {
    margin-bottom: 20px;
    padding: 14px 18px;
    border: 1px solid var(--slate-200);
    border-left-width: 4px;
    border-radius: var(--radius-lg);
    background: var(--white);
}
.callout-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}
.callout-brand   { border-color: var(--brand-200);      border-left-color: var(--brand-500); background: var(--brand-50); }
.callout-brand .callout-title   { color: var(--brand-800); }
.callout-danger  { border-color: var(--danger-border);  border-left-color: var(--danger);    background: var(--danger-bg); }
.callout-danger .callout-title  { color: var(--danger-fg); }
.callout-success { border-color: var(--success-border); border-left-color: var(--success);   background: var(--success-bg); }
.callout-success .callout-title { color: var(--success-fg); }

.prose-text { white-space: pre-wrap; word-break: break-word; line-height: 1.7; color: var(--slate-800); }
.content-sections { display: flex; flex-direction: column; gap: 24px; }
.content-label {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-500);
}

/* --- Galeri lampiran --- */
.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.thumb {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    background: var(--slate-50);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.thumb:hover { border-color: var(--brand-300); box-shadow: var(--shadow-md); }
.thumb img { width: 100%; height: 110px; object-fit: cover; background: var(--slate-100); }
.thumb-caption {
    padding: 6px 10px;
    font-size: 12px;
    color: var(--slate-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
a.attachment-item { color: var(--slate-800); }

/* --- Riwayat --- */
.history-item { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.history-item:not(:last-child)::before {
    content: '';
    position: absolute;
    top: 34px;
    bottom: 4px;
    left: 15px;
    width: 2px;
    background: var(--slate-200);
}
.history-item:last-child { padding-bottom: 0; }
.history-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
}
.history-body { flex: 1; min-width: 0; padding-top: 4px; }
.history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.history-note {
    margin-top: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--slate-50);
    font-size: 13px;
    color: var(--slate-700);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Nada warna untuk ikon bulat */
.tone-gray   { background: var(--slate-100);  color: var(--slate-600); }
.tone-brand  { background: var(--brand-50);   color: var(--brand-700); }
.tone-blue   { background: var(--info-bg);    color: var(--info); }
.tone-green  { background: var(--success-bg); color: var(--success); }
.tone-red    { background: var(--danger-bg);  color: var(--danger); }
.tone-purple { background: var(--purple-bg);  color: var(--purple); }
.tone-indigo { background: var(--indigo-bg);  color: var(--indigo); }

/* --- Kartu tindakan --- */
.action-card { border-color: var(--brand-200); box-shadow: 0 0 0 3px var(--brand-50); }
.action-card .card-header { background: var(--brand-50); border-bottom-color: var(--brand-100); }
.action-card .card-title { color: var(--brand-800); }
.action-card form + p.action-text,
.action-card form + .inline-note { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--slate-200); }
.action-text { margin-bottom: 14px; font-size: 13.5px; color: var(--slate-600); }
.label-optional {
    margin-left: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--slate-400);
}

.reject-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--slate-200); }
.reject-box summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--danger-fg);
    list-style: none;
}
.reject-box summary::-webkit-details-marker { display: none; }
.reject-box summary::before { content: '▸ '; }
.reject-box[open] summary::before { content: '▾ '; }
.reject-box[open] summary { margin-bottom: 14px; }

.inline-note {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
}
.inline-note svg { flex-shrink: 0; margin-top: 2px; }
.inline-note.is-warning { background: var(--warning-bg); color: var(--warning-fg); }

/* --- Daftar informasi (dl) --- */
.meta-list { padding: 4px 0; }
.meta-list > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--slate-100);
    font-size: 13.5px;
}
.meta-list > div:last-child { border-bottom: none; }
.meta-list dt { color: var(--slate-500); }
.meta-list dd { color: var(--slate-900); font-weight: 500; word-break: break-word; }
.dd-sub { display: block; font-size: 12px; font-weight: 400; color: var(--slate-500); }
.dd-note { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 400; font-style: italic; color: var(--slate-600); }

/* --- Form bertahap --- */
.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}
.form-layout-narrow { grid-template-columns: minmax(0, 860px); }
.form-main { display: flex; flex-direction: column; gap: 20px; }
.form-aside { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--topbar-height) + 24px); }
.form-section { padding: 24px; }
.form-section-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.form-step {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--brand-600);
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
}
.form-section-title { font-size: 16px; font-weight: 600; color: var(--slate-900); line-height: 1.75; }
.form-section-desc { font-size: 13px; color: var(--slate-500); }
.form-hint-row { display: flex; justify-content: space-between; gap: 12px; }
.form-hint-row .form-hint { margin-top: 6px; }

.alert-list { margin: 4px 0 0 18px; }

/* --- Kartu pilihan (radio) --- */
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.choice-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.choice-card:hover { border-color: var(--slate-300); background: var(--slate-50); }
.choice-card input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}
.choice-card:focus-within { box-shadow: var(--ring); }
.choice-card.is-selected { border-color: var(--brand-500); background: var(--brand-50); }
.choice-card.choice-danger.is-selected { border-color: var(--danger); background: var(--danger-bg); }
.choice-card.choice-danger:focus-within { box-shadow: var(--ring-danger); }
/* tanda centang di pojok */
.choice-card.is-selected::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--brand-600) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m5 12.75 5 5 9-11.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.choice-card.choice-danger.is-selected::after { background-color: var(--danger); }
.choice-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-bottom: 6px;
    border-radius: var(--radius-md);
}
.choice-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--slate-900); }
.choice-desc { font-size: 12.5px; line-height: 1.5; color: var(--slate-500); }
.choice-sm { padding: 12px 14px; }
.choice-sm.is-selected::after { top: 10px; right: 10px; width: 16px; height: 16px; background-size: 10px; }

.prio-dot { width: 9px; height: 9px; border-radius: var(--radius-full); flex-shrink: 0; }
.prio-low      { background: var(--success); }
.prio-medium   { background: var(--warning); }
.prio-high     { background: #e11d48; }
.prio-critical { background: var(--danger); box-shadow: 0 0 0 3px #fecaca; }

/* --- Lampiran di form --- */
.attachment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 12px;
    border: 1px dashed var(--slate-300);
    border-radius: var(--radius-lg);
    background: var(--slate-50);
}
.attachment-preview {
    grid-column: 1 / -1;
    max-width: 240px;
    max-height: 140px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    object-fit: contain;
    background: var(--white);
}
.attachment-preview[hidden], .attachment-warning[hidden], [data-remove-row][hidden] { display: none; }
.attachment-warning { grid-column: 1 / -1; margin-top: 0; }
.attachment-remove { color: var(--slate-500); }
.attachment-remove:hover { color: var(--danger); background: var(--danger-bg); }

.file-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
}
.file-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 8px 12px;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-md);
    background: var(--white);
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-700);
    transition: border-color var(--transition), background var(--transition);
}
.file-picker:hover .file-picker-btn { border-color: var(--brand-300); background: var(--brand-50); color: var(--brand-800); }
.file-picker:focus-within .file-picker-btn { box-shadow: var(--ring); border-color: var(--brand-500); }
.file-picker-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: var(--slate-500);
}

.file-list { list-style: none; margin-bottom: 14px; }
.file-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--slate-100);
    font-size: 13.5px;
}
.file-list li a { flex: 1; min-width: 0; }

/* --- Alur setelah dikirim --- */
.flow-list { list-style: none; counter-reset: flow; display: flex; flex-direction: column; gap: 12px; }
.flow-list[hidden] { display: none; }
.flow-list li {
    counter-increment: flow;
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: var(--slate-700);
}
.flow-list li::before {
    content: counter(flow);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 11.5px;
    font-weight: 700;
}

/* --- Bar aksi form (menempel di bawah layar) --- */
.form-actions {
    position: sticky;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px -32px -32px;
    padding: 14px 32px;
    border-top: 1px solid var(--slate-200);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
}
.form-actions-spacer { flex: 1; }

.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: var(--white);
    border-radius: var(--radius-full);
    animation: spin 0.7s linear infinite;
}
.btn-secondary.is-loading::after { border-color: var(--slate-300); border-top-color: var(--slate-700); }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Responsive pola halaman --- */
@media (max-width: 1100px) {
    .detail-layout, .form-layout { grid-template-columns: minmax(0, 1fr); }
    .detail-aside, .form-aside { position: static; }
    .detail-aside { order: -1; }
    .choice-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .form-actions { margin: 24px -24px -24px; padding: 12px 24px; }
}

@media (max-width: 768px) {
    .stepper { overflow-x: auto; padding-bottom: 4px; }
    .step { min-width: 72px; }
    .step-label { font-size: 11.5px; }
    .choice-grid { grid-template-columns: minmax(0, 1fr); }
    .attachment-row { grid-template-columns: minmax(0, 1fr) auto; }
    .attachment-row .file-picker { grid-column: 1 / -1; }
    .form-section { padding: 18px 16px; }
    .form-actions { margin: 20px -16px -16px; padding: 12px 16px; flex-wrap: wrap; }
    .form-actions .btn-ghost { display: none; }
    .form-actions .btn { flex: 1; }
    .form-actions-spacer { display: none; }
    .meta-list > div { grid-template-columns: 96px minmax(0, 1fr); padding: 10px 16px; }
    .table-footer { padding: 12px 16px; }
    .tabs { padding: 0 8px; }
    .page-header .page-actions { width: 100%; }

    /* Tabel tiket menjadi kartu per baris */
    .table-tickets thead { display: none; }
    .table-tickets, .table-tickets tbody { display: block; }
    .table-tickets tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 14px 16px;
        border-bottom: 1px solid var(--slate-200);
    }
    .table-tickets tr:last-child { border-bottom: none; }
    .table-tickets td { display: block; padding: 0; border: 0; }
    .table-tickets .cell-ticket { flex-basis: 100%; min-width: 0; max-width: none; }
    .table-tickets td:nth-child(3) { order: 5; flex-basis: 100%; font-size: 12.5px; }
    .table-tickets td:nth-child(3) .cell-strong,
    .table-tickets td:nth-child(3) .cell-muted { display: inline; margin: 0; }
    .table-tickets td:nth-child(3) .cell-muted::before { content: ' · '; }
    .table-tickets td:nth-child(5) { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .table-tickets td:nth-child(5) .cell-muted { margin: 0; }
    .table-tickets td:nth-child(6), .table-tickets td:nth-child(7) { display: none; }
    .table-tickets td[colspan] { flex-basis: 100%; }
}
.ticket-modul::before { content: '·'; margin-right: 6px; color: var(--slate-300); }

/* --- Banner ringkas "tiket baru selesai" (bisa dibuka/ditutup) --- */
.notice-bar {
    margin-bottom: 20px;
    border: 1px solid var(--success-border);
    border-radius: var(--radius-lg);
    background: var(--success-bg);
    overflow: hidden;
}
.notice-bar[hidden] { display: none; }
.notice-bar-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 14px;
    cursor: pointer;
    list-style: none;
    font-size: 13.5px;
    color: var(--success-fg);
}
.notice-bar-summary::-webkit-details-marker { display: none; }
.notice-bar-icon { display: grid; place-items: center; color: var(--success); }
.notice-bar-text { flex: 1; min-width: 0; }
.notice-bar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    transition: background var(--transition);
}
.notice-bar-summary:hover .notice-bar-toggle { background: rgba(255, 255, 255, 0.7); }
.notice-bar-toggle svg { transition: transform var(--transition); }
.notice-bar[open] .notice-bar-toggle svg { transform: rotate(180deg); }
.notice-bar .when-open, .notice-bar[open] .when-closed { display: none; }
.notice-bar[open] .when-open { display: inline; }
.notice-bar-close {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: var(--radius-md);
    background: none;
    color: var(--success-fg);
    cursor: pointer;
    opacity: 0.7;
}
.notice-bar-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.7); }
.notice-bar-list {
    list-style: none;
    max-height: 264px;              /* ± 5 baris, sisanya di-scroll */
    overflow-y: auto;
    padding: 4px 8px 8px;
    border-top: 1px solid var(--success-border);
    background: var(--white);
}
.notice-bar-list .notice-item { padding: 8px 10px; }
.notice-bar-list .notice-item:hover { background: var(--slate-50); }
.notice-item-main { display: flex; flex-direction: column; min-width: 0; }
.notice-item-main > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-item-sub { font-size: 12px; color: var(--slate-500); }

/* Penanda tiket baru selesai di tabel */
.new-flag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--success-fg);
}
.new-flag::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--success);
}

/* =====================================================================
   11. DASHBOARD & DAFTAR RINGKAS (dipakai ulang di halaman lain)
   ===================================================================== */
.dash-grid { display: grid; gap: 24px; margin-bottom: 24px; }
.dash-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card-link { font-size: 13px; font-weight: 600; white-space: nowrap; }

/* Daftar item ringkas (judul + keterangan + badge di kanan) */
.item-list { list-style: none; }
.item-list li + li { border-top: 1px solid var(--slate-100); }
.item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--slate-800);
    transition: background var(--transition);
}
.item-row:hover { background: var(--slate-50); color: var(--slate-900); }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row:hover .item-title { color: var(--brand-700); }
.item-sub { font-size: 12px; color: var(--slate-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pengingat */
.reminder-list { list-style: none; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.reminder-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--slate-800);
    transition: background var(--transition);
}
.reminder-row:hover { background: var(--slate-50); color: var(--slate-900); }
.reminder-row-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
}
.reminder-row-text { flex: 1; min-width: 0; }
.reminder-row-arrow { color: var(--slate-300); transition: transform var(--transition), color var(--transition); }
.reminder-row:hover .reminder-row-arrow { color: var(--brand-600); transform: translateX(2px); }
.tone-row-danger  .reminder-row-icon { background: var(--danger-bg);  color: var(--danger); }
.tone-row-warning .reminder-row-icon { background: var(--warning-bg); color: var(--warning); }
.tone-row-info    .reminder-row-icon { background: var(--info-bg);    color: var(--info); }

/* Ringkasan status */
.status-bar {
    display: flex;
    gap: 3px;
    height: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: var(--radius-full);
    background: var(--slate-100);
}
.status-bar-seg { min-width: 6px; height: 100%; }
.status-bar-seg:first-child { border-radius: var(--radius-full) 0 0 var(--radius-full); }
.status-bar-seg:last-child  { border-radius: 0 var(--radius-full) var(--radius-full) 0; }
.seg-blue   { background: #3b82f6; }
.seg-orange { background: #f97316; }
.seg-purple { background: #8b5cf6; }
.seg-indigo { background: #6366f1; }
.seg-brand  { background: var(--brand-500); }
.seg-green  { background: #22c55e; }
.seg-red    { background: #ef4444; }
.seg-gray   { background: var(--slate-300); }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    color: var(--slate-800);
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.summary-item:hover { border-color: var(--brand-300); background: var(--brand-50); color: var(--slate-900); }
.summary-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--slate-600); }
.summary-dot { width: 8px; height: 8px; border-radius: var(--radius-full); flex-shrink: 0; }
.summary-value { font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--slate-900); font-variant-numeric: tabular-nums; }

/* Kartu catatan */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.note-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--slate-200);
    border-top: 3px solid var(--brand-400);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--slate-800);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.note-card:hover { box-shadow: var(--shadow-md); color: var(--slate-900); }
.note-card.prio-penting { border-top-color: var(--warning); }
.note-card.prio-urgent  { border-top-color: var(--danger); }
.note-card.is-unread { background: #fffdf7; }
.note-card-head { display: flex; align-items: flex-start; gap: 8px; }
.note-card-title { flex: 1; min-width: 0; font-weight: 600; color: var(--slate-900); line-height: 1.4; }
.note-pin { font-size: 13px; line-height: 1.4; }
.note-card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.note-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.55;
    color: var(--slate-600);
}
.note-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--slate-100);
    font-size: 12px;
    color: var(--slate-500);
}
.note-reactions { display: flex; gap: 4px; flex-shrink: 0; }
.note-reactions span { padding: 1px 7px; border-radius: var(--radius-full); background: var(--slate-100); }

@media (max-width: 1100px) {
    .dash-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .item-row { padding: 12px 16px; }
    .summary-value { font-size: 20px; }
}

/* =====================================================================
   12. UPDATE INFO (matrix status per unit) + komponen pendukung
   ===================================================================== */

/* Strip pengingat satu baris */
.hint-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 10px 14px;
    border: 1px solid var(--brand-200);
    border-radius: var(--radius-lg);
    background: var(--brand-50);
    font-size: 13.5px;
    color: var(--brand-800);
}
.hint-strip > span { flex: 1; min-width: 220px; }

/* Kartu progres (monitoring unit) */
.progress-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.progress-card {
    padding: 16px 18px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: var(--white);
}
.progress-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.progress-card-label { font-size: 13px; font-weight: 600; color: var(--slate-600); }
.progress-card-pct { font-size: 13px; font-weight: 700; }
.progress-card-value { margin: 4px 0 10px; font-size: 26px; font-weight: 700; color: var(--slate-900); font-variant-numeric: tabular-nums; }
.progress-card-value span { margin-left: 2px; font-size: 14px; font-weight: 500; color: var(--slate-500); }
.progress-card-note { margin-top: 8px; font-size: 12.5px; color: var(--slate-500); }
.progress-card.is-success .progress-fill { background: var(--success); }
.progress-card.is-success .progress-card-pct { color: var(--success-fg); }
.progress-card.is-warning .progress-fill { background: var(--warning); }
.progress-card.is-warning .progress-card-pct { color: var(--warning-fg); }

/* Matrix */
.matrix-wrap { position: relative; overflow: auto; max-height: 70vh; }
.matrix { font-size: 13px; }
.matrix thead th { position: sticky; top: 0; z-index: 3; background: var(--slate-50); box-shadow: inset 0 -1px 0 var(--slate-200); }
.matrix td { vertical-align: middle; }
.matrix .matrix-sticky {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 300px;
    max-width: 380px;
    background: var(--white);
    box-shadow: inset -1px 0 0 var(--slate-200);
}
.matrix thead .matrix-sticky { z-index: 4; background: var(--slate-50); }
.matrix tbody tr:hover .matrix-sticky { background: var(--slate-50); }
.matrix-badges { display: flex; gap: 6px; margin-top: 6px; }
.matrix-unit { padding: 8px 4px; text-align: center; min-width: 44px; }
.matrix-unit span {
    display: inline-block;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10.5px;
    letter-spacing: 0.02em;
}
.matrix-cell { padding: 8px 4px; text-align: center; }
.matrix-progress { min-width: 110px; text-align: center; }
.matrix-progress-pct { font-weight: 700; color: var(--slate-900); margin-bottom: 4px; }
.matrix-progress .cell-muted { margin-top: 4px; }
.matrix-mine { min-width: 170px; background: var(--brand-50); }
.matrix thead .matrix-mine { background: var(--brand-100); color: var(--brand-800); }

/* Chip status unit */
.uchip {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}
.uchip svg { width: 15px; height: 15px; stroke-width: 2.2; }
.uchip.is-verified { background: var(--success);    color: var(--white); }
.uchip.is-pending  { background: var(--success-bg); color: var(--success); box-shadow: inset 0 0 0 1.5px var(--success-border); }
.uchip.is-error    { background: var(--danger-bg);  color: var(--danger);  box-shadow: inset 0 0 0 1.5px var(--danger-border); }
.uchip.is-rejected { background: var(--warning-bg); color: var(--warning); box-shadow: inset 0 0 0 1.5px var(--warning-border); }
.uchip.is-belum    { background: var(--slate-100);  color: var(--slate-400); }
.uchip.is-mine { outline: 2px solid var(--brand-500); outline-offset: 2px; }

.mine-cell { display: flex; align-items: center; gap: 10px; }
.mine-label { font-size: 12.5px; font-weight: 600; color: var(--slate-700); line-height: 1.35; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--slate-600); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend .uchip { width: 20px; height: 20px; border-radius: 5px; }
.legend .uchip svg { width: 12px; height: 12px; }

/* Ringkasan progres di detail */
.progress-summary { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.progress-summary-pct { font-size: 32px; font-weight: 700; line-height: 1.1; color: var(--slate-900); }
.state-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--slate-600); }
.state-legend li { display: inline-flex; align-items: center; gap: 6px; }
.state-legend strong { color: var(--slate-900); }
.state-dot { width: 10px; height: 10px; border-radius: 3px; }
.state-verified { background: var(--success); }
.state-pending  { background: #86efac; }
.state-rejected { background: var(--warning); }
.state-error    { background: var(--danger); }
.state-belum    { background: var(--slate-300); }

/* Pill status di tabel unit */
.state-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--slate-100);
    color: var(--slate-600);
}
.state-pill.state-verified { background: var(--success-bg); color: var(--success-fg); }
.state-pill.state-pending  { background: #f0fdf4;           color: #15803d; box-shadow: inset 0 0 0 1px var(--success-border); }
.state-pill.state-rejected { background: var(--warning-bg); color: var(--warning-fg); }
.state-pill.state-error    { background: var(--danger-bg);  color: var(--danger-fg); }
.state-pill.state-belum    { background: var(--slate-100);  color: var(--slate-500); }

.unit-table td { vertical-align: top; }
.unit-table tr.is-mine td { background: var(--brand-50); }
.unit-note { margin-top: 4px; font-size: 12.5px; color: var(--slate-600); font-style: italic; }
.inline-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; }
.verify-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; }

/* Popover sederhana berbasis <details> */
.popover { position: relative; }
.popover > summary { list-style: none; cursor: pointer; }
.popover > summary::-webkit-details-marker { display: none; }
.popover-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    width: 280px;
    padding: 14px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-lg);
}

/* Isi update */
.instruction-box {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--brand-500);
    background: var(--brand-50);
}
.instruction-box .content-label { color: var(--brand-800); }
.instruction-box .prose-text { font-weight: 500; }
.path-chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--slate-100);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--slate-800);
    word-break: break-all;
}
.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    color: var(--slate-800);
    transition: border-color var(--transition), background var(--transition);
}
.link-card:hover { border-color: var(--brand-300); background: var(--brand-50); color: var(--slate-900); }
.link-card-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-md); flex-shrink: 0; }

.inline-note.is-danger { background: var(--danger-bg); color: var(--danger-fg); }
.inline-note.is-info   { background: var(--info-bg);   color: var(--info-fg); }

/* Segmented control (radio) */
.segmented {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 3px;
    border-radius: var(--radius-md);
    background: var(--slate-100);
}
.segmented-item {
    position: relative;
    padding: 8px 10px;
    border-radius: 6px;
    text-align: center;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--slate-600);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.segmented-item input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-item:focus-within { box-shadow: var(--ring); }
.segmented-item.is-selected { background: var(--white); color: var(--slate-900); box-shadow: var(--shadow-sm); }
.segmented-item.seg-selesai.is-selected { color: var(--success-fg); }
.segmented-item.seg-error.is-selected { color: var(--danger-fg); }
[data-bukti][hidden] { display: none; }

/* Form tambahan */
.choice-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.form-row-wide { grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr); }
.font-mono-soft { font-family: var(--font-mono); font-size: 13px; }

/* Switch */
.switch { position: relative; display: inline-flex; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--slate-300);
    transition: background var(--transition);
}
.switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition);
}
.switch input:checked + .switch-track { background: var(--brand-600); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }
#manual-book-fields[hidden], [data-modul-baru][hidden] { display: none; }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    padding: 3px 10px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-full);
    background: var(--slate-50);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--slate-700);
}

@media (max-width: 768px) {
    .progress-cards { grid-template-columns: minmax(0, 1fr); }
    .matrix .matrix-sticky { min-width: 220px; }
    .choice-grid-3, .form-row-wide { grid-template-columns: minmax(0, 1fr); }
    .popover-panel { right: auto; left: 0; width: 260px; }
}
/* Desktop: popover "Tolak" di tabel unit tidak terpotong kontainer */
@media (min-width: 769px) { .unit-table-wrap { overflow: visible; } }

/* =====================================================================
   13. RICH TEXT EDITOR (gaya editor Internal Memo ABE Office)
       + tipografi dokumen .doc-content (dipakai editor, halaman detail,
         dan menjadi acuan PDF)
   ===================================================================== */
.rte {
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.rte:focus-within { border-color: var(--brand-500); box-shadow: var(--ring); }

.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--slate-200);
    background: var(--slate-50);
}
.rte-toolbar button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 30px;
    height: 30px;
    justify-content: center;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--slate-700);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.rte-toolbar button .icon { width: 17px; height: 17px; }
.rte-toolbar button span { font-size: 12px; font-weight: 500; }
.rte-toolbar button:hover { background: var(--white); border-color: var(--slate-200); color: var(--slate-900); }
.rte-toolbar button.is-active { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }
.rte-toolbar .rte-btn-danger { color: var(--danger-fg); }
.rte-toolbar select {
    height: 30px;
    padding: 0 26px 0 8px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 6px center / 14px;
    appearance: none;
    -webkit-appearance: none;
    font-size: 12.5px;
    color: var(--slate-700);
    cursor: pointer;
}
.rte-toolbar select:focus { outline: none; border-color: var(--brand-500); }
.rte-divider { width: 1px; height: 20px; margin: 0 4px; background: var(--slate-200); }

.rte-editor {
    min-height: 260px;
    max-height: 640px;
    overflow-y: auto;
    padding: 16px 18px;
    outline: none;
}
.rte-editor:empty::before { content: attr(data-placeholder); color: var(--slate-400); pointer-events: none; }
.rte-editor table td:focus, .rte-editor table th:focus { outline: 2px solid var(--brand-500); outline-offset: -1px; }
.rte-editor table th.col-resize-hover { cursor: col-resize; box-shadow: inset -2px 0 0 var(--brand-600); }
.rte-editor table.no-border, .rte-editor table.no-border td, .rte-editor table.no-border th { border-color: transparent !important; }
.rte-editor table.no-border td, .rte-editor table.no-border th { outline: 1px dashed var(--slate-200); }

/* Modal pilih ukuran tabel */
.rte-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.45);
}
.rte-modal-overlay[hidden] { display: none; }
.rte-modal {
    width: min(320px, 100%);
    padding: 20px;
    border-radius: var(--radius-xl);
    background: var(--white);
    box-shadow: var(--shadow-lg);
}
.rte-modal-title { margin-bottom: 4px; font-size: 15px; font-weight: 600; color: var(--slate-900); }
.rte-grid-label { margin-bottom: 12px; font-size: 12.5px; color: var(--slate-500); }
.rte-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin-bottom: 16px; }
.rte-grid-cell {
    aspect-ratio: 1;
    border: 1px solid var(--slate-200);
    border-radius: 3px;
    background: var(--white);
    cursor: pointer;
}
.rte-grid-cell.is-on { border-color: var(--brand-500); background: var(--brand-100); }
.rte-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Menu klik kanan tabel */
.rte-menu {
    position: fixed;
    z-index: 3001;
    min-width: 210px;
    padding: 4px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-lg);
}
.rte-menu[hidden] { display: none; }
.rte-menu-item {
    display: block;
    width: 100%;
    padding: 7px 12px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    text-align: left;
    font-size: 13px;
    color: var(--slate-700);
    cursor: pointer;
}
.rte-menu-item:hover { background: var(--brand-50); color: var(--brand-800); }
.rte-menu-item.is-danger { color: var(--danger-fg); }
.rte-menu-item.is-danger:hover { background: var(--danger-bg); }
.rte-menu-divider { height: 1px; margin: 4px 0; background: var(--slate-100); }

/* Toast kecil editor */
.rte-toast-wrap { position: fixed; top: 76px; right: 20px; z-index: 3100; display: flex; flex-direction: column; gap: 8px; }
.rte-toast {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 500;
    background: var(--slate-900);
    color: var(--white);
    transition: opacity 0.3s;
}
.rte-toast.is-success { background: var(--success-fg); }
.rte-toast.is-warning { background: var(--warning-fg); }
.rte-toast.is-leaving { opacity: 0; }

/* --- Tipografi dokumen (gaya Internal Memo) --- */
.doc-content {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11pt;
    line-height: 1.6;
    color: #000;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.doc-content p { margin: 0 0 4px; }
.doc-content h1, .doc-content h2, .doc-content h3 { margin: 10px 0 6px; font-weight: bold; line-height: 1.35; color: #000; }
.doc-content h1 { font-size: 18pt; }
.doc-content h2 { font-size: 14pt; }
.doc-content h3 { font-size: 12pt; }
.doc-content > :first-child { margin-top: 0; }
.doc-content ol, .doc-content ul { margin: 4px 0 6px; padding-left: 22px; }
.doc-content li { margin-bottom: 2px; }
.doc-content a { color: #1a5fb4; text-decoration: underline; }
.doc-content img { max-width: 100%; height: auto; }
.doc-content blockquote { margin: 6px 0; padding: 6px 12px; border-left: 3px solid #999; background: #f7f7f7; }
.doc-content table { width: 100%; margin: 8px 0; border-collapse: collapse; table-layout: fixed; font-size: 11pt; }
.doc-content table td, .doc-content table th {
    padding: 5px 8px;
    border: 1px solid #333;
    vertical-align: top;
    text-align: left;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.doc-content table th { background: #f5f5f5; font-weight: 600; text-align: center; }
.doc-content table.no-border, .doc-content table.no-border td, .doc-content table.no-border th { border-color: transparent; }
/* Kompatibilitas konten lama dari editor Quill */
.doc-content .ql-align-center { text-align: center; }
.doc-content .ql-align-right { text-align: right; }
.doc-content .ql-align-justify { text-align: justify; }
.doc-content .ql-indent-1 { padding-left: 3em; }
.doc-content .ql-indent-2 { padding-left: 6em; }
.doc-content .ql-indent-3 { padding-left: 9em; }
.doc-content .ql-indent-4 { padding-left: 12em; }
.doc-content li.ql-indent-1 { margin-left: 3em; padding-left: 0; }
.doc-content li.ql-indent-2 { margin-left: 6em; padding-left: 0; }
.doc-content li.ql-indent-3 { margin-left: 9em; padding-left: 0; }

@media (max-width: 768px) {
    .rte-toolbar button span { display: none; }
    .doc-content { font-size: 10.5pt; }
}

/* =====================================================================
   14. MANUAL BOOK
   ===================================================================== */
.mb-0 { margin-bottom: 0; }

/* Kartu section di form */
.section-list { display: flex; flex-direction: column; gap: 16px; }
.section-editor {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: var(--white);
}
.section-editor-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 10px 14px;
    border-bottom: 1px solid var(--slate-200);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--slate-50);
}
.section-editor-num {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--brand-600);
    color: var(--white);
    font-size: 12.5px;
    font-weight: 700;
}
.section-editor-title {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: none;
    text-align: left;
    font-weight: 600;
    color: var(--slate-900);
    cursor: pointer;
}
.section-editor-title > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-editor-chevron { flex-shrink: 0; color: var(--slate-400); transition: transform var(--transition); }
.section-editor.is-collapsed .section-editor-chevron,
.mb-section.is-collapsed .section-editor-chevron { transform: rotate(-90deg); }
.section-editor-actions { display: flex; gap: 2px; }
.section-editor-actions .btn { padding: 6px 8px; }
.section-editor-body { padding: 18px; }
.section-editor.is-collapsed .section-editor-body { display: none; }
.section-editor.is-collapsed .section-editor-head { border-bottom: 0; border-radius: var(--radius-lg); }

/* Pemilih gambar */
.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px;
    border: 1.5px dashed var(--slate-300);
    border-radius: var(--radius-lg);
    background: var(--slate-50);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--brand-400); background: var(--brand-50); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-icon { width: 26px; height: 26px; color: var(--slate-400); }
.dropzone-text { font-size: 13.5px; color: var(--slate-600); }
.dropzone-text strong { color: var(--brand-700); }
.dropzone-hint { font-size: 12px; color: var(--slate-400); }
.image-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.image-picker-grid:not(:empty) { margin-top: 12px; }
.image-tile {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    background: var(--white);
}
.image-tile img { display: block; width: 100%; height: 100px; object-fit: cover; background: var(--slate-100); }
.image-tile-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: var(--radius-full);
    background: rgba(15, 23, 42, 0.65);
    color: var(--white);
    font-size: 16px;
    cursor: pointer;
}
.image-tile-remove:hover { background: var(--danger); }
.image-tile-input { width: 100%; padding: 7px 9px; border: 0; border-top: 1px solid var(--slate-200); font-size: 12.5px; }
.image-tile-input:focus { outline: none; background: var(--brand-50); }
.image-tile-caption { padding: 6px 9px; border-top: 1px solid var(--slate-200); font-size: 12px; color: var(--slate-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Daftar manual book */
.mb-row { gap: 16px; flex-wrap: wrap; }
.mb-row-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 260px; color: inherit; }
.mb-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--brand-600);
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.mb-avatar.is-draft { background: var(--slate-300); color: var(--slate-700); }
.mb-row-meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--slate-500); }
.mb-meta-item strong { color: var(--slate-800); }
.mb-row-actions { display: flex; gap: 6px; }

/* Section di halaman detail */
.mb-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border: 0;
    border-bottom: 1px solid var(--slate-200);
    background: var(--white);
    text-align: left;
    cursor: pointer;
}
.mb-section-head:hover { background: var(--slate-50); }
.mb-section.is-collapsed .mb-section-head { border-bottom: 0; }
.mb-section-title { display: block; font-size: 15px; font-weight: 600; color: var(--slate-900); }
.mb-section-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; font-size: 12.5px; color: var(--slate-500); }
.mb-section-body { padding: 22px 24px; }
.mb-section.is-collapsed .mb-section-body { display: none; }

.toc-nav { list-style: none; padding: 6px 8px; max-height: 360px; overflow-y: auto; }
.toc-nav a {
    display: flex;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--slate-700);
}
.toc-nav a:hover { background: var(--slate-50); color: var(--brand-700); }
.toc-nav-num { flex-shrink: 0; min-width: 22px; color: var(--slate-400); font-variant-numeric: tabular-nums; }
.manage-actions { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 768px) {
    .section-editor-body, .mb-section-body { padding: 14px; }
    .mb-row-meta { width: 100%; padding-left: 52px; flex-wrap: wrap; }
    .mb-row-actions { padding-left: 52px; }
}
/* Tabel isi dokumen tidak ikut gaya tabel data aplikasi (header kecil/uppercase, hover baris). */
.doc-content thead tr { background: none; border: 0; }
.doc-content table th {
    font-size: inherit;
    letter-spacing: normal;
    text-transform: none;
    white-space: normal;
    color: #000;
}
.doc-content table td { color: #000; }
.doc-content tbody tr:hover { background: none; }

/* Tiket Saya: jumlah per tab & penanda tindakan */
.tab-count {
    display: inline-block;
    min-width: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--slate-100);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    color: var(--slate-600);
}
.tab.active .tab-count { background: var(--brand-100); color: var(--brand-800); }
.action-flag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--slate-500);
}
.action-flag::before { content: ''; width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; }
.action-flag.is-warning { color: var(--warning-fg); }
.action-flag.is-danger { color: var(--danger-fg); }

/* =====================================================================
   15. ANTREAN TIKET (helpdesk) + panel pratinjau (drawer)
   ===================================================================== */
.nav-badge {
    margin-left: auto;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    background: var(--accent-red);
    color: var(--white);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.queue-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.queue-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    color: var(--slate-800);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.queue-chip:hover { border-color: var(--brand-300); box-shadow: var(--shadow-md); color: var(--slate-900); }
.queue-chip.is-empty { opacity: 0.6; }
.queue-chip-icon { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--radius-md); }
.queue-chip-label { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; line-height: 1.3; }
.queue-chip-count { font-size: 22px; font-weight: 700; color: var(--slate-900); font-variant-numeric: tabular-nums; }

.queue-group { scroll-margin-top: calc(var(--topbar-height) + 16px); }
.queue-group-head { display: flex; align-items: center; gap: 12px; }
.queue-group-head .card-title { gap: 8px; }
.queue-empty { display: flex; align-items: center; gap: 8px; padding: 14px 24px; font-size: 13.5px; color: var(--slate-500); }
.queue-empty svg { color: var(--success); }

.queue-list { list-style: none; }
.queue-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px;
    border-top: 1px solid var(--slate-100);
    cursor: pointer;
    transition: background var(--transition);
}
.queue-row:first-child { border-top: 0; }
.queue-row:hover { background: var(--slate-50); }
.queue-row:focus-visible { outline: 2px solid var(--brand-500); outline-offset: -2px; }
.queue-row.is-active { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand-600); }
.queue-prio { flex-shrink: 0; width: 76px; }
.queue-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.queue-title { font-weight: 600; color: var(--slate-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-row:hover .queue-title { color: var(--brand-700); }
.queue-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; color: var(--slate-500); }
.queue-wait { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: 12.5px; color: var(--slate-500); white-space: nowrap; }
.queue-wait.is-warning { color: var(--warning-fg); font-weight: 600; }
.queue-wait.is-danger { color: var(--danger-fg); font-weight: 700; }
.queue-actions { flex-shrink: 0; display: flex; gap: 6px; }

/* Drawer pratinjau */
.drawer-overlay { position: fixed; inset: 0; z-index: 1500; background: rgba(15, 23, 42, 0.35); }
.drawer-overlay[hidden] { display: none; }
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1600;
    display: flex;
    flex-direction: column;
    width: min(560px, 100vw);
    background: var(--white);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.25s ease;
}
.drawer.is-open { transform: translateX(0); }
.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-height);
    padding: 0 16px 0 24px;
    border-bottom: 1px solid var(--slate-200);
}
.drawer-title { font-size: 15px; font-weight: 600; color: var(--slate-900); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }
.drawer-loading { padding: 40px 0; text-align: center; color: var(--slate-500); }

.preview-title { margin-bottom: 14px; font-size: 18px; font-weight: 700; line-height: 1.35; color: var(--slate-900); }
.preview-meta { margin-bottom: 18px; border: 1px solid var(--slate-200); border-radius: var(--radius-md); }
.preview-meta > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; padding: 8px 12px; font-size: 13.5px; border-top: 1px solid var(--slate-100); }
.preview-meta > div:first-child { border-top: 0; }
.preview-meta dt { color: var(--slate-500); }
.preview-meta dd { color: var(--slate-900); font-weight: 500; }
.preview-section { margin-bottom: 18px; }
.preview-actions { padding-top: 16px; border-top: 1px solid var(--slate-200); }
.preview-actions form + form, .preview-actions form + details { margin-top: 12px; }

@media (max-width: 768px) {
    .queue-row { flex-wrap: wrap; padding: 12px 16px; gap: 8px 10px; }
    .queue-prio { width: auto; }
    .queue-main { flex-basis: 100%; order: -1; }
    .queue-actions { margin-left: auto; }
    .queue-title { white-space: normal; }
}

/* =====================================================================
   16. CATATAN & DISKUSI TIKET
   ===================================================================== */
.comments-card { scroll-margin-top: calc(var(--topbar-height) + 16px); }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--slate-100); scroll-margin-top: calc(var(--topbar-height) + 16px); }
.comment:first-child { padding-top: 0; }
.avatar-sm { width: 34px; height: 34px; font-size: 12px; background: var(--slate-200); color: var(--slate-700); }
.avatar-team { background: var(--brand-100); color: var(--brand-800); }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.comment-time { font-size: 12px; color: var(--slate-500); }
.comment-delete { margin-left: auto; }
.comment-delete .btn { padding: 4px 6px; color: var(--slate-400); }
.comment-delete .btn:hover { color: var(--danger); background: var(--danger-bg); }
.comment-text {
    margin-top: 6px;
    padding: 10px 14px;
    border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    font-size: 14px;
    line-height: 1.6;
    color: var(--slate-800);
    white-space: pre-wrap;
    word-break: break-word;
}
.comment.is-team .comment-text { background: var(--brand-50); border-color: var(--brand-100); }
.comment-files { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 8px; }
.comment-thumb { display: block; width: 110px; height: 80px; overflow: hidden; border: 1px solid var(--slate-200); border-radius: var(--radius-md); }
.comment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.comment-thumb:hover { border-color: var(--brand-300); }
.comment-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 280px;
    padding: 6px 10px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--slate-700);
}
.comment-file:hover { border-color: var(--brand-300); background: var(--brand-50); }
.comments-empty { padding: 4px 0 16px; font-size: 13.5px; color: var(--slate-500); }
.comment-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--slate-200); }
.comment-form textarea { min-height: 84px; }
.comment-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.comment-form-foot .file-picker { flex: 1; min-width: 200px; }
.comment-count { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--info-fg); }

/* ==========================================================================
   17. Daftar Tiket: penanda tiket yang menunggu tindakan admin/developer
   ========================================================================== */
.action-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
    margin-bottom: 16px; padding: 12px 16px;
    background: var(--warning-bg); border: 1px solid var(--warning-border); border-left: 4px solid var(--warning);
    border-radius: var(--radius-lg);
}
.action-banner-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.action-banner-icon {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 32px; height: 32px; border-radius: var(--radius-full); background: #fef3c7; color: var(--warning-fg);
}
.action-banner-title { font-weight: 600; color: var(--warning-fg); }
.action-banner-sub { font-size: 12.5px; color: var(--slate-600); }
.action-banner-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.action-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
    font-size: 12.5px; color: var(--slate-700); text-decoration: none;
    background: #fff; border: 1px solid var(--warning-border); border-radius: var(--radius-full);
    transition: border-color .15s, box-shadow .15s;
}
.action-chip:hover { border-color: var(--warning); box-shadow: 0 1px 2px rgba(0,0,0,.06); text-decoration: none; }
.action-chip strong { color: var(--warning-fg); }

.table-tickets tr.needs-action td { background: #fffbeb; }
.table-tickets tr.needs-action td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.table-tickets tr.needs-action:hover td { background: #fef3c7; }
.inline-form { display: inline; margin: 0; }

@media (max-width: 768px) {
    .action-banner-chips { width: 100%; }
    .table-tickets tr.needs-action { background: #fffbeb; box-shadow: inset 3px 0 0 var(--warning); }
    .table-tickets tr.needs-action td,
    .table-tickets tr.needs-action td:first-child,
    .table-tickets tr.needs-action:hover td { background: transparent; box-shadow: none; }
    .table-tickets tr.needs-action td:nth-child(7) { display: block; order: 6; flex-basis: 100%; text-align: left; }
}
.status-since { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 12px; color: var(--slate-500); white-space: nowrap; }
.status-since .icon-xs { color: var(--slate-400); }

/* ==========================================================================
   18. Lonceng notifikasi (topbar)
   ========================================================================== */
.notif { position: relative; margin-left: auto; }
.topbar-title + .notif { margin-left: 0; }
.notif-btn {
    position: relative; display: grid; place-items: center; width: 40px; height: 40px;
    border-radius: var(--radius-full); color: var(--slate-500); cursor: pointer; list-style: none;
    transition: background var(--transition), color var(--transition);
}
.notif-btn::-webkit-details-marker { display: none; }
.notif-btn:hover, .notif[open] .notif-btn { background: var(--slate-100); color: var(--slate-800); }
.notif-btn svg { width: 22px; height: 22px; }
.notif-dot {
    position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
    display: grid; place-items: center; border-radius: var(--radius-full); border: 2px solid #fff;
    background: var(--danger, #dc2626); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1;
}
.notif-panel {
    position: absolute; top: calc(100% + 8px); right: -8px; width: 380px; max-width: calc(100vw - 24px);
    max-height: min(520px, calc(100vh - 90px)); overflow-y: auto;
    background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(15, 23, 42, .14); z-index: 950;
}
.notif-head {
    position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--slate-200);
}
.notif-head-title { font-weight: 600; color: var(--slate-900); }
.notif-head form { margin: 0; }
.notif-readall { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--brand-700); cursor: pointer; }
.notif-readall:hover { text-decoration: underline; }
.notif-item {
    display: flex; gap: 12px; padding: 12px 16px; color: var(--slate-700); text-decoration: none;
    border-bottom: 1px solid var(--slate-100);
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--slate-50); text-decoration: none; color: var(--slate-800); }
.notif-item.is-unread { background: var(--brand-50); }
.notif-item.is-unread:hover { background: var(--brand-100); }
.notif-icon {
    flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-full);
    background: var(--brand-100); color: var(--brand-700);
}
.notif-icon.is-comment,
.notif-icon.is-info    { background: var(--info-bg); color: var(--info-fg); }
.notif-icon.is-success { background: var(--success-bg, #f0fdf4); color: var(--success-fg, #166534); }
.notif-icon.is-danger  { background: var(--danger-bg); color: var(--danger-fg); }
.notif-icon.is-warning { background: var(--warning-bg); color: var(--warning-fg); }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--slate-800); }
.notif-item.is-unread .notif-title::after {
    content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 6px; vertical-align: middle;
    border-radius: var(--radius-full); background: var(--brand-600);
}
.notif-text { font-size: 12.5px; color: var(--slate-600); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-time { font-size: 11.5px; color: var(--slate-400); }
.notif-empty { padding: 32px 16px; text-align: center; color: var(--slate-400); font-size: 13px; }
.notif-empty svg { width: 28px; height: 28px; margin: 0 auto 6px; }
.notif-empty p { margin: 0; }

@media (max-width: 768px) {
    .notif { position: static; }
    .notif-panel { position: fixed; top: calc(var(--topbar-height) + 6px); left: 12px; right: 12px; width: auto; max-width: none; }
}

/* ==========================================================================
   19. Halaman error mandiri (mis. 413 file terlalu besar)
   ========================================================================== */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--slate-50); }
.error-card {
    width: 100%; max-width: 520px; padding: 32px; text-align: center;
    background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.error-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 16px; border-radius: var(--radius-full); background: var(--warning-bg); color: var(--warning-fg); }
.error-icon svg { width: 28px; height: 28px; }
.error-code { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--warning-fg); }
.error-title { margin: 0 0 10px; font-size: 20px; font-weight: 700; color: var(--slate-900); }
.error-text { margin: 0 0 16px; color: var(--slate-600); line-height: 1.6; }
.error-tips { margin: 0 0 24px; padding: 12px 16px 12px 32px; text-align: left; font-size: 13px; color: var(--slate-600); background: var(--slate-50); border-radius: var(--radius-md, 8px); }
.error-tips li + li { margin-top: 4px; }
.error-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.error-text strong { white-space: nowrap; }

/* ==========================================================================
   20. Diskusi tiket bergaya chat (menimpa gaya dasar di bagian 16)
   ========================================================================== */
.chat-card { border-color: var(--brand-200, #99e0d6); box-shadow: 0 0 0 3px var(--brand-50); overflow: hidden; }
.chat-header { align-items: flex-start; flex-wrap: nowrap; gap: 12px; background: var(--brand-50); border-bottom-color: var(--brand-100); }
.chat-header .card-title { color: var(--brand-800); }
.chat-subtitle { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--slate-600); max-width: 640px; }

.chat-thread {
    display: flex; flex-direction: column; gap: 14px;
    max-height: 560px; overflow-y: auto; padding: 20px;
    background: var(--slate-50);
}
.chat-msg { max-width: 82%; padding: 0; border: 0; gap: 10px; }
.chat-msg:first-child { padding-top: 0; }
.chat-msg .comment-text { margin-top: 4px; background: #fff; border-color: var(--slate-200); box-shadow: 0 1px 1px rgba(15, 23, 42, .04); }
.chat-msg.is-team .comment-text { background: var(--brand-50); border-color: var(--brand-100); }
.chat-msg .comment-head { gap: 4px 6px; }
.chat-msg .comment-delete { margin-left: 0; opacity: 0; transition: opacity .15s; }
.chat-msg:hover .comment-delete, .chat-msg .comment-delete:focus-within { opacity: 1; }

/* Pesan sendiri: di kanan, gelembung warna brand */
.chat-msg.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.is-mine .comment-head { flex-direction: row-reverse; }
.chat-msg.is-mine .comment-text {
    background: var(--brand-600); border-color: var(--brand-600); color: #fff;
    border-radius: var(--radius-lg) 4px var(--radius-lg) var(--radius-lg);
}
.chat-msg.is-mine .comment-files { justify-content: flex-end; }

.chat-empty { margin: auto; padding: 24px 12px; max-width: 460px; text-align: center; font-size: 13.5px; color: var(--slate-500); }
.chat-empty p { margin: 0; }
.chat-empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 10px; border-radius: var(--radius-full); background: var(--brand-100); color: var(--brand-700); }
.chat-empty-icon svg { width: 24px; height: 24px; }
.chat-empty-title { font-size: 15px; font-weight: 600; color: var(--slate-800); margin-bottom: 4px !important; }

.chat-composer { margin: 0; padding: 14px 20px 16px; border-top: 1px solid var(--slate-200); background: #fff; }
.chat-composer textarea { min-height: 64px; resize: vertical; }
.chat-composer textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.chat-hint { font-size: 12px; color: var(--slate-400); white-space: nowrap; }

.btn-discuss .discuss-count {
    display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 2px;
    border-radius: var(--radius-full); background: var(--brand-600); color: #fff; font-size: 11.5px; font-weight: 700;
}

@media (max-width: 768px) {
    .chat-thread { padding: 14px; max-height: 70vh; }
    .chat-msg { max-width: 100%; }
    .chat-composer { padding: 12px 14px 14px; }
    .chat-hint { display: none; }
}

/* Update Info: verifikasi massal */
.bulk-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
    margin: 0; padding: 10px 20px; background: var(--success-bg); border-bottom: 1px solid var(--success-border);
}
.bulk-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--slate-800); cursor: pointer; }
.unit-table .col-check { width: 44px; padding-right: 0; text-align: center; }
.unit-table .col-check input { cursor: pointer; }
.unit-table tr.is-selected td { background: var(--success-bg); }
.chat-header > .badge { flex-shrink: 0; }
