/* ============================================================
   SimpleCare — Global Stylesheet v2.0
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:       #2563eb;
    --primary-dark:  #1d4ed8;
    --primary-light: #eff6ff;
    --success:       #16a34a;
    --danger:        #dc2626;
    --warning:       #d97706;
    --info:          #0891b2;
    --gray-50:       #f9fafb;
    --gray-100:      #f3f4f6;
    --gray-200:      #e5e7eb;
    --gray-300:      #d1d5db;
    --gray-500:      #6b7280;
    --gray-700:      #374151;
    --gray-900:      #111827;
    --white:         #ffffff;
    --sidebar-w:     248px;
    --sidebar-bg:    #0f172a;
    --sidebar-hover: rgba(255,255,255,.06);
    --sidebar-active:#2563eb;
    --header-h:      56px;
    --radius:        6px;
    --shadow:        0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
    --transition:    .2s ease;
}

html { font-size: 14px; }
body {
    font-family: var(--font);
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ───────────────────────────────────────────────── */
.layout     { display: flex; min-height: 100vh; }
.main-wrap  { margin-left: var(--sidebar-w); flex: 1; display: flex;
              flex-direction: column; min-height: 100vh;
              transition: margin-left var(--transition); }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition), width var(--transition);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    height: var(--header-h);
    border-bottom: 1px solid rgba(255,255,255,.07);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: .3px;
    flex-shrink: 0;
}
.sidebar-brand i { color: #60a5fa; font-size: 1.2rem; }

/* Nav wrapper */
.sidebar-nav { flex: 1; padding: 10px 0; }

/* ── Nav Item (menu tanpa sub menu) ───────────────────────── */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: #94a3b8;
    font-size: .875rem;
    border-radius: 0;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--white); text-decoration: none; }
.nav-item.active { background: var(--sidebar-active); color: var(--white); }

.nav-icon { width: 16px; text-align: center; font-size: .85rem; flex-shrink: 0; }

/* ── Nav Group (menu dengan sub menu) ─────────────────────── */
.nav-group { }

/* Toggle button (header grup) */
.nav-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: #94a3b8;
    font-size: .875rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.nav-toggle:hover { background: var(--sidebar-hover); color: var(--white); }
.nav-toggle span  { flex: 1; }

/* Arrow icon */
.nav-arrow {
    font-size: .65rem;
    transition: transform var(--transition);
    color: #64748b;
    flex-shrink: 0;
}
.nav-group.open .nav-arrow { transform: rotate(180deg); }
.nav-group.open .nav-toggle { color: var(--white); }

/* Sub menu container */
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    background: rgba(0,0,0,.2);
}
/* max-height saat open dihandle oleh JS (scrollHeight otomatis) */

/* Sub menu item */
.nav-subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px 8px 46px;
    color: #64748b;
    font-size: .845rem;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}
.nav-subitem:hover  { background: var(--sidebar-hover); color: #cbd5e1; text-decoration: none; }
.nav-subitem.active { color: #60a5fa; background: rgba(37,99,235,.15); }
.nav-subitem.active .nav-sub-icon { color: #60a5fa; }

.nav-sub-icon { font-size: .45rem; flex-shrink: 0; }

/* Sidebar footer */
.sidebar-footer {
    padding: 12px 20px;
    font-size: .72rem;
    color: #334155;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.topbar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    padding: 6px 8px;
    border-radius: var(--radius);
    font-size: .95rem;
    line-height: 1;
    transition: background var(--transition), color var(--transition);
}
.topbar-toggle:hover { background: var(--gray-100); color: var(--gray-900); }

.topbar-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--gray-700);
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: .82rem;
    color: var(--gray-500);
}
.topbar-right i   { margin-right: 5px; }
.topbar-divider   { width: 1px; height: 18px; background: var(--gray-200); }
.topbar-user      { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--gray-700); }

/* Sidebar collapsed state */
.sidebar-collapsed .sidebar     { width: 56px; }
.sidebar-collapsed .main-wrap   { margin-left: 56px; }
.sidebar-collapsed .sidebar-brand span,
.sidebar-collapsed .nav-item span,
.sidebar-collapsed .nav-toggle span,
.sidebar-collapsed .nav-arrow,
.sidebar-collapsed .nav-sub-icon,
.sidebar-collapsed .nav-subitem,
.sidebar-collapsed .sidebar-footer span { display: none; }
.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }
.sidebar-collapsed .nav-item,
.sidebar-collapsed .nav-toggle   { justify-content: center; padding: 10px 0; }
.sidebar-collapsed .nav-submenu  { display: none; }
.sidebar-collapsed .sidebar-footer { justify-content: center; }

/* ── Page Content ─────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

/* ── Page Header ─────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between;
               margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 1.2rem; font-weight: 700; color: var(--gray-900); }
.breadcrumb     { font-size: .78rem; color: var(--gray-500); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.breadcrumb a   { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb i   { font-size: .6rem; }

/* ── Card ─────────────────────────────────────────────────── */
.card        { background: var(--white); border-radius: var(--radius);
               box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--gray-100);
               display: flex; align-items: center; justify-content: space-between;
               gap: 12px; flex-wrap: wrap; }
.card-title  { font-size: .9rem; font-weight: 600; color: var(--gray-700); display: flex; align-items: center; gap: 8px; }
.card-body   { padding: 20px; }

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
              gap: 16px; margin-bottom: 24px; }
.stat-card  { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
              padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: .75rem; color: var(--gray-500); text-transform: uppercase;
              letter-spacing: .5px; font-weight: 600; }
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--gray-900); line-height: 1.1; }
.stat-card.blue  { border-left: 3px solid var(--primary); }
.stat-card.green { border-left: 3px solid var(--success); }
.stat-card.amber { border-left: 3px solid var(--warning); }
.stat-card.cyan  { border-left: 3px solid var(--info); }
.stat-card.purple{ border-left: 3px solid #7c3aed; }

/* ── Table ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table     { width: 100%; border-collapse: collapse; font-size: .865rem; }
thead tr  { background: var(--gray-50); }
th        { padding: 10px 14px; text-align: left; font-weight: 600; color: var(--gray-700);
            border-bottom: 2px solid var(--gray-200); white-space: nowrap; font-size: .82rem; }
td        { padding: 10px 14px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }
.col-no   { width: 50px; }
.col-action { width: 100px; }

/* ── Badge ────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
         border-radius: 99px; font-size: .73rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #e0f2fe; color: #0369a1; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-purple  { background: #f3e8ff; color: #6d28d9; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px;
       border-radius: var(--radius); border: 1px solid transparent;
       font-size: .855rem; font-weight: 500; cursor: pointer;
       transition: background var(--transition), border-color var(--transition), opacity var(--transition);
       line-height: 1.4; white-space: nowrap; text-decoration: none; font-family: var(--font); }
.btn:hover { opacity: .88; text-decoration: none; }
.btn i     { font-size: .8rem; }

.btn-primary   { background: var(--primary);  color: var(--white);  border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); opacity: 1; }
.btn-success   { background: var(--success);  color: var(--white);  border-color: var(--success); }
.btn-danger    { background: var(--danger);   color: var(--white);  border-color: var(--danger); }
.btn-warning   { background: var(--warning);  color: var(--white);  border-color: var(--warning); }
.btn-secondary { background: var(--white);    color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); opacity: 1; }
.btn-sm  { padding: 4px 12px; font-size: .8rem; }
.btn-icon{ padding: 5px 7px; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group   { margin-bottom: 18px; }
.form-row     { display: grid; gap: 16px; }
.form-row.col-2 { grid-template-columns: 1fr 1fr; }
.form-row.col-3 { grid-template-columns: 1fr 1fr 1fr; }

label { display: block; font-size: .845rem; font-weight: 600;
        color: var(--gray-700); margin-bottom: 5px; }
label .req { color: var(--danger); margin-left: 2px; }

input[type=text], input[type=number], input[type=email], input[type=password],
textarea, select {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--gray-300); border-radius: var(--radius);
    font-size: .875rem; color: var(--gray-900);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: var(--font);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: .775rem; color: var(--gray-500); margin-top: 4px; }

/* Toggle */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--gray-300);
                 border-radius: 99px; cursor: pointer; transition: background var(--transition); }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px;
                          border-radius: 50%; background: var(--white); top: 3px; left: 3px;
                          transition: transform var(--transition); }
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 11px 16px;
         border-radius: var(--radius); font-size: .875rem;
         border-left: 3px solid transparent; margin-bottom: 16px; }
.alert i:first-child { margin-top: 1px; flex-shrink: 0; }
.alert span { flex: 1; }
.alert-success { background: #f0fdf4; border-color: var(--success); color: #166534; }
.alert-danger  { background: #fef2f2; border-color: var(--danger);  color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: var(--warning); color: #92400e; }
.alert-info    { background: #f0f9ff; border-color: var(--info);    color: #0c4a6e; }
.alert-close   { background: none; border: none; cursor: pointer; opacity: .5; padding: 0 4px;
                 margin-left: auto; line-height: 1; font-size: .85rem; }
.alert-close:hover { opacity: 1; }

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-wrap { position: relative; }
.search-wrap input { padding-left: 32px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
               color: var(--gray-400, #9ca3af); pointer-events: none; font-size: .78rem; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-500); }
.empty-state i   { font-size: 2.5rem; color: var(--gray-300); display: block; margin-bottom: 12px; }
.empty-state h3  { font-size: 1rem; color: var(--gray-700); margin-bottom: 6px; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45);
                  z-index: 200; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal         { background: var(--white); border-radius: 8px; box-shadow: var(--shadow-md);
                 width: 100%; max-width: 440px; animation: modalIn .15s ease; }
.modal-header  { padding: 15px 20px; border-bottom: 1px solid var(--gray-100);
                 display: flex; align-items: center; justify-content: space-between; }
.modal-title   { font-weight: 600; font-size: .92rem; display: flex; align-items: center; gap: 8px; }
.modal-close   { background: none; border: none; cursor: pointer; color: var(--gray-500);
                 padding: 4px 6px; border-radius: 4px; font-size: .85rem; }
.modal-close:hover { background: var(--gray-100); }
.modal-body    { padding: 20px; font-size: .875rem; color: var(--gray-700); line-height: 1.6; }
.modal-footer  { padding: 12px 20px; border-top: 1px solid var(--gray-100);
                 display: flex; justify-content: flex-end; gap: 8px; }
@keyframes modalIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Utility ─────────────────────────────────────────────── */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--gray-500); }
.text-small  { font-size: .8rem; }
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.gap-1       { gap: 8px; }
.gap-2       { gap: 16px; }
.ms-auto     { margin-left: auto; }
.mt-1        { margin-top: 8px; }
.mt-2        { margin-top: 16px; }
.mt-3        { margin-top: 24px; }
.mb-1        { margin-bottom: 8px; }
.mb-2        { margin-bottom: 16px; }
.fw-bold     { font-weight: 700; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar   { transform: translateX(calc(-1 * var(--sidebar-w))); }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-wrap { margin-left: 0 !important; }
    .form-row.col-2, .form-row.col-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .topbar-date { display: none; }
    .topbar-divider { display: none; }
}

/* ── Table Footer (pagination + load time) ───────────────── */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    font-size: .8rem;
}

.table-info { color: var(--gray-500); }
.table-info strong { color: var(--gray-700); }

/* Load time */
.load-time {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--gray-400, #9ca3af);
    font-size: .75rem;
    font-style: italic;
}
.load-time i { font-size: .72rem; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    font-size: .8rem;
    color: var(--gray-700);
    background: var(--white);
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition);
    cursor: pointer;
}
.page-btn:hover       { background: var(--primary-light); border-color: var(--primary);
                        color: var(--primary); text-decoration: none; }
.page-btn.active      { background: var(--primary); border-color: var(--primary);
                        color: var(--white); font-weight: 600; pointer-events: none; }
.page-btn.disabled    { color: var(--gray-300); pointer-events: none;
                        background: var(--gray-50); }
.page-ellipsis        { padding: 0 4px; color: var(--gray-400, #9ca3af); font-size: .8rem;
                        line-height: 32px; }

/* ── Icon Input (form menu) ───────────────────────────────── */
.icon-input-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.icon-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.icon-preview {
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
}
.icon-input-wrap input {
    border: none;
    border-radius: 0;
    flex: 1;
}
.icon-input-wrap input:focus { box-shadow: none; }

/* Icon suggestions */
.icon-suggestions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.icon-sug-label {
    font-size: .75rem;
    color: var(--gray-500);
    margin-right: 2px;
}
.icon-sug-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-600, #4b5563);
    cursor: pointer;
    font-size: .85rem;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.icon-sug-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* ── URL Input (form sub menu) ───────────────────────────── */
.url-input-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.url-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.url-prefix {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-size: .9rem;
    font-weight: 600;
    flex-shrink: 0;
    user-select: none;
}
.url-input-wrap input {
    border: none;
    border-radius: 0;
    flex: 1;
}
.url-input-wrap input:focus { box-shadow: none; }

/* ── Field Validation Error ──────────────────────────────── */
.input-error {
    border-color: var(--danger) !important;
    background: #fff5f5;
}
.input-error:focus {
    box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important;
}
.input-error-wrap {
    border-color: var(--danger) !important;
}
.input-error-wrap:focus-within {
    box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important;
}
.field-error {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    font-size: .775rem;
    color: var(--danger);
    font-weight: 500;
}
.field-error i { font-size: .72rem; flex-shrink: 0; }

/* ── Audit Info (form edit) ──────────────────────────────── */
.audit-info {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.audit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .8rem;
}
.audit-label {
    color: var(--gray-500);
    min-width: 80px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.audit-label i  { font-size: .72rem; }
.audit-value    { color: var(--gray-700); }
.audit-value strong { color: var(--gray-900); }

/* ── Global Load Time (footer) ───────────────────────────── */
.global-load-time {
    position: fixed;
    bottom: 10px;
    right: 14px;
    font-size: .72rem;
    color: var(--gray-400, #9ca3af);
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    z-index: 99;
}
.global-load-time i { font-size: .68rem; }

/* ── Autocomplete ─────────────────────────────────────────── */
.ac-wrap {
    position: relative;
}
.ac-input-wrap {
    position: relative;
}
.ac-input-wrap input {
    padding-right: 32px;
}
.ac-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400, #9ca3af);
    font-size: .75rem;
    padding: 2px;
    display: none;
    line-height: 1;
}
.ac-clear:hover { color: var(--danger); }
.ac-selected + .ac-clear,
input.ac-selected ~ .ac-clear { display: block; }

.ac-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 150;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.ac-item {
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover,
.ac-item.active { background: var(--primary-light); }

.ac-item-kode {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    color: var(--primary);
    background: #dbeafe;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 6px;
}
.ac-item-nama {
    font-size: .855rem;
    color: var(--gray-900);
}
.ac-item-sub {
    font-size: .75rem;
    color: var(--gray-500);
    margin-top: 3px;
    line-height: 1.4;
}
.ac-loading,
.ac-empty {
    padding: 12px 14px;
    font-size: .82rem;
    color: var(--gray-500);
    text-align: center;
}
.ac-loading i { margin-right: 6px; }

/* Input sudah dipilih */
input.ac-selected {
    border-color: var(--success) !important;
    background: #f0fdf4;
}
input.ac-selected:focus {
    box-shadow: 0 0 0 3px rgba(22,163,74,.12) !important;
}

/* ── Autocomplete v2 — Override & Enhancement ────────────── */
.ac-dropdown {
    border: 2px solid var(--primary) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(37,99,235,.15), 0 2px 8px rgba(0,0,0,.08) !important;
    overflow: hidden;
    animation: acFadeIn .15s ease;
}
@keyframes acFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header dropdown */
.ac-header {
    padding: 8px 14px;
    font-size: .75rem;
    color: var(--white);
    background: var(--primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(255,255,255,.2);
}
.ac-header strong { font-weight: 700; }
.ac-header-error  { background: var(--danger); }

/* Item */
.ac-item {
    padding: 10px 14px !important;
    cursor: pointer !important;
    border-bottom: 1px solid var(--gray-100) !important;
    transition: background .12s, transform .1s !important;
    position: relative;
}
.ac-item:last-of-type { border-bottom: none !important; }
.ac-item:hover,
.ac-item.active {
    background: var(--primary-light) !important;
    transform: translateX(3px);
}

.ac-item-main {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ac-item-kode {
    display: inline-flex !important;
    align-items: center;
    font-size: .7rem !important;
    font-weight: 700 !important;
    color: var(--white) !important;
    background: var(--primary) !important;
    padding: 2px 8px !important;
    border-radius: 99px !important;
    flex-shrink: 0;
    letter-spacing: .3px;
}
.ac-item-nama {
    font-size: .875rem !important;
    color: var(--gray-900) !important;
    flex: 1;
}
.ac-highlight {
    background: #fef08a;
    color: var(--gray-900);
    border-radius: 2px;
    padding: 0 2px;
    font-style: normal;
}
.ac-item-select-hint {
    color: var(--gray-300);
    font-size: .75rem;
    opacity: 0;
    transition: opacity .15s;
    flex-shrink: 0;
}
.ac-item:hover .ac-item-select-hint,
.ac-item.active .ac-item-select-hint { opacity: 1; color: var(--primary); }

.ac-item-sub {
    font-size: .75rem !important;
    color: var(--gray-500) !important;
    margin-top: 4px !important;
    margin-left: 4px;
    line-height: 1.4 !important;
    border-left: 2px solid var(--gray-200);
    padding-left: 8px;
}

/* Footer hint keyboard */
.ac-footer {
    padding: 6px 14px;
    font-size: .7rem;
    color: var(--gray-400, #9ca3af);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Empty state */
.ac-empty {
    padding: 20px 14px !important;
    text-align: center;
    color: var(--gray-400, #9ca3af) !important;
    font-size: .82rem !important;
    line-height: 1.8;
}
.ac-empty i { font-size: 1.5rem; display: block; margin-bottom: 6px; }

/* Loading */
.ac-loading {
    padding: 14px !important;
    text-align: center;
    color: var(--gray-500) !important;
    font-size: .82rem !important;
}

/* ── Autocomplete v3 — Cursor & Active Fix ───────────────── */
.ac-item,
.ac-item * { cursor: pointer !important; }

.ac-item.active {
    background: var(--primary-light) !important;
    border-left: 3px solid var(--primary) !important;
    padding-left: 11px !important;
}
.ac-item.active .ac-item-kode {
    background: var(--primary-dark) !important;
}
.ac-item.active .ac-item-select-hint {
    opacity: 1 !important;
    color: var(--primary) !important;
}
.ac-item-select-hint {
    font-size: .72rem;
    font-weight: 600;
    color: var(--gray-400, #9ca3af);
    opacity: 0;
    transition: opacity .15s;
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}
.ac-item:hover .ac-item-select-hint { opacity: 1; color: var(--primary); }

/* ── Action Menu (kebab ⋮) ───────────────────────────────── */
.action-menu-wrap {
    position: relative;
    display: inline-block;
}

.action-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-500);
    cursor: pointer;
    font-size: .85rem;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    line-height: 1;
}
.action-menu-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-900);
}
.action-menu-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.action-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.08);
    min-width: 160px;
    z-index: 60;
    overflow: hidden;
    animation: actionMenuIn .12s ease;
}
/* Buka ke atas jika row terakhir */
.action-menu-wrap.drop-up .action-menu-dropdown {
    top: auto;
    bottom: calc(100% + 4px);
}

.action-menu-dropdown.open {
    display: block;
}

@keyframes actionMenuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.action-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    font-size: .845rem;
    color: var(--gray-700);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font);
    white-space: nowrap;
}
.action-menu-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
    text-decoration: none;
}
.action-menu-item i {
    font-size: .8rem;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}
.action-menu-item.danger {
    color: var(--danger);
}
.action-menu-item.danger:hover {
    background: #fef2f2;
    color: var(--danger);
}
.action-menu-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 4px 0;
}
