/* ── Idle row indicator ────────────────────────────────────────────── */
/* Animasi pulse untuk icon hourglass pada badge iddle */
@keyframes iddlePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.55; transform: scale(0.88); }
}

/* Row highlight — light mode */
.data-table tbody tr[data-in-idle="1"] {
    background-color: rgba(255, 193, 7, 0.08) !important;
    box-shadow: inset 4px 0 0 #f59e0b; /* left border accent */
}

.data-table tbody tr[data-in-idle="1"]:hover {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

/* Sticky action cell harus ikut warna baris idle (override) */
.data-table tbody tr[data-in-idle="1"] td.sticky-action {
    background-color: rgba(255, 243, 205, 0.95) !important;
}

.data-table tbody tr[data-in-idle="1"]:hover td.sticky-action {
    background-color: rgba(255, 236, 170, 0.95) !important;
}

/* Pulse pada ikon hourglass di dalam badge iddle */
.status-iddle i {
    animation: iddlePulse 1.6s ease-in-out infinite;
    display: inline-block;
}

.status-bind-wait i {
    animation: iddlePulse 1.6s ease-in-out infinite;
    display: inline-block;
}

.data-table tbody tr[data-in-bind="1"] {
    background-color: rgba(59, 130, 246, 0.08) !important;
    box-shadow: inset 4px 0 0 #3b82f6;
}

.data-table tbody tr[data-in-bind="1"]:hover {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

.data-table tbody tr[data-in-bind="1"] td.sticky-action {
    background-color: rgba(219, 234, 254, 0.95) !important;
}

.data-table tbody tr[data-in-bind="1"]:hover td.sticky-action {
    background-color: rgba(191, 219, 254, 0.95) !important;
}

/* Row highlight — dark mode */
[data-theme="dark"] .data-table tbody tr[data-in-idle="1"] {
    background-color: rgba(245, 158, 11, 0.10) !important;
    box-shadow: inset 4px 0 0 #d97706;
}

[data-theme="dark"] .data-table tbody tr[data-in-idle="1"]:hover {
    background-color: rgba(245, 158, 11, 0.18) !important;
}

[data-theme="dark"] .data-table tbody tr[data-in-idle="1"] td.sticky-action {
    background-color: rgba(40, 30, 5, 0.95) !important;
}

[data-theme="dark"] .data-table tbody tr[data-in-idle="1"]:hover td.sticky-action {
    background-color: rgba(60, 45, 10, 0.95) !important;
}

[data-theme="dark"] .data-table tbody tr[data-in-bind="1"] {
    background-color: rgba(59, 130, 246, 0.12) !important;
    box-shadow: inset 4px 0 0 #60a5fa;
}

[data-theme="dark"] .data-table tbody tr[data-in-bind="1"]:hover {
    background-color: rgba(59, 130, 246, 0.20) !important;
}

[data-theme="dark"] .data-table tbody tr[data-in-bind="1"] td.sticky-action {
    background-color: rgba(16, 28, 46, 0.95) !important;
}

[data-theme="dark"] .data-table tbody tr[data-in-bind="1"]:hover td.sticky-action {
    background-color: rgba(22, 38, 64, 0.95) !important;
}

/* ──────────────────────────────────────────────────────────────────────
 * Baris lisensi UnlockTool expired — service tidak bisa dikonsumsi lagi.
 *
 * Sengaja ditempatkan SETELAH highlight idle/bind: baris expired bisa juga
 * berstatus idle/bind, dan penanda "tidak bisa dipakai" harus menang.
 * Teks dipaksa terang supaya tetap terbaca di atas latar gelap pada kedua tema.
 * ────────────────────────────────────────────────────────────────────── */
.data-table tbody tr.row-license-expired {
    background-color: #2b3038 !important;
    box-shadow: inset 4px 0 0 #6b7280;
    opacity: 0.92;
}

.data-table tbody tr.row-license-expired:hover {
    background-color: #363c46 !important;
    opacity: 1;
}

.data-table tbody tr.row-license-expired td,
.data-table tbody tr.row-license-expired td .editor-value,
.data-table tbody tr.row-license-expired td .service-cell-value {
    color: #e5e7eb !important;
    border-color: #4b5563;
}

.data-table tbody tr.row-license-expired td.sticky-action {
    background-color: #2b3038 !important;
}

.data-table tbody tr.row-license-expired:hover td.sticky-action {
    background-color: #363c46 !important;
}

/* Badge pengganti countdown pada kolom Expired Date (UT) saat lisensi habis */
.badge-license-expired {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.45);
}
/* ──────────────────────────────────────────────────────────────────── */

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-item {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.notification-date {
    font-size: 12px;
    color: var(--secondary-color);
    white-space: nowrap;
}

.notification-message {
    font-size: 14px;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--secondary-color);
    gap: 10px;
    flex-wrap: wrap;
}

.notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.notification-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.notification-item.unread {
    border-color: #8ec5ff;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.2);
}

.notification-item.unread .notification-header strong {
    color: var(--primary-color);
}

.unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e74c3c;
    margin-right: 6px;
}

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

/* Admin Dropdown Menu */
.admin-menu-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-menu-toggle:hover {
    background: var(--table-hover);
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.admin-menu-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.admin-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    will-change: transform, opacity;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.admin-dropdown.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    animation: dropdownIn 0.2s ease;
}

/* When JS switches to fixed positioning, ensure consistent sizing */
.admin-dropdown[style] {
    min-width: 200px;
}

.balance-indicator {
    margin-top: 0;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.18), rgba(52, 152, 219, 0.18));
    color: var(--text-color);
    border: 1px solid rgba(52, 152, 219, 0.35);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.balance-base-note {
    display: block;
    font-size: 11px;
    color: var(--secondary-color);
    margin-top: 4px;
}

.balance-indicator:hover {
    background: var(--table-hover);
}

.balance-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.15);
}

.dropdown-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    color: var(--text-color);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.dropdown-item:hover {
    background: var(--table-hover);
}

.dropdown-item.danger {
    color: var(--danger-color);
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.12);
}

[data-theme="dark"] .dropdown-item.danger:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* Floating Header Button */
.floating-header-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.floating-header-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.header-action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
    margin-left: 4px;
}

/* Theme switcher (5 options) */
.theme-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.theme-switcher-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--border-color);
    box-shadow: var(--shadow);
}

[data-theme="dark"] .theme-switcher-btn {
    background: rgba(17, 24, 39, 0.9);
}

.theme-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 1200;
    /* [UI FIX] Prevent menu from going off-screen on small viewports */
    max-height: min(60vh, 320px);
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    will-change: transform, opacity;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-menu.active {
    display: flex;
}

.theme-menu.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    animation: dropdownIn 0.2s ease;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    background: transparent;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-color);
    text-align: left;
    transition: background var(--ui-duration) var(--ui-ease), border-color var(--ui-duration) var(--ui-ease), transform var(--ui-duration) var(--ui-ease);
}
