/* Theme System: Light (default) + 4 additional palettes (Dark, Ocean, Emerald, Sunset) */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #1d4ed8;
    --btn-border-dark: #0b3f8a;
    --btn-text-dark: #0b3f8a;
    --secondary-color: #64748b;
    --secondary-dark: #475569;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #0f172a;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 24px rgba(15, 23, 42, 0.14);
    --bg-color: #f1f5f9;
    --text-color: #0f172a;
    --card-bg: #ffffff;
    --table-hover: #f8fafc;
    --table-header-bg: #0f172a;
    --table-header-text: #f8fafc;
    --icon-blue: #3b82f6;
    --icon-green: #22c55e;
    --icon-red: #ef4444;
    --icon-orange: #f59e0b;
    --icon-purple: #8b5cf6;
    --icon-teal: #14b8a6;
    --icon-gold: #fbbf24;
    --icon-gray: #64748b;
    --login-gradient-start: #93c5fd;
    --login-gradient-end: #c4b5fd;
    --login-card-bg: #ffffff;
    --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.35);
    --ui-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --ui-duration: 220ms;
}

/* Theme: Dark */
[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-dark: #3b82f6;
    --secondary-color: #94a3b8;
    --secondary-dark: #64748b;
    --success-color: #22c55e;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --dark-color: #e2e8f0;
    --light-color: #0f172a;
    --border-color: #1f2937;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.6);
    --bg-color: #0b1220;
    --text-color: #e2e8f0;
    --card-bg: #111827;
    --table-hover: #1f2937;
    --table-header-bg: #1f2937;
    --table-header-text: #f8fafc;
    --icon-blue: #60a5fa;
    --icon-green: #22c55e;
    --icon-red: #f87171;
    --icon-orange: #fbbf24;
    --icon-purple: #c4b5fd;
    --icon-teal: #2dd4bf;
    --icon-gold: #fde047;
    --icon-gray: #94a3b8;
    --login-gradient-start: #0f172a;
    --login-gradient-end: #1e293b;
    --login-card-bg: #0f172a;
    --focus-ring: 0 0 0 3px rgba(96, 165, 250, 0.45);
}

/* Theme: Ocean */
[data-theme="ocean"] {
    --primary-color: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary-color: #0f766e;
    --secondary-dark: #0f6b64;
    --success-color: #22c55e;
    --danger-color: #f97316;
    --warning-color: #fbbf24;
    --dark-color: #0f172a;
    --light-color: #e0f2fe;
    --border-color: #cbd5e1;
    --shadow: 0 6px 16px rgba(14, 116, 144, 0.12);
    --shadow-lg: 0 16px 30px rgba(14, 116, 144, 0.18);
    --bg-color: #e0f2fe;
    --text-color: #0f172a;
    --card-bg: #ffffff;
    --table-hover: #f0f9ff;
    --table-header-bg: #0f172a;
    --table-header-text: #f8fafc;
    --icon-blue: #0ea5e9;
    --icon-green: #22c55e;
    --icon-red: #f97316;
    --icon-orange: #f59e0b;
    --icon-purple: #6366f1;
    --icon-teal: #0f766e;
    --icon-gold: #facc15;
    --icon-gray: #64748b;
    --login-gradient-start: #bae6fd;
    --login-gradient-end: #99f6e4;
    --login-card-bg: #ffffff;
    --focus-ring: 0 0 0 3px rgba(14, 165, 233, 0.35);
}

/* Theme: Emerald */
[data-theme="emerald"] {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --secondary-color: #475569;
    --secondary-dark: #334155;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #0f172a;
    --light-color: #ecfdf5;
    --border-color: #d1fae5;
    --shadow: 0 8px 16px rgba(16, 185, 129, 0.12);
    --shadow-lg: 0 20px 34px rgba(16, 185, 129, 0.18);
    --bg-color: #ecfdf5;
    --text-color: #0f172a;
    --card-bg: #ffffff;
    --table-hover: #f0fdf4;
    --table-header-bg: #0f172a;
    --table-header-text: #f8fafc;
    --icon-blue: #14b8a6;
    --icon-green: #10b981;
    --icon-red: #ef4444;
    --icon-orange: #f59e0b;
    --icon-purple: #8b5cf6;
    --icon-teal: #0f766e;
    --icon-gold: #facc15;
    --icon-gray: #64748b;
    --login-gradient-start: #bbf7d0;
    --login-gradient-end: #a7f3d0;
    --login-card-bg: #ffffff;
    --focus-ring: 0 0 0 3px rgba(16, 185, 129, 0.35);
}

/* Theme: Sunset */
[data-theme="sunset"] {
    --primary-color: #f97316;
    --primary-dark: #ea580c;
    --secondary-color: #7c3aed;
    --secondary-dark: #6d28d9;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #fff7ed;
    --border-color: #fed7aa;
    --shadow: 0 8px 18px rgba(249, 115, 22, 0.14);
    --shadow-lg: 0 22px 36px rgba(249, 115, 22, 0.2);
    --bg-color: #fff7ed;
    --text-color: #1f2937;
    --card-bg: #ffffff;
    --table-hover: #ffedd5;
    --table-header-bg: #1f2937;
    --table-header-text: #fef3c7;
    --icon-blue: #3b82f6;
    --icon-green: #22c55e;
    --icon-red: #ef4444;
    --icon-orange: #f97316;
    --icon-purple: #8b5cf6;
    --icon-teal: #14b8a6;
    --icon-gold: #fbbf24;
    --icon-gray: #64748b;
    --login-gradient-start: #fdba74;
    --login-gradient-end: #f472b6;
    --login-card-bg: #ffffff;
    --focus-ring: 0 0 0 3px rgba(249, 115, 22, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--ui-duration) var(--ui-ease), color var(--ui-duration) var(--ui-ease);
}

/* Smooth theme transitions for key surfaces */
.header,
.card,
.modal-content,
.table-container,
.notification-item,
.login-box,
.admin-dropdown,
.column-selector {
    transition: background-color var(--ui-duration) var(--ui-ease), color var(--ui-duration) var(--ui-ease), border-color var(--ui-duration) var(--ui-ease), box-shadow var(--ui-duration) var(--ui-ease);
}

/* [CONTEXT 2] Rekap Jam Pemakaian Service (Modal) */
.usage-hourly-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.usage-hourly-summary-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.usage-hourly-summary-card .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-color);
    margin-bottom: 6px;
}

.usage-hourly-summary-card .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.usage-hourly-summary-card .sub {
    font-size: 12px;
    color: var(--secondary-color);
    margin-top: 4px;
}

.usage-hourly-chart {
    display: grid;
    grid-template-columns: repeat(24, minmax(18px, 1fr));
    gap: 6px;
    align-items: end;
    padding: 16px 10px 12px;
    background: var(--light-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    min-height: 220px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.usage-hourly-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-width: 18px;
    height: 100%;
    gap: 4px;
}

.usage-hourly-bar-fill {
    width: 100%;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    transition: height var(--ui-duration) var(--ui-ease);
}

.usage-hourly-bar-count {
    font-size: 10px;
    color: var(--text-color);
    font-weight: 600;
}

.usage-hourly-bar-label {
    font-size: 10px;
    color: var(--secondary-color);
    transform: rotate(-35deg);
    white-space: nowrap;
}

.usage-hourly-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.usage-hourly-list {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 12px 16px;
}

.usage-hourly-list h3 {
    font-size: 14px;
    margin-bottom: 10px;
}

.usage-hourly-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.usage-hourly-list li {
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-color);
    color: var(--text-color);
}

.usage-hourly-list li:last-child {
    border-bottom: none;
}

.usage-hourly-loading {
    text-align: center;
    color: var(--secondary-color);
    font-size: 14px;
    padding: 20px 0;
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-force-motion="true"]) * {
        transition-duration: 1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Login Page */
body.login-page {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--login-gradient-start) 0%, var(--login-gradient-end) 100%);
    position: relative;
    overflow: hidden;
}

/* Abstract background shapes */
body.login-page::before,
body.login-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.6;
}

body.login-page::before {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    left: -100px;
    opacity: 0.4;
}

body.login-page::after {
    width: 300px;
    height: 300px;
    background: var(--secondary-color);
    bottom: -50px;
    right: -50px;
    opacity: 0.3;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    z-index: 1;
    position: relative;
}

.login-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .login-card {
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(17, 24, 39, 0.85);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-circle {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
    color: white;
    font-size: 28px;
    transition: transform 0.3s ease;
}

.logo-circle:hover {
    transform: scale(1.05) rotate(5deg);
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--secondary-color);
    font-size: 14px;
    margin: 0;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--secondary-color);
    pointer-events: none;
    transition: color 0.2s;
    z-index: 2;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--text-color);
    transition: all 0.2s ease;
    outline: none;
}

.login-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: var(--card-bg);
}

.login-form input:focus+.input-icon,
.login-form input:focus+.toggle-password i,
.input-group:focus-within .input-icon {
    color: var(--primary-color);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--text-color);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--secondary-color);
    user-select: none;
}

.remember-me input {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.btn-block {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

.btn-block:active {
    transform: translateY(0);
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: start;
    gap: 10px;
    line-height: 1.5;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    color: var(--secondary-color);
    font-size: 12px;
    opacity: 0.8;
}

/* Header */
.header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 12px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header h1 {
    color: var(--dark-color);
    font-size: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-bell {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: var(--shadow);
}

/* Compact inline countdown next to status badges */
.countdown-inline {
    font-size: 0.78em;
    color: #666;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* Ensure countdown-timer global selector still works for updates */
.countdown-timer {
    font-size: 0.78em;
    color: #666;
}

/* Status container to allow overlaying countdown */
.status-container {
    position: relative;
    display: inline-block;
}

/* Overlay countdown placed top-right, overlapping the status badge */
.countdown-overlay {
    position: absolute;
    top: -6px;
    left: -8px;
    background-color: rgba(255, 255, 255, 0.9);
    /* light semi-transparent */
    color: var(--dark-color);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.72em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
    white-space: nowrap;
}

/* Dark theme variant for overlay */
[data-theme="dark"] .countdown-overlay {
    background-color: rgba(22, 27, 34, 0.75);
    color: var(--light-color);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Dark theme overrides for inline and timer countdowns */
[data-theme="dark"] .countdown-inline {
    color: var(--light-color);
}

[data-theme="dark"] .countdown-timer {
    color: #ffffff !important;
}

/* Dark-mode: make modal textboxes and Info Pengguna panels dark with white text */
[data-theme="dark"] #currentUserModal #infoCurrentUser,
[data-theme="dark"] #currentUserModal #infoOrderId,
[data-theme="dark"] #currentUserModal #infoServiceName,
[data-theme="dark"] #currentUserModal #infoUsername {
    background: #000000 !important;
    color: #ffffff !important;
    border-radius: 4px;
    padding-top: 10px;
    /* keep spacing consistent if inline style overridden */
}

[data-theme="dark"] #gunakanModal input[type="text"],
[data-theme="dark"] #gunakanModal textarea,
[data-theme="dark"] #gunakanModal .form-control {
    background: #000000 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Ensure placeholder text is visible in dark mode */
[data-theme="dark"] #gunakanModal input::placeholder,
[data-theme="dark"] #gunakanModal textarea::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Dark-mode: make Add/Edit (Tambah Data) modal inputs dark with white text */
[data-theme="dark"] #dataModal input,
[data-theme="dark"] #dataModal input[type="text"],
[data-theme="dark"] #dataModal input[type="number"],
[data-theme="dark"] #dataModal textarea,
[data-theme="dark"] #dataModal select,
[data-theme="dark"] #dataModal .form-control,
[data-theme="dark"] #dataModal datalist {
    background: #000000 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] #dataModal textarea {
    resize: none;
}

[data-theme="dark"] #dataModal input::placeholder,
[data-theme="dark"] #dataModal textarea::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Slightly reduce status-badge z-index so overlay sits above */
.status-badge {
    z-index: 1;
    position: relative;
}

.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);
}

.theme-option:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.theme-option:hover {
    background: var(--table-hover);
    transform: translateY(-1px);
}

.theme-option.active {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.08);
}

.theme-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Theme swatch colors */
.theme-option[data-theme="light"] .theme-swatch {
    background: #3b82f6;
}

.theme-option[data-theme="dark"] .theme-swatch {
    background: #60a5fa;
}

.theme-option[data-theme="ocean"] .theme-swatch {
    background: #0ea5e9;
}

.theme-option[data-theme="emerald"] .theme-swatch {
    background: #10b981;
}

.theme-option[data-theme="sunset"] .theme-swatch {
    background: #f97316;
}

.header-action-buttons.floating {
    position: fixed;
    top: 10px;
    right: 12px;
    z-index: 120;
    margin: 0;
}

#headerActionFloatingSlot {
    position: relative;
    z-index: 140;
}

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

[data-theme="dark"] .header-hide-btn {
    background: rgba(22, 27, 34, 0.9);
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.modal-tabs p {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tab-button {
    background: var(--table-hover);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tab-button.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.tab-panels {
    margin-top: 10px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* [UI CHANGE] Captcha solver provider radio group */
.solver-provider-radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.solver-provider-radio {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--table-hover);
    cursor: pointer;
    transition: transform var(--ui-duration) var(--ui-ease), box-shadow var(--ui-duration) var(--ui-ease), border-color var(--ui-duration) var(--ui-ease);
}

.solver-provider-radio input {
    accent-color: var(--primary-color);
}

.solver-provider-radio:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.solver-provider-radio input:checked+span {
    font-weight: 600;
    color: var(--primary-color);
}

.helper-text {
    display: inline-block;
    margin-top: 6px;
    color: var(--secondary-color);
    font-size: 12px;
}

/* [UI CHANGE] Floating bulk delete button (glowing) — z-index 1050 agar muncul di atas modal (1000) */
.floating-bulk-delete {
    position: fixed;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--danger-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.35);
    cursor: pointer;
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
    transition: opacity var(--ui-duration) var(--ui-ease), transform var(--ui-duration) var(--ui-ease);
    animation: bulkDeleteGlow 3.6s ease-in-out infinite;
    z-index: 1050;
}

.floating-bulk-delete.show {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.floating-bulk-delete-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #fff;
    color: var(--danger-color);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.floating-bulk-delete i {
    color: #ffffff;
    font-size: 16px;
}

@keyframes bulkDeleteGlow {
    0% {
        box-shadow: 0 8px 18px rgba(239, 68, 68, 0.25), 0 0 0 0 rgba(239, 68, 68, 0.25);
    }

    70% {
        box-shadow: 0 10px 22px rgba(239, 68, 68, 0.35), 0 0 0 18px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 8px 18px rgba(239, 68, 68, 0.25), 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Floating bulk delete buttons for password changes and reset password queue modal — follows cursor via JS */

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    margin-top: 6px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #c7cbd1;
    transition: 0.2s;
    border-radius: 999px;
}

.switch-slider:before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.switch input:checked+.switch-slider {
    background-color: var(--primary-color);
}

.switch input:checked+.switch-slider:before {
    transform: translateX(20px);
}

/* Small toggle variant for dense tables */
.switch.switch-sm {
    width: 36px;
    height: 20px;
    margin-top: 0;
}

.switch.switch-sm .switch-slider:before {
    width: 14px;
    height: 14px;
    left: 3px;
    top: 3px;
}

.switch.switch-sm input:checked+.switch-slider:before {
    transform: translateX(16px);
}

/* Toggle layout helpers */
.toggle-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.toggle-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toggle-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Password changes modal toggle layout */
.password-changes-header .toggle-stack {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 18px;
}

.password-changes-header .toggle-item {
    min-width: 260px;
}

.toggle-label {
    font-weight: 600;
}

/* Table checkbox (replaces switch for table selections) */
.table-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Captcha solver modal layout */
.solver-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.solver-stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0 12px;
}

.solver-stats-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.solver-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.solver-stats-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
}

.solver-stats-card h4 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
}

.balance-usage-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.balance-usage-breakdowns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.daily-usage-chart {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.daily-usage-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.daily-usage-chart-header h4 {
    font-size: 14px;
}

.daily-usage-chart-legend {
    font-size: 12px;
    color: var(--secondary-color);
}

.daily-usage-bars {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    min-height: 160px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.daily-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 68px;
    gap: 4px;
}

.daily-bar-fill {
    width: 100%;
    border-radius: 6px 6px 4px 4px;
    background: linear-gradient(180deg, #27ae60, #2ecc71);
    min-height: 6px;
}

.daily-bar-value {
    font-size: 11px;
    color: var(--secondary-color);
    text-align: center;
}

.daily-bar-label {
    font-size: 11px;
    color: var(--text-color);
    text-align: center;
    white-space: nowrap;
}

.balance-usage-breakdowns h4 {
    margin-bottom: 8px;
    font-size: 14px;
}

.compact-table th,
.compact-table td {
    padding: 8px 10px;
    font-size: 12px;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 2.5px;
    background: white;
    border-radius: 2px;
}

.header-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
}

/* Main Content */
.main-content {
    padding: 30px 0;
    padding-top: 90px;
    padding-bottom: 44px;
    /* space for floating horizontal scrollbar */
}

.header-hidden~.main-content {
    padding-top: 30px;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    padding: 6px 8px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: stretch;
    /* allow children (chart) to fill card height */
    gap: 6px;
    transition: transform 0.2s;
}

/* Ensure children can shrink and not force overflow */
.stat-card {
    min-width: 0;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.table-no-wrap th,
.table-no-wrap td {
    white-space: nowrap;
}

.compact-report {
    padding: 14px 16px;
}

.compact-report-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.compact-report-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
}

.compact-report-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.compact-report-content {
    padding-top: 8px;
}

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

.credit-usage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.credit-usage-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 999px;
    overflow: hidden;
}

.credit-usage-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2ecc71, #f1c40f, #e74c3c);
    transition: width 0.3s ease;
}

.stat-icon {
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.stat-info {
    /* Reserve ~35% for the info block when chart is present to reduce wrapping */
    flex: 0 0 35%;
    max-width: 35%;
    min-width: 0;
    box-sizing: border-box;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: center;
}

/* Make first and third stat cards (Total Data, Tidak Dipakai) use larger info area */
.stats-grid .stat-card:nth-child(1) .stat-info,
.stats-grid .stat-card:nth-child(3) .stat-info {
    flex: 0 0 80% !important;
    max-width: 80% !important;
}

/* Ensure chart (if present) in those cards shrinks or hides */
.stats-grid .stat-card:nth-child(1) .stat-chart,
.stats-grid .stat-card:nth-child(3) .stat-chart {
    flex: 0 0 20% !important;
    max-width: 20% !important;
}

.stat-label {
    color: var(--secondary-color);
    font-size: 11px;
    margin-bottom: 3px;
}

.stat-value {
    color: var(--dark-color);
    font-size: 18px;
    font-weight: bold;
}

.stat-sublabel {
    font-size: 0.75em;
    color: var(--danger-color);
    margin-top: 4px;
    font-weight: 500;
}

.stat-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    /* Chart should occupy remaining space; adjusted to accommodate wider info */
    flex: 1 1 65%;
    max-width: 65%;
    min-width: 0;
    box-sizing: border-box;
    height: 84px;
    /* fixed chart height to keep card height stable */
}

.stat-mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    flex: 1 1 auto;
    /* grow to fill .stat-chart height */
    width: 100%;
    justify-content: space-between;
    height: 52px;
    /* fixed bar area height to prevent card growth */
    min-height: 52px;
    /* ensure minimal visible area */
}

.mini-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 10px;
    /* Fill the chart height so percentage heights inside work */
    height: 100%;
    justify-content: flex-end;
}

.mini-bar-fill {
    max-height: 100%;
}

.mini-bar-fill {
    width: 100%;
    height: var(--bar-height, 20%);
    background: linear-gradient(180deg, rgba(52, 152, 219, 0.95), rgba(46, 204, 113, 0.9));
    border-radius: 4px;
    transform-origin: bottom;
    transform: scaleY(0);
    transition: transform 0.5s cubic-bezier(.2, .9, .2, 1), background 0.12s;
    display: block;
}

.stat-mini-chart.animate .mini-bar-fill {
    transform: scaleY(1);
}

.mini-bar-label {
    font-size: 9px;
    color: var(--secondary-color);
    line-height: 1;
    margin-top: 6px;
}

.mini-bar-label {
    font-size: 8px;
    color: var(--secondary-color);
    line-height: 1;
    margin-top: 4px;
}

.mini-bar-value {
    font-size: 10px;
    color: var(--dark-color);
    font-weight: 600;
    line-height: 1;
    margin-top: 2px;
}
}

/* Responsive: stack stat info and chart on small screens */
@media (max-width: 720px) {
    .stat-card {
        align-items: flex-start;
        gap: 12px;
        padding: 10px;
    }

    .stat-info {
        flex: 1 1 auto;
        max-width: 100%;
    }

    .stat-chart {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
        align-items: center;
    }

    .stat-mini-chart {
        height: 48px;
    }
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.controls-left {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Dropdown container for Data button */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.dropdown-menu.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Smart positioning: flip dropdown to right if too close to right edge */
.dropdown-menu.position-right {
    left: auto;
    right: 0;
}

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

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

.dropdown-item i {
    width: 16px;
    text-align: center;
}


.controls-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.controls-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 999px;
    background: var(--primary-color);
    color: #fff;
    padding: 10px 12px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18), 0 0 0 3px rgba(59, 130, 246, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.35);
    /* [CONTEXT 1] Buat berpendar seperti floating bulk delete button */
    animation: controlsToggleGlow 3.6s ease-in-out infinite;
}

.controls-toggle-btn::after {
    content: "";
}

@media (max-width: 768px) {
    .controls-toggle-btn {
        position: relative;
        padding: 10px 14px;
    }

    .controls-toggle-btn::after {
        content: "Kontrol";
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.2px;
        margin-left: 6px;
        color: #fff;
        white-space: nowrap;
    }
}

.controls-toggle-btn i {
    font-size: 16px;
    color: darkorange;
}

/* [CONTEXT 1] Glow animation untuk controlsToggleBtn */
@keyframes controlsToggleGlow {
    0% {
        box-shadow: 0 8px 18px rgba(59, 130, 246, 0.25), 0 0 0 0 rgba(59, 130, 246, 0.25);
    }

    70% {
        box-shadow: 0 10px 22px rgba(59, 130, 246, 0.35), 0 0 0 18px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 8px 18px rgba(59, 130, 246, 0.25), 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.table-header-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

/* small spacing and sizing for per-table refresh button — line-height:1 agar icon di tengah */
.table-refresh-btn {
    margin-left: 8px;
    height: 32px;
    min-width: 36px;
    padding: 6px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.table-refresh-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}


.search-input {
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: var(--card-bg);
    color: var(--text-color);
}

.input-with-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 10px;
    color: var(--secondary-color);
    font-size: 12px;
    pointer-events: none;
}

.input-with-icon .search-input {
    padding-left: 30px;
}

.controls.floating {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1400px;
    z-index: 90;
    margin: 0;
    padding: 12px 20px;
    background: var(--card-bg);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid var(--border-color);
}


.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
}

/* Table */
.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    cursor: text;
}

.table-container:active {
    cursor: grabbing;
    /* Show grabbing cursor when dragging */
}

/* Make scrollbar always visible and more prominent */
.table-container::-webkit-scrollbar {
    height: 16px;
    /* Increased height for better visibility */
    position: sticky;
    bottom: 0;
}

.table-container::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    border: 2px solid var(--light-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--dark-color) 100%);
    cursor: pointer;
}

.table-container::-webkit-scrollbar-thumb:active {
    background: var(--dark-color);
}

/* Floating horizontal scrollbar (always accessible without scrolling to table bottom) */
.floating-hscroll {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    z-index: 9999;
    display: none;
}

.floating-hscroll-inner {
    height: 1px;
    width: 0;
}

.floating-hscroll::-webkit-scrollbar {
    height: 16px;
}

.floating-hscroll::-webkit-scrollbar-track {
    background: var(--light-color);
}

.floating-hscroll::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 8px;
}

.floating-hscroll::-webkit-scrollbar-thumb:hover {
    background: var(--dark-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.data-table thead {
    background: var(--table-header-bg);
    color: var(--table-header-text);
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
}

.data-table th {
    font-weight: 600;
    white-space: nowrap;
    font-size: 13px;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s, opacity 0.3s, transform 0.3s;
}

.data-table tbody tr:hover {
    background-color: var(--table-hover);
}

.data-table tbody tr.deleting {
    opacity: 0;
    transform: translateX(-20px);
}

/* Improve status column width to prevent wrapping */
.data-table th[data-column="status"],
.data-table td[data-column="status"] {
    min-width: 180px;
}

/* Inline Editor Styles */
.inline-editor {
    position: relative;
}

.inline-editor .editor-value,
.inline-editor .editor-value-wrapper {
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background-color 0.2s, box-shadow 0.2s;
    display: inline-block;
}

.inline-editor .editor-value:hover,
.inline-editor .editor-value-wrapper:hover {
    background-color: var(--table-hover);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.inline-editor .editor-input {
    width: 100%;
    min-width: 80px;
    padding: 6px 8px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 13px;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.inline-editor .editor-input:focus {
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Desktop: hide action column, show row click cursor */
@media (min-width: 769px) {

    .data-table th.sticky-action,
    .data-table td.sticky-action {
        display: none;
    }

    .data-table tbody tr {
        cursor: pointer;
    }

    .data-table tbody tr:hover {
        background-color: var(--table-hover);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}

/* Floating action popup for desktop */
.row-action-popup {
    position: fixed;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    padding: 8px;
    z-index: 10000;
    display: none;
    min-width: 200px;
}

.row-action-popup.show {
    display: block;
}

.row-action-popup .popup-header {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--secondary-color);
    font-weight: 600;
}

.row-action-popup .popup-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
}

.row-action-popup .popup-actions button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    transition: background 0.2s;
}

.row-action-popup .popup-actions button:hover {
    background: var(--table-hover);
}

.row-action-popup .popup-actions button.copy-btn:hover {
    background: #e3f2fd;
}

.row-action-popup .popup-actions button.use-btn:hover {
    background: #e8f5e9;
}

.row-action-popup .popup-actions button.reset-btn:hover {
    background: #fff3e0;
}

.row-action-popup .popup-actions button.edit-btn:hover {
    background: #fff3e0;
}

.row-action-popup .popup-actions button.add-btn:hover {
    background: #e8f5e9;
}

.row-action-popup .popup-actions button.deduct-btn:hover {
    background: #ffe5e5;
}

.row-action-popup .popup-actions button.delete-btn:hover {
    background: #ffebee;
    color: var(--danger-color);
}

/* Sticky action column for small screens */
@media (max-width: 768px) {
    .controls.mobile-collapsed {
        display: none;
    }

    .controls {
        display: none;
    }

    .controls.mobile-open {
        display: flex !important;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 74px;
        z-index: 12000;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 12px;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
        max-height: calc(100vh - 140px);
        overflow-y: auto;
    }

    .controls.mobile-open .controls-left,
    .controls.mobile-open .controls-right {
        width: 100%;
    }

    .controls-toggle-btn {
        display: inline-flex;
        position: fixed;
        right: 16px;
        bottom: 16px;
        z-index: 12001;
    }

    .table-container {
        overflow-x: auto;
    }

    .data-table th.sticky-action,
    .data-table td.sticky-action {
        position: sticky;
        right: 0;
        background: var(--table-header-bg);
        z-index: 10;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
        min-width: 60px !important;
        max-width: 70px !important;
        width: 65px !important;
        padding: 6px 4px !important;
    }

    .data-table tbody tr td.sticky-action {
        background: var(--card-bg);
    }

    .data-table tbody tr:hover td.sticky-action {
        background-color: var(--table-hover);
    }

    /* Make action buttons more compact on mobile */
    .action-buttons .action-buttons-desktop {
        display: none !important;
    }

    .action-buttons .action-buttons-mobile {
        display: block !important;
    }

    .btn-icon {
        padding: 6px 10px;
        font-size: 16px;
        width: auto;
        text-align: center;
    }

    .btn-menu {
        padding: 6px 12px;
        min-width: 45px;
        font-size: 16px;
    }
}

/* Column Selector Dropdown */
.column-selector {
    position: fixed;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 15px;
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    will-change: transform, opacity;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.column-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.column-selector-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary-color);
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
}

.column-selector-header button:hover {
    color: var(--danger-color);
}

.column-selector-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: 14px;
}

.column-selector-item:hover {
    background-color: #f8f9fa;
}

.column-selector input[type="checkbox"] {
    cursor: pointer;
}

.controls-left {
    position: relative;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-dipakai {
    background: #d4edda;
    color: #155724;
}

.status-tidak {
    background: #f8d7da;
    color: #721c24;
}

.status-expired {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    font-size: 11px;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 3px;
    position: relative;
}

.action-buttons-desktop {
    display: flex;
    gap: 3px;
}

.action-buttons-mobile {
    display: none;
    position: relative;
}

.btn-icon {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 32px;
    text-align: center;
}

.btn-icon i {
    color: #ffffff;
}

.btn-edit {
    background: var(--warning-color);
    color: white;
}

.btn-edit:hover {
    background: #e67e22;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

/* Balance usage cost coloring */
.balance-cost-negative {
    color: #27ae60;
    /* green for refunds/top-ups shown as negative */
    font-weight: 600;
}

.balance-cost-positive {
    color: #e74c3c;
    /* red for expense */
    font-weight: 600;
}

.btn-menu {
    background: #34495e;
    color: white;
    font-size: 18px;
    font-weight: bold;
    padding: 8px 16px;
    min-width: 50px;
}

.btn-menu:hover {
    background: #2c3e50;
}

.action-dropdown {
    display: none;
    position: fixed;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 20000;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    will-change: transform, opacity;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.action-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    animation: dropdownIn 0.2s ease;
}

.action-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #2c3e50;
    transition: background 0.2s;
}

.action-dropdown button:hover {
    background: #f8f9fa;
}

.action-dropdown button:first-child {
    border-radius: 8px 8px 0 0;
}

.action-dropdown button:last-child {
    border-radius: 0 0 8px 8px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn i {
    margin-right: 6px;
}

.fa-solid,
.fa-regular {
    transition: color 0.2s ease;
}

.fa-chart-column,
.fa-chart-line,
.fa-circle-info,
.fa-eye,
.fa-file-export,
.fa-file-import,
.fa-file-lines,
.fa-clipboard,
.fa-scroll {
    color: var(--icon-blue);
}

.fa-circle-check,
.fa-check,
.fa-plus,
.fa-wallet,
.fa-right-to-bracket {
    color: var(--icon-green);
}

.fa-circle-xmark,
.fa-trash,
.fa-ban,
.fa-xmark {
    color: var(--icon-red);
}

.fa-triangle-exclamation,
.fa-rotate,
.fa-rotate-left,
.fa-clock-rotate-left,
.fa-hourglass-half,
.fa-stopwatch,
.fa-clock,
.fa-minus,
.fa-circle-question {
    color: var(--icon-orange);
}

.fa-key,
.fa-pen-to-square,
.fa-comment-dots,
.fa-floppy-disk {
    color: var(--icon-purple);
}

.fa-user,
.fa-users,
.fa-user-plus,
.fa-user-gear,
.fa-user-pen,
.fa-user-check,
.fa-user-slash {
    color: var(--icon-teal);
}

.fa-bell,
.fa-sun,
.fa-lightbulb {
    color: var(--icon-gold);
}

.fa-moon,
.fa-magnifying-glass,
.fa-ellipsis,
.fa-ellipsis-vertical,
.fa-chevron-down,
.fa-chevron-up,
.fa-sliders {
    color: var(--icon-gray);
}

.fa-globe,
.fa-database,
.fa-list,
.fa-table-columns,
.fa-folder-open,
.fa-print,
.fa-gear,
.fa-clipboard-list {
    color: var(--icon-teal);
}

/* Theme switcher icon color */
#themeSwitcherBtn .fa-palette {
    color: var(--icon-purple);
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.25);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(127, 140, 141, 0.22);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.22);
}

.btn-success:hover {
    background: color-mix(in srgb, var(--success-color) 85%, #0f172a 15%);
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning-color);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.22);
}

.btn-warning:hover {
    background: color-mix(in srgb, var(--warning-color) 85%, #0f172a 15%);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.22);
}

.btn-danger:hover {
    background: color-mix(in srgb, var(--danger-color) 85%, #0f172a 15%);
    transform: translateY(-1px);
}

/* Light theme: diferensiasi warna tombol agar intuitif — tiap tipe punya identitas visual */
html:not([data-theme]) .btn,
[data-theme="light"] .btn {
    background: #ffffff !important;
    color: var(--btn-text-dark) !important;
    border: 1px solid var(--btn-border-dark) !important;
    box-shadow: none !important;
}

/* btn-secondary (Batal/Cancel): netral, abu-abu */
html:not([data-theme]) .btn-secondary,
[data-theme="light"] .btn-secondary {
    background: #f3f4f6 !important;
    color: #4b5563 !important;
    border: 1px solid #9ca3af !important;
    box-shadow: none !important;
}

/* btn-primary (Simpan/Save): biru, aksi utama */
html:not([data-theme]) .btn-primary,
[data-theme="light"] .btn-primary {
    background: #e8f0fe !important;
    color: #1a56db !important;
    border: 1px solid #1a56db !important;
    box-shadow: none !important;
}

/* btn-danger (Hapus/Delete): merah, aksi berbahaya */
html:not([data-theme]) .btn-danger,
[data-theme="light"] .btn-danger {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #dc2626 !important;
    box-shadow: none !important;
}

/* btn-success: hijau */
html:not([data-theme]) .btn-success,
[data-theme="light"] .btn-success {
    background: #ecfdf5 !important;
    color: #059669 !important;
    border: 1px solid #059669 !important;
    box-shadow: none !important;
}

/* btn-warning: kuning/amber */
html:not([data-theme]) .btn-warning,
[data-theme="light"] .btn-warning {
    background: #fffbeb !important;
    color: #d97706 !important;
    border: 1px solid #d97706 !important;
    box-shadow: none !important;
}

/* Hover for light theme buttons: slightly darker background */
html:not([data-theme]) .btn:hover,
[data-theme="light"] .btn:hover {
    background: #f6f9ff !important;
    transform: translateY(-1px);
}

html:not([data-theme]) .btn-secondary:hover,
[data-theme="light"] .btn-secondary:hover {
    background: #e5e7eb !important;
    transform: translateY(-1px);
}

html:not([data-theme]) .btn-primary:hover,
[data-theme="light"] .btn-primary:hover {
    background: #d0e0fd !important;
    transform: translateY(-1px);
}

html:not([data-theme]) .btn-danger:hover,
[data-theme="light"] .btn-danger:hover {
    background: #fee2e2 !important;
    transform: translateY(-1px);
}

html:not([data-theme]) .btn-success:hover,
[data-theme="light"] .btn-success:hover {
    background: #d1fae5 !important;
    transform: translateY(-1px);
}

html:not([data-theme]) .btn-warning:hover,
[data-theme="light"] .btn-warning:hover {
    background: #fef3c7 !important;
    transform: translateY(-1px);
}

/* Dark theme: base button style */
[data-theme="dark"] button,
[data-theme="dark"] .btn,
[data-theme="dark"] .dropdown-item,
[data-theme="dark"] .tab-button,
[data-theme="dark"] .btn-icon-only {
    background: #252525 !important;
    color: #ffffff !important;
    border: 1px solid #6a6a6a !important;
    box-shadow: none !important;
}

/* Dark theme: diferensiasi warna tombol agar intuitif */
[data-theme="dark"] .btn-secondary {
    background: #333333 !important;
    color: #d1d5db !important;
    border: 1px solid #6b7280 !important;
}

[data-theme="dark"] .btn-primary {
    background: #1e3a5f !important;
    color: #93c5fd !important;
    border: 1px solid #3b82f6 !important;
}

[data-theme="dark"] .btn-danger {
    background: #4a1515 !important;
    color: #fca5a5 !important;
    border: 1px solid #ef4444 !important;
}

[data-theme="dark"] .btn-success {
    background: #14332a !important;
    color: #6ee7b7 !important;
    border: 1px solid #10b981 !important;
}

[data-theme="dark"] .btn-warning {
    background: #422006 !important;
    color: #fcd34d !important;
    border: 1px solid #f59e0b !important;
}

[data-theme="dark"] button:hover,
[data-theme="dark"] .btn:hover,
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .tab-button:hover,
[data-theme="dark"] .btn-icon-only:hover {
    background: #666666 !important;
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-primary:hover {
    background: #2b4f7a !important;
}

[data-theme="dark"] .btn-danger:hover {
    background: #6b2020 !important;
}

[data-theme="dark"] .btn-success:hover {
    background: #1a4a3a !important;
}

[data-theme="dark"] .btn-warning:hover {
    background: #5a3010 !important;
}


.btn-danger:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-icon-only {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 10px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-only i {
    margin-right: 0;
}

.btn-icon-only:hover {
    background: var(--table-hover);
    transform: scale(1.1);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* DateTime Inputs */
.datetime-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.datetime-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.datetime-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.datetime-col label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.datetime-col input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text-color);
}

.datetime-col input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #f8fbff;
}

.datetime-col button {
    padding: 8px 12px;
    margin-top: 24px;
    height: 36px;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

/* Confirmation modals (delete confirmations) must overlay floating controls */
.modal.confirmation {
    /* Above floating-bulk-delete (1050) but below global overlays like toasts/action-dropdown */
    z-index: 1100;
}

/* Ensure modal content inside confirmation modal is above floating elements */
.modal.confirmation .modal-content {
    z-index: 1101;
    position: relative;
}

/* Prevent body scroll when modal is active */
body.modal-open {
    overflow: hidden;
    height: 100vh;
}

.role-lock-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 900;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

body.role-locked .main-content,
body.role-locked .header {
    pointer-events: none;
    filter: grayscale(0.3);
}

.modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s;
    box-shadow: var(--shadow-lg);
    position: relative;
    margin: auto;
}

.modal-sm {
    max-width: 450px;
}

.modal-lg {
    max-width: 900px;
}

#passwordListModal .modal-content {
    max-width: 960px;
    padding-bottom: 0;
}

#passwordListModal .modal-header {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 20;
}

#passwordListModal .modal-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#passwordListModal .modal-tabs {
    margin: 0;
    padding: 10px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
}

/* Larger, more tappable tab buttons for Pengaturan & Password modal */
#passwordListModal .tab-button {
    padding: 10px 18px;
    font-size: 12px;
    border-radius: 12px;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
}

#passwordListModal .tab-button i {
    font-size: 18px;
}

#passwordListModal .tab-button.active {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#passwordListModal .password-settings-body {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 70px;
}

#passwordListModal .password-settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 16px;
    margin: 0;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

#passwordListModal .history-filters {
    padding: 10px 12px;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
}

#passwordListModal .logs-container {
    padding: 12px;
}

#passwordListModal .reset-password-queue-cron {
    font-size: 12px;
    color: #6c757d;
    padding: 0 8px 6px;
}

/* =============================================
   Sub-tabs untuk Format Pesan (Normal / No Stock)
   ============================================= */
.msg-template-subtabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 16px;
}

.msg-template-subtab {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--secondary-color);
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.msg-template-subtab:hover {
    color: var(--text-color);
}

.msg-template-subtab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.msg-template-subpanel {
    display: none;
}

.msg-template-subpanel.active {
    display: block;
}

/* Container untuk switch toggle no stock */
.nostock-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--table-hover);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.nostock-toggle-row .nostock-label {
    font-size: 13px;
    font-weight: 600;
    flex: 1;
}

.nostock-toggle-row .nostock-desc {
    font-size: 12px;
    color: var(--secondary-color);
    margin-top: 2px;
}

/* Utility classes: mengganti inline style pada message template section */
.template-section {
    margin-bottom: 15px;
}

.template-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.template-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    background: var(--card-bg);
    color: var(--text-color);
}

.template-helper-text {
    color: var(--secondary-color);
    display: block;
    margin-top: 8px;
    font-size: 12px;
}

.template-preview-box {
    margin-bottom: 15px;
    padding: 12px;
    background: var(--table-hover);
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

.template-preview-box.warning {
    border-left-color: var(--warning-color);
}

.template-preview-pre {
    margin-top: 8px;
    white-space: pre-wrap;
    font-size: 13px;
    font-family: monospace;
}

.nostock-template-container {
    margin-bottom: 15px;
    padding: 12px;
    background: var(--table-hover);
    border-radius: 4px;
    border-left: 4px solid var(--warning-color);
}

/* Disabled state for no-stock section when toggle is off */
.nostock-section-disabled {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.5);
    transition: opacity 0.3s, filter 0.3s;
}

/* Alert Styles */
.alert-danger {
    margin-bottom: 20px;
    padding: 15px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 6px;
    color: #c00;
}

[data-theme="dark"] .alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.3);
    color: #ff6b6b;
}

/* History Filters */
.history-filters {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 768px) {
    .history-filters {
        flex-direction: column;
        gap: 8px;
    }

    .history-filters input,
    .history-filters select {
        width: 100% !important;
        min-width: 100% !important;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    /* Sticky header */
    flex-shrink: 0;
    background: var(--card-bg);
    position: relative;
    z-index: 10;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-header h2 {
    margin: 0;
    color: var(--dark-color);
    font-size: 16px;
    line-height: 1.2;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--secondary-color);
    line-height: 1;
}

.modal-close:hover {
    color: var(--dark-color);
}

.modal form {
    padding: 15px 20px;
}

.modal p {
    padding: 15px 20px;
}

/* For modals with scrollable containers (logs, history, etc.) */
.logs-container,
.history-filters+.logs-container {
    max-height: calc(90vh - 200px);
    /* Adjust based on header/footer/filters */
    overflow-y: auto;
    overflow-x: auto;
    padding: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid #e0e0e0;
    /* Sticky footer */
    flex-shrink: 0;
    background: var(--card-bg);
    position: relative;
    z-index: 10;
}

/* Modal body - scrollable content between header and footer */
.modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Modal actions inside tab panels need extra top spacing */
.tab-panel .modal-actions {
    margin-top: 24px;
    padding-top: 20px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    max-width: 400px;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
    font-size: 14px;
    font-weight: 500;
    word-wrap: break-word;
}

.toast.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.toast.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.toast.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.toast.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
    margin-left: auto;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes dropdownIn {
    from {
        transform: translateY(-6px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls-right {
        flex-direction: column;
    }

    .header-action-buttons {
        position: static;
        width: auto;
        flex: 0 0 auto;
        align-self: center;
        justify-content: flex-end;
        padding: 0;
        background: transparent;
    }

    .header-content {
        align-items: flex-start;
    }

    .user-info {
        flex-wrap: wrap;
        align-items: center;
    }

    .main-content {
        padding-top: 120px;
    }

    .search-input {
        min-width: 100%;
    }

    .table-container {
        overflow-x: scroll;
        /* Always show horizontal scrollbar on mobile */
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
        white-space: nowrap;
    }

    /* Make status badges more compact */
    .status-badge {
        padding: 3px 8px;
        font-size: 10px;
    }

    .status-expired {
        font-size: 9px;
        padding: 2px 6px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
    }

    .logs-container {
        padding: 14px;
    }

    .modal-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .password-changes-header {
        align-items: stretch !important;
    }

    .password-changes-header .toggle-stack {
        flex-direction: column;
        width: 100%;
    }

    .password-changes-header .toggle-item {
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
        min-width: 0;
    }

    .password-changes-header label {
        width: 100%;
        justify-content: flex-start;
    }

    .password-changes-header button {
        width: 100%;
    }

    .password-changes-header span {
        white-space: normal;
    }

    .modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-actions .btn {
        width: 100%;
    }

    .tab-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 24px;
    }

    .login-box {
        padding: 30px 20px;
    }

    /* Extra compact for very small screens */
    .data-table {
        font-size: 11px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 4px;
    }

    /* Hide duration column on very small screens */
    .data-table th[data-column="durasi"],
    .data-table td[data-column="durasi"],
    .data-table th[data-column="waktuBeli"],
    .data-table td[data-column="waktuBeli"] {
        display: none;
    }

    .btn-icon {
        font-size: 16px;
        padding: 6px;
    }

    .controls-left {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .controls-left .btn {
        flex: 1 1 calc(50% - 4px);
        font-size: 12px;
        padding: 8px;
    }

    .modal-header h2 {
        font-size: 14px;
    }

    .logs-container {
        padding: 10px;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
    position: relative;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast.info {
    border-left-color: var(--primary-color);
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 14px;
    opacity: 0.9;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.removing {
    animation: slideOutRight 0.3s ease-out forwards;
}

/* Confirm Dialog Modal */
.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.confirm-dialog {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.confirm-dialog-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.confirm-dialog-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.confirm-dialog-message {
    font-size: 16px;
    margin-bottom: 30px;
    color: var(--text-color);
    opacity: 0.8;
}

.confirm-dialog-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}


/* Endpoint usage chart (grouped bars) */
.endpoint-usage-chart {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.endpoint-usage-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.endpoint-usage-chart-header h4 {
    font-size: 14px;
}

.endpoint-usage-chart-legend {
    font-size: 12px;
    color: var(--secondary-color);
}

.endpoint-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 12px;
}

.endpoint-chart-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.endpoint-chart-legend .legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.endpoint-bar-groups {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    overflow-x: auto;
    padding-bottom: 6px;
}

.endpoint-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 60px;
}

.endpoint-bar-stack {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 180px;
}

.endpoint-bar {
    width: 10px;
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.endpoint-bar-fill {
    width: 100%;
    border-radius: 6px 6px 2px 2px;
    min-height: 4px;
    transition: height 0.2s ease;
}

.endpoint-bar-date {
    font-size: 11px;
    color: var(--secondary-color);
    text-align: center;
}

/* API Key & Stats Styles */
.api-key-modal-content {
    max-width: 760px;
}

.api-key-modal-body {
    padding: 16px 18px 10px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.api-key-modal-body .api-key-info-alert {
    margin-bottom: 0;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--table-hover);
    border: 1px solid var(--border-color);
}

.api-key-modal-body .api-key-info-alert i {
    font-size: 16px;
    color: var(--icon-blue);
}

.api-key-card-text {
    flex: 1;
    margin: 0;
    font-size: 13px;
    color: var(--secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* keep previous list rules (if used elsewhere) but reduce spacing */
.api-key-info-list li {
    margin: 2px 0;
    font-size: 12px;
    color: var(--secondary-color);
}

/* Ensure user-provided solver inputs look identical to other form inputs */
.api-key-user-keys-grid .form-input {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 14px;
    width: 100%;
    min-width: 0; /* allow input to shrink within grid cell */
}

.api-key-info-text {
    margin: 8px 0 6px;
    padding: 0;
}

.api-key-info-text-last {
    margin-bottom: 0;
}

.api-key-info-list {
    margin: 6px 0 0 18px;
    padding: 0;
}

.api-key-main-card,
.api-key-user-solver-card,
.api-key-stats-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px; /* small spacing between cards */
}

.api-key-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
}

.api-key-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.api-key-value-input {
    flex: 1;
    min-width: 0;
    font-family: "Courier New", monospace;
    font-size: 13px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--table-hover);
    color: var(--text-color);
}

.api-key-copy-btn {
    white-space: nowrap;
}

.api-key-created-at {
    display: block;
    color: var(--secondary-color);
    margin-top: 6px;
    font-size: 12px;
}

.api-key-regenerate-row {
    margin-top: 10px;
}

.api-key-warning-note {
    display: block;
    margin-top: 6px;
    color: var(--warning-color);
    font-size: 12px;
}

.api-key-user-solver-title {
    margin: 0 0 10px;
    font-size: 15px;
}

.api-key-source-group {
    margin-bottom: 10px;
}

.api-key-source-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}

.api-key-user-keys-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

/* admin solver settings modal layout */
.solver-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.solver-settings-grid .form-group {
    margin-bottom: 8px;
}
.solver-settings-grid .form-input {
    width: 100%;
    min-width: 0;
}

.api-key-user-field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.api-key-user-field-note {
    display: block;
    color: var(--secondary-color);
    margin-top: 6px;
    font-size: 12px;
}

.api-key-user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.api-key-auto-save-note {
    display: inline-block;
    font-size: 12px;
    color: var(--secondary-color);
    align-self: center;
    margin-left: 4px;
}
.api-key-stats-title {
    margin: 0 0 10px;
    font-size: 15px;
}

.api-key-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.api-key-stats-grid .stat-card {
    padding: 10px 12px;
    display: block;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: none;
    background: var(--table-hover);
}

.api-key-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.api-key-stat-value-lg {
    font-size: 20px;
}

.api-key-stat-value-warning {
    color: var(--warning-color);
}

.api-key-stat-value-success {
    color: var(--success-color);
}

.api-key-stat-value-muted {
    color: var(--secondary-color);
}

.api-key-stat-label {
    margin-top: 2px;
    font-size: 12px;
    color: var(--secondary-color);
}

.api-key-last-access {
    font-size: 12px;
    color: var(--secondary-color);
}

.api-key-modal-actions {
    margin-top: 0;
    border-top-color: var(--border-color);
}

@media (max-width: 768px) {
    .api-key-modal-body {
        padding: 12px;
    }

    .api-key-input-row {
        flex-direction: column;
    }

    .api-key-user-keys-grid {
        grid-template-columns: 1fr;
    }

    .api-key-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .api-key-stats-grid {
        grid-template-columns: 1fr;
    }
}

.alert-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    color: #0c5460;
}

[data-theme="dark"] .alert-info {
    background: rgba(23, 162, 184, 0.1);
    border-color: rgba(23, 162, 184, 0.3);
    color: #5bc0de;
}

.alert-success {
    margin-bottom: 20px;
    padding: 15px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    color: #155724;
}

[data-theme="dark"] .alert-success {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    background: var(--secondary-color);
    color: white;
    text-transform: uppercase;
}

.badge-success {
    background: var(--success-color);
}

.badge-error {
    background: var(--danger-color);
}

/* small stage badge that sits slightly above the text */
.stage-badge {
    display: inline-block;
    transform: translateY(-3px);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 6px;
}

/* ============================================
   LOGS MODAL – FILTER ROW (replaces inline styles)
   ============================================ */

/* Filter row inside logs tab panels – mirrors .history-filters without the outer border */
.logs-filter-row {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0;
}

/* Search input wrapper inside the filter row grows to fill available space */
.logs-filter-search {
    flex: 1;
    min-width: 200px;
}

/* Label + datetime-local pair */
.logs-filter-label {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

/* Datetime-local input should not stretch full width */
.logs-filter-date {
    width: auto;
}

@media (max-width: 768px) {
    .logs-filter-row {
        flex-direction: column;
        gap: 8px;
    }

    .logs-filter-search,
    .logs-filter-date {
        width: 100%;
        min-width: 100%;
    }
}

/* ============================================
   BOT LOG TYPE BADGES
   ============================================ */

.bot-log-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.bot-log-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.bot-log-badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.bot-log-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.bot-log-badge-info {
    background: #dbeafe;
    color: #1e40af;
}