/* ============================================
   QR Generator Pro - Stylesheet
   Modern dark theme with glassmorphism
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(51, 65, 85, 0.7);
    --border-color: rgba(100, 116, 139, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --pending: #f59e0b;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --bg-inset: rgba(30, 41, 59, 0.45);
    --bg-inset-hover: rgba(51, 65, 85, 0.6);
    --bg-inset-strong: rgba(15, 23, 42, 0.8);
    --bg-input: rgba(30, 41, 59, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        var(--bg-primary);
}

/* ============================================
   Sidebar Styles
   ============================================ */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.logo-text {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

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

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.support-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.support-link:hover {
    color: var(--text-primary);
}

.support-link svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Main Content Styles
   ============================================ */
.main-content {
    padding: 24px 32px;
    overflow-y: auto;
    max-height: 100vh;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.main-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-bell {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    border: 1px solid var(--border-color);
}

.notification-bell:hover {
    background: var(--bg-card-hover);
}

.notification-bell svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent-primary);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ============================================
   Upload Section Styles
   ============================================ */
.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.upload-section-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Card Preview in sidebar */
.card-preview-container {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.card-placeholder svg {
    width: 80px;
    height: 80px;
    opacity: 0.3;
}

.card-placeholder p {
    font-size: 0.85rem;
}

.card-display {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.card-display img {
    width: 100%;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.qr-preview-small {
    min-height: 140px;
    padding: 12px;
}

.qr-preview-small .qr-placeholder svg {
    width: 60px;
    height: 60px;
}

#card-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

/* Card dimension info */
.card-dimension-info {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dimension-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dimension-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dim-input {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.dim-input span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 14px;
}

.dim-input input {
    width: 100%;
    padding: 4px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    text-align: center;
}

.dim-separator {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.dimension-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.3;
}

/* Card Layout Position Controls */
.card-layout-section {
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.card-layout-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.position-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.position-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.position-group>label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.position-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}

.pos-input {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
}

.pos-input span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 14px;
}

.pos-input input {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: monospace;
    outline: none;
    padding: 2px;
}

.pos-input input:focus {
    color: var(--accent-secondary);
}

.pos-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Font selector */
.font-select {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 10px;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
}

.font-select:focus {
    border-color: var(--accent-primary);
}

/* Field style row - inline color + font per field */
.field-style-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.field-style-row .font-select {
    flex: 1;
    min-width: 0;
}

.color-input-wrapper.compact {
    flex-shrink: 0;
    gap: 4px;
}

.color-input-wrapper.compact input[type="color"] {
    width: 28px;
    height: 28px;
}

.color-input-wrapper.compact .color-value {
    font-size: 0.7rem;
}

/* Settings Modal */
.settings-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    width: 560px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* wider variant for modals containing data tables (user/approval management) */
.settings-modal.settings-modal-wide {
    width: 860px;
}

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

.settings-modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.settings-close-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.settings-close-btn svg {
    width: 20px;
    height: 20px;
}

.settings-modal-body {
    padding: 24px;
    overflow-y: auto;
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.settings-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.font-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.font-upload-zone:hover,
.font-upload-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.05);
}

.font-upload-zone svg {
    width: 36px;
    height: 36px;
    color: var(--accent-primary);
    opacity: 0.6;
}

.font-upload-zone p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.font-upload-zone .upload-formats {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.font-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.font-list-empty {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.font-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.font-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.font-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.font-item-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.font-item-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.font-item-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.font-item-delete svg {
    width: 16px;
    height: 16px;
}

.upload-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.upload-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    align-self: flex-start;
}

.upload-zone {
    width: 100%;
    min-height: 180px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-inset);
}

.upload-zone:hover {
    border-color: var(--accent-primary);
    background: var(--bg-inset-hover);
}

.upload-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.upload-icon svg {
    width: 32px;
    height: 32px;
}

#logo-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.upload-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.upload-formats {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-generate {
    width: 100%;
    padding: 16px 32px;
    font-size: 1rem;
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.btn-generate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.5);
}

.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-generate svg {
    width: 20px;
    height: 20px;
}

.file-info {
    font-size: 0.85rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 24px;
}

/* ============================================
   Data Table Styles
   ============================================ */
.data-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.data-table-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-height: 350px;
    overflow-y: auto;
}

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

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-inset-strong);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover:not(.empty-state) {
    background: rgba(139, 92, 246, 0.1);
}

.data-table td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.data-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.status-badge.generated {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.empty-state td {
    padding: 48px;
}

.empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.empty-message svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

/* ============================================
   Preview Panel Styles
   ============================================ */
.preview-panel {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.preview-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qr-preview-container {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
}

.qr-placeholder svg {
    width: 120px;
    height: 120px;
    opacity: 0.3;
}

.qr-placeholder p {
    font-size: 0.9rem;
}

.qr-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#qr-canvas {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius-sm);
}

.qr-info {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.qr-info strong {
    color: var(--text-primary);
    display: block;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.qr-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.nav-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

.qr-counter {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 60px;
    text-align: center;
}

/* Download Section */
.download-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.btn-download {
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-download:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.btn-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-download svg {
    width: 18px;
    height: 18px;
}

.btn-download-secondary {
    width: 100%;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-download-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.btn-download-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-download-secondary svg {
    width: 18px;
    height: 18px;
}

.export-format {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.export-format label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.export-format select {
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

.export-format select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ============================================
   Color Picker Styles
   ============================================ */
.color-section {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.color-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.color-picker-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-picker-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.color-picker-item label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input-wrapper input[type="color"] {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
    overflow: hidden;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-input-wrapper input[type="color"]:hover {
    border-color: var(--accent-primary);
}

.color-value {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
    text-transform: uppercase;
}

/* ============================================
   Shape Selector Styles
   ============================================ */
.shape-section {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.shape-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    margin-top: 12px;
}

.shape-section h4:first-child {
    margin-top: 0;
}

.shape-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.shape-btn {
    width: 100%;
    aspect-ratio: 1;
    padding: 6px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.shape-btn svg {
    width: 100%;
    height: 100%;
}

.shape-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.shape-btn.active {
    border-color: var(--accent-primary);
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-primary);
}

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================
   Toast Notification
   ============================================ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

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

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

.toast-message {
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1400px) {
    .app-container {
        grid-template-columns: 240px 1fr 280px;
    }
}

@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 220px 1fr;
    }

    .preview-panel {
        display: none;
    }
}

@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .upload-section {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 16px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Save Project Button
   ============================================ */

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-save-project {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save-project svg {
    width: 16px;
    height: 16px;
}

.btn-save-project:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* ============================================
   History Page
   ============================================ */

.page-content {
    flex: 1;
    overflow-y: auto;
}

.history-container {
    padding: 24px;
    max-width: 1200px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.history-header h2 {
    font-size: 1.4rem;
    color: var(--text-primary);
}

.history-actions {
    display: flex;
    gap: 8px;
}

.btn-import {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(100, 116, 139, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-import svg {
    width: 16px;
    height: 16px;
}

.btn-import:hover {
    background: rgba(100, 116, 139, 0.5);
    border-color: var(--accent-primary);
}

/* Workspace Grid */

.workspace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.workspace-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.workspace-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.workspace-empty p {
    font-size: 1rem;
    margin-bottom: 4px;
}

.workspace-empty span {
    font-size: 0.8rem;
}

/* Workspace Card */

.workspace-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    cursor: default;
}

.workspace-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.workspace-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.workspace-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.workspace-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 8px;
}

.workspace-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.workspace-meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(100, 116, 139, 0.2);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.workspace-meta-tag svg {
    width: 12px;
    height: 12px;
}

.workspace-card-actions {
    display: flex;
    gap: 8px;
}

.workspace-card-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.workspace-card-actions .btn svg {
    width: 14px;
    height: 14px;
}

.btn-load {
    background: var(--accent-gradient);
    color: white;
}

.btn-load:hover {
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}

.btn-export {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
}

.btn-export:hover {
    background: rgba(34, 197, 94, 0.25);
}

.btn-delete-ws {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.btn-delete-ws:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* ============================================
   Save Modal
   ============================================ */

.save-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.save-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

.save-modal-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.save-modal-body {
    padding: 24px;
}

.save-modal-body label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.workspace-name-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.workspace-name-input:focus {
    border-color: var(--accent-primary);
}

.save-modal-info {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.save-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.save-modal-footer .btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.btn-secondary {
    background: rgba(100, 116, 139, 0.3);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(100, 116, 139, 0.5);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.card-icon-bg {
    background: #e0f2fe;
    color: #0ea5e9;
}

.qr-icon-bg {
    background: #f0fdf4;
    color: #22c55e;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

/* Chart Container */
.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.chart-actions select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-color);
    outline: none;
}

.canvas-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Dashboard Mode - Hide Preview Panel */
.app-container.dashboard-mode {
    grid-template-columns: 260px 1fr;
}

.app-container.dashboard-mode .preview-panel {
    display: none;
}

/* Updated Workspace Card UI */
.workspace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.workspace-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.workspace-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.workspace-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.workspace-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 1rem;
    line-height: 1.4;
}

.workspace-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.workspace-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.workspace-meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.workspace-meta-tag svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.workspace-card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.workspace-card-actions .btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    flex: 1;
}

.btn-load {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-primary);
}

.btn-load:hover {
    background: rgba(139, 92, 246, 0.2);
}

.btn-export {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
}

.btn-export:hover {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-primary);
}

.btn-delete-ws {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    padding: 8px;
    flex: 0 0 auto;
}

.btn-delete-ws:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Member photo card (Generate Card page) */
.photo-card { margin-top: 24px; }
.photo-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.photo-card .photo-summary { margin-top: 14px; }
.photo-card #photo-list { margin-top: 10px; }
/* center the browse button */
.photo-card #photo-browse-btn { display: block; margin: 14px auto 0; }

/* photo-from-URL */
.photo-url-block { margin-top: 20px; }
.photo-url-divider {
    display: flex; align-items: center; gap: 12px;
    color: var(--text-muted); font-size: 0.8rem; margin-bottom: 12px;
}
.photo-url-divider::before, .photo-url-divider::after {
    content: ""; flex: 1; height: 1px; background: var(--border-color);
}
.photo-url-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.photo-url-input {
    padding: 10px 12px; border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); background: var(--bg-input);
    color: var(--text-primary); font-size: 0.9rem;
}
.photo-url-input#photo-url-nomor { width: 160px; }
.photo-url-link { flex: 1 1 240px; min-width: 200px; }
.photo-url-row .btn { flex: 0 0 auto; }
.photo-url-input:focus { outline: none; border-color: var(--accent-primary); }

/* member photo thumbnail in data table */
.photo-cell { width: 56px; }
.row-photo {
    width: 36px; height: 46px; object-fit: cover;
    border-radius: 4px; border: 1px solid var(--border-color); display: block;
}
.photo-na { color: var(--text-muted); font-size: 0.8rem; font-style: italic; }

/* Photo management — catchy switch banner */
.photo-switch {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: var(--bg-inset);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.photo-switch:hover { border-color: var(--accent-secondary); }
.photo-switch:has(input:checked) {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.10), rgba(99, 102, 241, 0.06));
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.photo-switch__icon {
    flex: 0 0 auto;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    color: #fff;
}
.photo-switch__icon svg { width: 24px; height: 24px; }
.photo-switch__text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.photo-switch__text strong { font-size: 1rem; color: var(--text-primary); }
.photo-switch__text small { font-size: 0.82rem; color: var(--text-secondary); }

/* iOS-style toggle */
.switch { flex: 0 0 auto; position: relative; width: 52px; height: 30px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider {
    position: absolute; inset: 0; cursor: pointer;
    background: var(--border-color); border-radius: 999px;
    transition: background 0.2s;
}
.switch__slider::before {
    content: ""; position: absolute; height: 24px; width: 24px;
    left: 3px; top: 3px; background: #fff; border-radius: 50%;
    transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch input:checked + .switch__slider { background: var(--accent-primary); }
.switch input:checked + .switch__slider::before { transform: translateX(22px); }

/* info hint line inside photo card */
.photo-hint {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 16px 0 4px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(139, 92, 246, 0.07);
    border: 1px solid rgba(139, 92, 246, 0.2);
    font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5;
}
.photo-hint svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--accent-primary); margin-top: 1px; }

.settings-desc code, .photo-hint code {
    background: var(--bg-inset);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}
.photo-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.15s, background 0.15s;
}
.radio-option:has(input:checked) {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.08);
}
.radio-option input { accent-color: var(--accent-primary); cursor: pointer; }
.photo-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 14px 0 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Saved Workspaces — table view */
.ws-table-wrap {
    grid-column: 1 / -1;
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.ws-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.ws-table thead th {
    text-align: left;
    padding: 14px 18px;
    background: var(--bg-inset-strong);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.ws-table tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    white-space: nowrap;
    vertical-align: middle;
}
.ws-table tbody tr:last-child td { border-bottom: none; }
.ws-table tbody tr:hover { background: var(--bg-inset); }
.ws-col-no { width: 48px; color: var(--text-muted); }
.ws-col-count, .ws-col-time { color: var(--text-secondary); }
.ws-col-act { width: 96px; }

.ws-name-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--accent-primary);
    cursor: pointer;
    text-align: left;
    white-space: normal;
}
.ws-name-link:hover { text-decoration: underline; color: var(--accent-secondary); }

.ws-icon-btn {
    background: rgba(148, 163, 184, 0.12);
    border: none;
    border-radius: var(--radius-sm);
    padding: 7px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s;
}
.ws-icon-btn svg { width: 16px; height: 16px; display: block; }
.ws-icon-btn + .ws-icon-btn { margin-left: 6px; }
.ws-icon-btn:hover { background: rgba(148, 163, 184, 0.25); color: var(--text-primary); }
.ws-icon-danger { background: rgba(239, 68, 68, 0.1); color: var(--error); }
.ws-icon-danger:hover { background: rgba(239, 68, 68, 0.2); color: var(--error); }

/* ============================================================
   Light theme (toggle via <html data-theme="light">)
   ============================================================ */
html[data-theme="light"] {
    --bg-primary: #eef2f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-hover: rgba(241, 245, 249, 0.95);
    --border-color: rgba(100, 116, 139, 0.28);
    --text-primary: #0f172a;
    --text-color: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(15, 23, 42, 0.08);
    --bg-inset: #e6eaf0;
    --bg-inset-hover: #f1f4f9;
    --bg-inset-strong: #eef1f6;
    --bg-input: #ffffff;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.14);
}
html[data-theme="light"] body { background: var(--bg-primary); color: var(--text-primary); }
html[data-theme="light"] .user-avatar img { background: var(--accent-primary); }

/* ============================================================
   Account modules (profile + users/RBAC)
   ============================================================ */
.acct-grid { display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; align-items: center; }
.acct-grid label { color: var(--text-secondary); font-size: 13px; }
.acct-static { color: var(--text-primary); font-weight: 500; word-break: break-all; }

.acct-form { display: flex; gap: 10px; flex-wrap: wrap; }
.acct-form-col { flex-direction: column; }
.acct-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
.acct-form-grid button { grid-column: 1 / -1; }

#profile-modal input, #users-modal input, #users-modal select,
.acct-form input, .acct-form select {
    flex: 1 1 auto; min-width: 160px;
    padding: 10px 12px; font-size: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}
#profile-modal input:focus, #users-modal input:focus, #users-modal select:focus {
    outline: none; border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}
.acct-form .btn, .acct-form-grid .btn { flex: 0 0 auto; }
.btn.btn-primary {
    background: var(--accent-gradient); color: #fff; border: none;
    padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer;
}
.btn.btn-primary:hover { opacity: .95; }

.users-table-wrap { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.users-table th, .users-table td {
    text-align: left; padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.users-table th { color: var(--text-secondary); font-weight: 600; }
.users-table td { color: var(--text-primary); }
/* email is the only column allowed to grow/break so short columns never fold */
.users-table td.col-email, .users-table th.col-email { white-space: normal; word-break: break-all; width: 100%; }
.users-table select { padding: 6px 8px; }

.acct-msg { font-size: 13px; margin-top: 14px; padding: 0; }
.acct-msg.error { color: var(--error); }
.acct-msg.ok { color: var(--success); }

/* ============================================================
   Account modules v2 (polished) — profile + users/RBAC
   ============================================================ */
.acct-body { display: flex; flex-direction: column; gap: 22px; max-height: 68vh; overflow-y: auto; }
.acct-body::-webkit-scrollbar { width: 8px; }
.acct-body::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 8px; }

.acct-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px 18px;
}
.acct-row {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 13px 0; border-bottom: 1px solid var(--border-color);
}
.acct-row:last-child { border-bottom: none; }
.acct-label { color: var(--text-secondary); font-size: 13px; }
.acct-val { color: var(--text-primary); font-weight: 600; font-size: 14px; text-align: right; word-break: break-all; }
.acct-badge {
    display: inline-block; padding: 4px 12px; border-radius: 999px;
    background: rgba(139, 92, 246, 0.16); color: var(--accent-secondary);
    font-size: 12px; font-weight: 600; text-transform: capitalize;
}

.acct-section h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 0 0 12px; }
.acct-inline { display: flex; gap: 10px; align-items: stretch; }
.acct-stack { display: flex; flex-direction: column; gap: 14px; }
.acct-field { display: flex; flex-direction: column; gap: 6px; }
.acct-field label { font-size: 12px; color: var(--text-secondary); }
.acct-usergrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.acct-usergrid .btn-block { grid-column: 1 / -1; }

.acct-input {
    width: 100%; padding: 11px 13px; font-size: 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary); transition: border-color .15s, box-shadow .15s;
}
.acct-input::placeholder { color: var(--text-muted); }
.acct-input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22); }
.acct-inline .acct-input { flex: 1 1 auto; }

.btn.btn-primary {
    background: var(--accent-gradient); color: #fff; border: none;
    padding: 11px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
    cursor: pointer; white-space: nowrap; transition: opacity .15s, transform .06s;
}
.btn.btn-primary:hover { opacity: .93; }
.btn.btn-primary:active { transform: translateY(1px); }
.btn.btn-block { width: 100%; }

.users-table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.users-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.users-table th, .users-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-color); }
.users-table tbody tr:last-child td { border-bottom: none; }
.users-table tbody tr:hover { background: var(--bg-card-hover); }
.users-table th { color: var(--text-secondary); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.users-table td { color: var(--text-primary); }
.users-table select {
    padding: 7px 10px; background: var(--bg-primary); color: var(--text-primary);
    border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-size: 13px;
}

.acct-msg { font-size: 13px; padding: 0; min-height: 18px; }
.acct-msg.error { color: var(--error); background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); padding: 10px 12px; border-radius: var(--radius-sm); }
.acct-msg.ok { color: var(--success); background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); padding: 10px 12px; border-radius: var(--radius-sm); }

@media (max-width: 560px) { .acct-usergrid { grid-template-columns: 1fr; } }

/* Registration approval actions */
.reg-actions { display: flex; gap: 8px; white-space: nowrap; }
.reg-actions button { padding: 6px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--border-color); }
.reg-actions .btn-approve { background: var(--success); color: #fff; border-color: transparent; }
.reg-actions .btn-reject { background: transparent; color: var(--error); border-color: rgba(239,68,68,.4); }
.reg-actions button:hover { opacity: .9; }

/* Sidebar nav badge (e.g. pending approvals count) */
.nav-item .nav-badge {
    margin-left: auto;
    background: var(--error);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 999px;
}
