/* Global Variables & Reset */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-dark: #0f172a;
    --error-bg: #fef2f2;
    --error-text: #b91c1c;
    --border-color: #e2e8f0;
}

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

body { font-family: 'Inter', sans-serif; background-color: var(--bg-color); color: var(--text-main); }

/* Login Page Styles (index.php) */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-card { background: white; width: 100%; max-width: 480px; padding: 2.5rem; border-radius: 1rem; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { font-size: 1.5rem; font-weight: 600; color: #0f172a; margin-bottom: 0.5rem; }
.login-header p { color: #64748b; font-size: 0.875rem; }
.login-alert { background-color: var(--error-bg); color: var(--error-text); padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; margin-bottom: 1.5rem; border: 1px solid #fecaca; }
.login-form-group { margin-bottom: 1.25rem; }
.login-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; color: #475569; }
.login-input { width: 100%; padding: 0.75rem 1rem; border: 1px solid #e2e8f0; border-radius: 0.5rem; font-size: 1rem; transition: border-color 0.2s, box-shadow 0.2s; outline: none; }
.login-input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.login-input:disabled { background-color: #f1f5f9; cursor: not-allowed; }
.login-captcha-wrapper { display: flex; align-items: center; gap: 1rem; margin-top: 0.5rem; }
.login-captcha-img { border-radius: 0.375rem; border: 1px solid #e2e8f0; cursor: pointer; flex-shrink: 0; }
.login-captcha-wrapper .login-input { flex: 1; min-width: 0; }
.login-refresh-btn { background: #f1f5f9; border: 1px solid #e2e8f0; padding: 0.75rem; border-radius: 0.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; height: 46px; width: 46px; flex-shrink: 0; font-size: 1.2rem; }
.login-refresh-btn:hover:not(:disabled) { background: #e2e8f0; transform: rotate(15deg); }
.login-refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.login-row { display: flex; gap: 1rem; }
.login-row .login-form-group { flex: 1; }
.login-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }
.login-btn { flex: 1; background-color: var(--primary-color); color: white; padding: 0.75rem; border: none; border-radius: 0.5rem; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background-color 0.2s; }
.login-btn:hover:not(:disabled) { background-color: var(--primary-hover); }
.login-btn:disabled { background-color: #94a3b8; cursor: not-allowed; }
.login-reg-btn { 
    flex: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background-color: transparent; 
    color: var(--primary-color); 
    padding: 0.75rem; 
    border: 2px solid var(--primary-color); 
    border-radius: 0.5rem; 
    font-size: 1rem; 
    font-weight: 600; 
    text-decoration: none; 
    transition: all 0.2s; 
}
.login-reg-btn:hover:not(.disabled) { background-color: var(--primary-color); color: white; }
.login-reg-btn.disabled { border-color: #94a3b8; color: #94a3b8; pointer-events: none; opacity: 0.6; }
.login-refresh-text { font-size: 0.75rem; color: var(--primary-color); text-decoration: none; cursor: pointer; }
.login-refresh-text:hover { text-decoration: underline; }

/* Register Page Styles (register.php) - Reusing login styles with prefix */
.register-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.register-card { background: white; width: 100%; max-width: 550px; padding: 2.5rem; border-radius: 1rem; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
.register-header { text-align: center; margin-bottom: 2rem; }
.register-header h1 { font-size: 1.5rem; font-weight: 600; color: #0f172a; margin-bottom: 0.5rem; }
.register-header p { color: #64748b; font-size: 0.875rem; }
.register-alert { padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; margin-bottom: 1.5rem; border: 1px solid; }
.register-alert-error { background-color: var(--error-bg); color: var(--error-text); border-color: #fecaca; }
.register-alert-success { background-color: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.register-form-group { margin-bottom: 1.25rem; }
.register-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; color: #475569; }
.register-input { width: 100%; padding: 0.75rem 1rem; border: 1px solid #e2e8f0; border-radius: 0.5rem; font-size: 1rem; transition: border-color 0.2s, box-shadow 0.2s; outline: none; }
.register-input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.register-input:disabled { background-color: #f1f5f9; cursor: not-allowed; }
.register-captcha-wrapper { display: flex; align-items: center; gap: 1rem; margin-top: 0; }
.register-captcha-img { border-radius: 0.375rem; border: 1px solid #e2e8f0; cursor: pointer; flex-shrink: 0; }
.register-captcha-wrapper .register-input { flex: 1; min-width: 0; }
.register-refresh-btn { background: #f1f5f9; border: 1px solid #e2e8f0; padding: 0.75rem; border-radius: 0.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; height: 46px; width: 46px; flex-shrink: 0; font-size: 1.2rem; }
.register-refresh-btn:hover:not(:disabled) { background: #e2e8f0; transform: rotate(15deg); }
.register-refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.register-row { display: flex; gap: 1rem; }
.register-row .register-form-group { flex: 1; }
.register-actions { display: flex; gap: 1rem; margin-top: 0.5rem; align-items: stretch; flex-wrap: wrap; }
.register-actions .register-form-group { flex: 1.2; margin-bottom: 0; }
.register-btn { flex: 1; background-color: var(--primary-color); color: white; padding: 0.75rem; border: none; border-radius: 0.5rem; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background-color 0.2s; }
.register-actions .register-btn { height: 46px; }
.register-btn:hover:not(:disabled) { background-color: var(--primary-hover); }
.register-btn:disabled { background-color: #94a3b8; cursor: not-allowed; }
.register-login-btn { 
    flex: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background-color: transparent; 
    color: var(--primary-color); 
    padding: 0.75rem; 
    border: 2px solid var(--primary-color); 
    border-radius: 0.5rem; 
    font-size: 1rem; 
    font-weight: 600; 
    text-decoration: none; 
    transition: all 0.2s; 
}
.register-login-btn:hover:not(.disabled) { background-color: var(--primary-color); color: white; }
.register-login-btn.disabled { border-color: #94a3b8; color: #94a3b8; pointer-events: none; opacity: 0.6; }
.login-refresh-text:hover { text-decoration: underline; }

/* Sidebar Styles (layout/sidebar.php) */
.sidebar { width: 260px; height: 100vh; background-color: #032e8a; border-right: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; position: fixed; left: 0; top: 0; z-index: 1000; transition: transform 0.3s ease; }
.sidebar-header { padding: 2rem 1.5rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo { max-width: 60px; margin-bottom: 0.75rem; }
.sidebar-title { font-size: 1.125rem; font-weight: 600; color: #ffffff; margin: 0; }
.sidebar-nav { padding: 1.5rem 1rem; flex-grow: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-nav-item { display: flex; align-items: center; padding: 0.75rem 1rem; color: #cbd5e1; text-decoration: none; border-radius: 0.5rem; font-weight: 500; transition: all 0.2s ease; }
.sidebar-nav-item:hover { background-color: rgba(255,255,255,0.1); color: #ffffff; }
.sidebar-nav-item.active { background-color: rgba(255,255,255,0.2); color: #ffffff; }
.sidebar-nav-item.logout:hover { background-color: rgba(220, 38, 38, 0.2); color: #fca5a5; }
.sidebar-nav-icon { margin-right: 0.75rem; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; width: 24px; }
.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,0.1); }

/* Navbar Styles and Alignment */
.navbar {
    height: 64px; 
    background: white; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 1.5rem; 
    position: sticky; 
    top: 0; 
    z-index: 999;
    transition: margin-left 0.3s ease, width 0.3s ease;
}
.sidebar-toggle { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--text-dark); padding: 0.5rem; border-radius: 0.375rem; transition: background 0.2s; display: flex; align-items: center; }
.sidebar-toggle:hover { background: #f1f5f9; }
.navbar-right { display: flex; align-items: center; gap: 1.5rem; }
.navbar-user { font-weight: 500; font-size: 0.875rem; color: var(--text-dark); display: flex; align-items: center; gap: 0.5rem; }
.navbar-logout-btn { color: #dc2626; text-decoration: none; font-size: 0.825rem; font-weight: 600; padding: 0.4rem 0.8rem; border-radius: 0.375rem; transition: all 0.2s; border: 1px solid #fee2e2; background: #fff5f5; }
.navbar-logout-btn:hover { background: #dc2626; color: white; border-color: #dc2626; }

/* Sidebar Responsive & Toggle Logic */
@media (min-width: 769px) {
    .navbar { margin-left: 260px; width: calc(100% - 260px); }
    .dashboard-main, 
    .generate-main, 
    .qr-list-main, 
    .manajemen-user-main,
    .output-qr-body.has-sidebar .output-qr-main { margin-left: 260px; }

    .output-qr-body.has-sidebar .output-qr-main { width: calc(100% - 260px); }
    body > footer { margin-left: 260px; width: calc(100% - 260px); }
    
    body.sidebar-toggled .sidebar { transform: translateX(-100%); }
    body.sidebar-toggled .dashboard-main,
    body.sidebar-toggled .generate-main,
    body.sidebar-toggled .qr-list-main,
    body.sidebar-toggled .manajemen-user-main,
    body.sidebar-toggled .output-qr-main,
    body.sidebar-toggled > footer,
    body.sidebar-toggled .navbar { margin-left: 0 !important; width: 100% !important; }
}

/* Utility & Footer Styles */
.text-center { text-align: center; }
.mt-auto { margin-top: auto; }
.py-3 { padding: 1rem 0; }
.border-top { border-top: 1px solid var(--border-color); }
footer { transition: margin-left 0.3s ease, width 0.3s ease; }
body > footer { background-color: #ffffff; }

/* Footer khusus saat di dalam login/register card */
.login-card footer, .register-card footer { background: transparent; border-top: 1px solid #f1f5f9; margin-top: 1.5rem; padding-top: 1rem; }

/* Dashboard Styles (pages/dashboard.php) */
.dashboard-body { display: flex; flex-direction: column; min-height: 100vh; }
.dashboard-main,
.generate-main,
.qr-list-main,
.manajemen-user-main { 
    flex: 1; 
    padding: 2rem; 
    min-height: calc(100vh - 64px); 
    box-sizing: border-box; 
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.dashboard-header { margin-bottom: 2rem; }
.dashboard-header h1 { font-size: 1.75rem; font-weight: 700; color: var(--text-dark); margin: 0; }
.dashboard-header p { color: var(--text-muted); margin-top: 0.5rem; }
.dashboard-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 2.5rem; }
.dashboard-stat-card { background: white; padding: 1.5rem; border-radius: 1rem; border: 1px solid #e2e8f0; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); transition: transform 0.2s; }
.dashboard-stat-card:hover { transform: translateY(-4px); }
.dashboard-stat-label { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; }
.dashboard-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-dark); margin-top: 0.5rem; display: block; }
.dashboard-stat-trend { display: inline-block; margin-top: 0.75rem; font-size: 0.75rem; padding: 0.25rem 0.5rem; border-radius: 2rem; background: #f0fdf4; color: #166534; }
.dashboard-welcome-banner { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); border-radius: 1rem; padding: 2rem; color: white; margin-bottom: 2rem; display: flex; justify-content: space-between; align-items: center; }
.dashboard-welcome-text h2 { margin: 0; font-size: 1.5rem; }
.dashboard-welcome-text p { opacity: 0.9; margin: 0.5rem 0 0 0; }
.dashboard-quick-btn { background: white; color: var(--primary-color); padding: 0.75rem 1.5rem; border-radius: 0.5rem; text-decoration: none; font-weight: 600; font-size: 0.875rem; transition: transform 0.2s; }
.dashboard-quick-btn:hover { transform: translateY(-2px); }

/* Layout Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); z-index: 1001; }
    body.sidebar-toggled .sidebar { transform: translateX(0); }
    
    .dashboard-main, 
    .generate-main, 
    .qr-list-main,
    .manajemen-user-main,
    .navbar { 
        margin-left: 0 !important; 
        width: 100% !important; 
        padding: 1rem; 
    }
    .dashboard-welcome-banner { flex-direction: column; text-align: center; gap: 1.5rem; }
    .dashboard-welcome-banner div[style*="display: flex"] {
        width: 100%;
        flex-wrap: nowrap !important; /* Paksa tetap satu baris */
    }
    .dashboard-quick-btn {
        flex: 1; /* Bagi rata lebar tombol */
        font-size: 0.75rem; /* Kecilkan sedikit font agar muat */
        padding: 0.75rem 0.5rem;
        white-space: nowrap; /* Cegah teks turun ke bawah */
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }

    /* Form & Row Responsive */
    .register-row, .login-row, .output-qr-row { flex-direction: column; gap: 0; }
    .register-actions, .login-actions { flex-direction: column; align-items: stretch; margin-top: 1.25rem; gap: 0.75rem; }
    .register-btn, .register-login-btn, .login-btn, .login-reg-btn { width: 100%; flex: none; height: 48px !important; }

    /* Toolbar Responsive */
    .qr-list-toolbar { flex-direction: column; align-items: stretch !important; gap: 0.75rem !important; }
    .qr-list-toolbar form { max-width: none !important; width: 100% !important; }
    .qr-list-toolbar div[style*="display: flex"] { width: 100%; flex-direction: column; gap: 0.5rem !important; }
    .qr-list-toolbar .btn-action { width: 100%; justify-content: center; padding: 0.85rem !important; }

    /* Generate & Profile Responsive */
    .generate-main { padding: 1rem; }
    .generate-card { padding: 1.25rem; }
    .generate-submit-btn { padding: 0.85rem; }

    /* Modal Responsive */
    .generate-modal-content { width: 95%; margin: 10px; max-height: 90vh; overflow-y: auto; }
    .generate-modal-body { padding: 1.25rem; }

    /* Stats Grid */
    .dashboard-stats-grid { grid-template-columns: 1fr; gap: 1rem; }
    
    /* Pagination */
    .pagination { justify-content: center; width: 100%; flex-wrap: wrap; }
    .pagination-wrapper p { margin-bottom: 0.5rem; }

    /* QR List Table to Card Conversion */
    .qr-list-card {
        background: transparent;
        padding: 0;
        border: none;
        box-shadow: none;
    }
    .qr-table, .qr-table tbody, .qr-table tr, .qr-table td {
        display: block;
        width: 100%;
    }
    .qr-table thead {
        display: none; /* Sembunyikan header tabel asli */
    }
    .qr-table tr {
        background: white;
        border-radius: 1rem;
        padding: 1.25rem;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    }
    .qr-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.75rem 0;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
        gap: 15px;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    .qr-table td:last-child { border-bottom: none; }
    .qr-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
        text-align: left;
        flex-shrink: 0;
        max-width: 40%;
    }
}

/* Generate QR Styles (pages/generate-qr.php) */
.generate-body { display: flex; flex-direction: column; min-height: 100vh; }
.generate-header { margin-bottom: 2rem; }
.generate-header h1 { font-size: 1.75rem; font-weight: 700; color: var(--text-dark); margin: 0; }
.generate-container { display: flex; justify-content: center; }
.generate-card { background: white; padding: 2rem; border-radius: 1rem; border: 1px solid var(--border-color); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05); }
.generate-card { width: 100%; max-width: 600px; }
.generate-form-group { margin-bottom: 1.5rem; }
.generate-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-dark); margin-bottom: 0.5rem; }
.generate-input, .generate-textarea { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border-color); border-radius: 0.5rem; font-family: inherit; font-size: 0.95rem; transition: all 0.2s; outline: none; }
.generate-input:focus, .generate-textarea:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.generate-textarea { resize: vertical; min-height: 100px; }
.generate-preview-card { background: white; padding: 2rem; border-radius: 1rem; border: 1px solid var(--border-color); text-align: center; position: sticky; top: 2rem; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05); }
.generate-preview-title { font-weight: 600; margin-bottom: 1rem; color: var(--text-dark); font-size: 1.1rem; }
#canvas { background: #ffffff; border-radius: 0.75rem; padding: 20px; display: inline-block; margin-bottom: 1.5rem; border: 1px solid #f1f5f9; box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
.generate-download-group { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1rem; }
.generate-btn-download { flex: 1; padding: 0.75rem; border-radius: 0.5rem; border: none; font-weight: 600; cursor: pointer; transition: transform 0.2s, opacity 0.2s; font-size: 0.875rem; }
.generate-btn-png { background: #059669; color: white; }
.generate-btn-svg { background: #6366f1; color: white; }
.generate-btn-view { background: var(--primary-color); color: white; }
.generate-btn-download:hover { opacity: 0.9; transform: translateY(-1px); }
.generate-alert { padding: 1rem 1.25rem; border-radius: 0.75rem; margin-bottom: 2rem; font-size: 0.9rem; border: 1px solid; display: flex; align-items: center; gap: 0.75rem; }
.generate-alert-info { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.generate-submit-btn { width: 100%; background: var(--primary-color); color: white; padding: 1rem; border: none; border-radius: 0.5rem; font-weight: 600; cursor: pointer; margin-top: 1rem; transition: all 0.2s; box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2); }
.generate-submit-btn:hover { background: var(--primary-hover); }

/* Modal Styles */
.profile-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.profile-section { margin-bottom: 0; } /* Default for desktop */

.generate-modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); backdrop-filter: blur(4px); align-items: center; justify-content: center; }
.generate-modal-content { background: white; border-radius: 1rem; width: 90%; max-width: 500px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); overflow: hidden; animation: modalSlide 0.3s ease-out; }
@keyframes modalSlide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.generate-modal-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.generate-modal-header h3 { margin: 0; color: var(--text-dark); }
.close-modal { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.generate-modal-body { padding: 2rem; text-align: center; }
#modal-canvas { margin-bottom: 1.5rem; display: inline-block; padding: 1rem; background: #f8fafc; border-radius: 0.5rem; }
.modal-info { text-align: left; margin-bottom: 1.5rem; background: #f1f5f9; padding: 1rem; border-radius: 0.5rem; }
.modal-info p { margin: 0.5rem 0; font-size: 0.9rem; color: var(--text-main); word-break: break-word; overflow-wrap: anywhere; }

@media (max-width: 1024px) {
    .generate-container { grid-template-columns: 1fr; }
    .generate-preview-card { position: static; }
}

@media (max-width: 768px) {
    /* ... (existing mobile styles) ... */
    .profile-grid-container {
        grid-template-columns: 1fr; /* Stack items vertically */
        gap: 1rem; /* Adjust gap for mobile */
    }
}

/* PDF Stamping Workspace Styles */
.pdf-preview-workspace {
    background: #525659;
    border-radius: 0.75rem;
    padding: 30px;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

.pdf-page-wrapper {
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
    background: white;
    line-height: 0;
    transition: transform 0.2s;
}

.pdf-page-wrapper:hover {
    transform: scale(1.01);
}

.pdf-page-canvas {
    cursor: crosshair;
    max-width: 100%;
    height: auto;
}

.pdf-controls-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.pdf-page-label {
    position: absolute;
    top: -25px;
    left: 0;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.qr-ghost-preview {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px dashed var(--primary-color);
    background-color: rgba(37, 99, 235, 0.2);
    pointer-events: none; /* Agar tidak menghalangi klik pada canvas */
    display: none;
    z-index: 10;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.7;
}

/* PDF Stamping Styles */
.pdf-preview-workspace {
    background: #525659;
    border-radius: 0.75rem;
    padding: 30px;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--border-color);
}
.pdf-page-wrapper {
    position: relative;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    background: white;
    line-height: 0;
}
.pdf-page-canvas {
    cursor: crosshair;
    max-width: 100%;
    height: auto;
}
.pdf-controls-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid var(--border-color);
}

/* PDF Stamping Styles */
.pdf-preview-container {
    position: relative;
    width: 100%;
    max-height: 70vh;
    overflow: auto;
    background: #525659;
    border-radius: 0.5rem;
    padding: 20px;
    display: flex;
    justify-content: center;
}
#pdf-canvas {
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    cursor: crosshair;
}
.pdf-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

/* Output QR Page Styles (pages/output-qr.php) */
.output-qr-body {
    display: flex; /* Keep flex for sticky footer */
    flex-direction: column; /* Keep for sticky footer */
    min-height: 100vh; /* Keep for sticky footer */
    background-color: var(--bg-color);
}

.output-qr-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    transition: margin-left 0.3s ease; /* Keep transition */
    margin-left: 0; /* Default to 0 margin */
}

.output-qr-card { 
    width: 100%;
    max-width: 500px;
    background: white; 
    padding: 1.25rem;
    border-radius: 1rem; 
    border: none; 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05); 
}
.output-qr-header { text-align: center; margin-bottom: 0.75rem; position: relative; }
.output-qr-icon-badge { width: 48px; height: 48px; background: #eff6ff; border-radius: 1rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 0.75rem; font-size: 1.25rem; border: 1px solid #dbeafe; }
.output-qr-header h1 { font-size: 1.35rem; font-weight: 800; color: var(--text-dark); margin-bottom: 0.25rem; letter-spacing: -0.025em; }
.output-qr-header p { color: var(--text-muted); font-size: 0.875rem; font-weight: 400; margin-top: 0.5rem; }
.output-qr-detail-item { margin-bottom: 0.5rem; /* Shortened margin */ padding-bottom: 0.3rem; /* Shortened padding */ border-bottom: 1px solid #f1f5f9; }
.output-qr-detail-item:last-of-type { border-bottom: none; }
.output-qr-label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
.output-qr-value { font-size: 1rem; color: var(--text-dark); font-weight: 500; line-height: 1.4; }
.output-qr-description { 
    white-space: pre-wrap; 
    background: #f8fafc; 
    padding: 1rem; /* Shortened padding */
    border-radius: 0.75rem; 
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.output-qr-link { color: var(--primary-color); text-decoration: none; word-break: break-all; }
.output-qr-link:hover { text-decoration: underline; }
.output-qr-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; /* Shortened margin */ }
.output-qr-back-btn, .output-qr-generate-btn {
    flex: 1;
    padding: 0.85rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}
.output-qr-back-btn { background: #e2e8f0; color: var(--text-dark); border: 1px solid #cbd5e1; }
.output-qr-back-btn:hover { background: #cbd5e1; transform: translateY(-1px); }
.output-qr-generate-btn { background: var(--primary-color); color: white; border: 1px solid var(--primary-color); }
.output-qr-generate-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }

/* QR List Styles (pages/qr-list.php) */
.qr-list-body { display: flex; flex-direction: column; min-height: 100vh; }
.qr-list-card { background: white; padding: 1.5rem; border-radius: 1rem; border: 1px solid var(--border-color); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); overflow-x: auto; }
.qr-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.qr-table th { background: #f8fafc; text-align: left; padding: 1rem; border-bottom: 2px solid var(--border-color); color: var(--text-dark); font-weight: 600; font-size: 0.875rem; white-space: nowrap; }
.qr-table td { padding: 1rem; border-bottom: 1px solid var(--border-color); color: var(--text-main); font-size: 0.875rem; vertical-align: middle; }
.qr-table tr:hover { background: #f8fafc; }
.btn-action { padding: 0.5rem 0.75rem; border-radius: 0.375rem; text-decoration: none; font-size: 0.75rem; font-weight: 600; transition: all 0.2s; display: inline-flex; align-items: center; gap: 0.4rem; }
.btn-action-view { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.btn-action-view:hover { background: #2563eb; color: white; }
.btn-action-edit { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.btn-action-edit:hover { background: #d97706; color: white; }
.btn-action-success { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.btn-action-success:hover { background: #059669; color: white; }
.btn-action-delete { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn-action-delete:hover { background: #dc2626; color: white; }
.badge-signature { background: #ecfdf5; color: #059669; padding: 0.25rem 0.5rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 600; border: 1px solid #a7f3d0; }
/* Role Badges */
.badge-role { padding: 0.2em 0.6em; border-radius: 0.25em; font-size: 0.75em; font-weight: 600; line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline; display: inline-block; }
.badge-superadmin { background-color: #fef2f2; color: #dc2626; border: 1px solid #fecaca; } /* Merah */
.badge-admin { background-color: #fffbeb; color: #d97706; border: 1px solid #fde68a; } /* Oranye */
.badge-user { background-color: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; } /* Biru */

/* Animations for Live Timer */
@keyframes pulse-timer { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }

/* Pagination Styles */
.btn-pagination { display: flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border-color); background: white; color: var(--text-main); text-decoration: none; font-size: 0.875rem; transition: all 0.2s; }
.btn-pagination:hover { border-color: var(--primary-color); color: var(--primary-color); }
.btn-pagination.active { background: var(--primary-color); border-color: var(--primary-color); color: white; font-weight: 600; }
.pagination-dots { display: flex; align-items: center; color: var(--text-muted); padding: 0 4px; }

@media (max-width: 768px) {
    .pagination-wrapper { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (max-width: 576px) {
    /* Penyesuaian teks di dalam Modal */
    .generate-modal-header h3 { font-size: 1.1rem; }
    .generate-modal-body { padding: 1.25rem; }
    .modal-info p { font-size: 0.8rem; }
    .generate-btn-download { font-size: 0.75rem; padding: 0.6rem; }

    /* Penyesuaian teks Detail QR (juga berdampak pada iframe modal) */
    .output-qr-main { padding: 1rem; justify-content: flex-start; }
    .output-qr-card { padding: 1.25rem; border-radius: 1rem; }
    .output-qr-header { margin-bottom: 1.25rem; }
    .output-qr-header h1 { font-size: 1.35rem; }
    .output-qr-value { font-size: 0.95rem; }
    .output-qr-label { font-size: 0.65rem; }
}

/* Signature Watermark Overlay */
.signature-watermark-wrapper {
    position: relative;
    display: inline-flex;
    border-radius: 4px;
    overflow: hidden;
}
.signature-watermark-wrapper::after {
    content: "GPM SYALOOM";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: 7px;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.12);
    pointer-events: none;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}