/* ============================================
   COLOR PALETTE & DESIGN TOKENS
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --secondary: #7c3aed;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --neutral-50: #f9fafb;
    --neutral-100: #f3f4f6;
    --neutral-200: #e5e7eb;
    --neutral-300: #d1d5db;
    --neutral-400: #9ca3af;
    --neutral-500: #6b7280;
    --neutral-600: #4b5563;
    --neutral-700: #374151;
    --neutral-800: #1f2937;
    --neutral-900: #111827;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.1);
    --transition: 250ms cubic-bezier(0.4,0,0.2,1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #f8fafc;
    color: var(--neutral-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   LAYOUT
   ============================================ */

.admin-app {
    display: none !important;
    visibility: hidden !important;
    min-height: 100vh;
}

.admin-app.ready {
    display: flex !important;
    visibility: visible !important;
}

.sidebar {
    width: 260px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    position: fixed;
    height: 100vh;
    box-shadow: var(--shadow-lg);
}

.main-content {
    margin-left: 260px;
    flex: 1;
    overflow-y: auto;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.logo {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.tagline {
    font-size: 0.75rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: transparent;
    color: rgba(255,255,255,.7);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.9375rem;
    font-weight: 500;
    width: 100%;
    text-align: left;
}

.nav-link:hover {
    background: rgba(255,255,255,.1);
    color: white;
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

.nav-link i {
    font-size: 1.1rem;
    width: 1.5rem;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,.1);
}

.btn-view-public {
    width: 100%;
    padding: 0.75rem;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.5);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-view-public:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
}

/* ============================================
   HEADER
   ============================================ */

.admin-header {
    padding: 2rem;
    background: white;
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    flex: 1;
    min-width: 0;
}

.sidebar-toggle-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--neutral-700);
    font-size: 1.25rem;
    padding: 0.5rem;
    margin-right: 0.75rem;
    cursor: pointer;
    border-radius: 8px;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: var(--neutral-100);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 998;
}

.sidebar-backdrop.open {
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    font-size: 0.9375rem;
    color: var(--neutral-600);
    font-weight: 500;
}

.btn-logout {
    background: var(--error);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    background: #dc2626;
}

.admin-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--neutral-600);
    font-size: 0.9375rem;
}

/* ============================================
   TAB CONTENT
   ============================================ */

.tab-content {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   SECTION HEADER
   ============================================ */

.section-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.select-input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--neutral-200);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    background: white;
    color: var(--neutral-900);
    cursor: pointer;
    transition: all var(--transition);
    min-width: 200px;
}

.select-input:hover,
.select-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--neutral-100);
    color: var(--neutral-900);
    border: 1px solid var(--neutral-300);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition);
}

.btn-secondary:hover {
    background: var(--neutral-200);
}

.btn-danger {
    padding: 0.5rem 1rem;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all var(--transition);
}

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

/* ============================================
   FORMS
   ============================================ */

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--neutral-200);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all var(--transition);
    margin-bottom: 1rem;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.form-card h3 {
    margin-bottom: 1rem;
    color: var(--neutral-900);
}

/* ============================================
   UPLOAD AREA
   ============================================ */

.upload-area {
    border: 2px dashed var(--neutral-300);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--neutral-50);
    margin-bottom: 1rem;
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-area i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: var(--neutral-600);
    font-size: 0.9375rem;
}

.file-input-wrapper {
    margin-bottom: 1rem;
}

.file-input-wrapper label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--neutral-700);
}

.file-input-wrapper input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--neutral-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

/* ============================================
   ITEMS GRID
   ============================================ */

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

.item-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border-left: 4px solid var(--primary);
}

.item-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.item-name {
    font-weight: 600;
    color: var(--neutral-900);
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.item-meta {
    font-size: 0.8125rem;
    color: var(--neutral-500);
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.item-category {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.75rem;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.item-actions button {
    flex: 1;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--neutral-500);
    cursor: pointer;
    transition: all var(--transition);
}

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

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--neutral-900);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease-out;
    min-width: 300px;
    border-left: 4px solid;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

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

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--neutral-500);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
        padding: 1.5rem 1rem;
    }

    .main-content {
        margin-left: 200px;
    }

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

    .items-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -200px;
        height: 100vh;
        z-index: 999;
        transition: left var(--transition);
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .admin-header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .header-right {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .tab-content {
        padding: 1.5rem;
    }

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

    .select-input {
        min-width: auto;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        top: 1rem;
    }

    .toast {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .admin-header h2 {
        font-size: 1.25rem;
    }

    .tab-content {
        padding: 1rem;
    }

    .modal-content {
        width: 95%;
    }

    .items-grid {
        gap: 1rem;
    }

    .file-drop-zone {
        padding: 1rem;
        min-height: 80px;
    }
}

/* ============================================
   FILE UPLOAD STYLES
   ============================================ */

.file-drop-zone {
    border: 2px dashed #2563eb;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8fafc;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.file-drop-zone:hover {
    border-color: #1e40af;
    background-color: #eff6ff;
}

.file-drop-zone.dragover {
    border-color: #1e40af;
    background-color: #dbeafe;
}

.file-drop-zone i {
    font-size: 3.5rem;
    color: #2563eb;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.file-drop-zone:hover i.file-select-icon {
    font-size: 4rem;
    color: #1e40af;
    transform: scale(1.1);
}

.file-drop-zone p {
    margin: 0.5rem 0;
    color: #334155;
}

.file-drop-zone p:first-of-type {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.file-drop-zone p:last-of-type {
    font-size: 0.875rem;
    color: #64748b;
}

/* Activity Logs Styles */
.logs-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-entry {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.log-entry:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.log-action {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    background: #f0f9ff;
    padding: 4px 8px;
    border-radius: 4px;
}

.log-user {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.log-time {
    font-size: 12px;
    color: #94a3b8;
    margin-left: auto;
}

.log-details {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    padding: 8px 0;
}

.log-details strong {
    color: #1e293b;
    font-weight: 600;
}

.log-details code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
}

.search-input {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    flex: 1;
    min-width: 250px;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* MSP Fee Info Compact Display */
.msp-fee-info-compact {
    display: block;
    margin-bottom: 16px;
}

.msp-fee-info-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #f0f7ff 0%, #eff6ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 12px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.msp-fee-info-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.msp-fee-info-label i {
    font-size: 0.9rem;
}

.msp-fee-info-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e40af;
    font-family: 'Monaco', 'Menlo', monospace;
    min-width: 60px;
    text-align: center;
}

.msp-fee-info-note {
    margin-left: auto;
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .msp-fee-info-box {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .msp-fee-info-note {
        margin-left: 0;
        width: 100%;
    }
}

/* Admin Loading Overlay */
.admin-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.admin-loading-overlay.hidden {
    display: none;
}

.admin-loading-content {
    text-align: center;
}

.admin-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.admin-loading-overlay p {
    color: #666;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

/* ============================================
   RICH TEXT EDITOR - WALL CONTENT
   ============================================ */

.rich-text-editor {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    overflow: visible;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    overflow: visible;
    position: relative;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow: visible;
    position: relative;
}

.toolbar-divider {
    width: 1px;
    height: 28px;
    background: #d1d5db;
    margin: 0 0.25rem;
}

.editor-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    color: #374151;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}

.editor-btn:hover::after {
    content: attr(data-shortcut);
    position: absolute;
    bottom: -30px;
    left: 0;
    background: #1f2937;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.65rem;
    white-space: nowrap;
    z-index: 2000;
    pointer-events: none;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    width: max-content;
    max-width: none;
    overflow: visible;
}

/* Tooltips for select buttons (heading, line spacing) - show ABOVE */
.editor-select:hover::after {
    bottom: auto;
    top: -28px;
    left: 0;
    width: max-content;
}

.editor-btn:hover {
    background: #e5e7eb;
    border-color: #2563eb;
    color: #2563eb;
}

.editor-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.editor-select {
    position: relative;
}

.editor-select::after {
    content: '▼';
    font-size: 0.6rem;
    position: absolute;
    bottom: 6px;
    right: 4px;
}

.heading-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    min-width: 120px;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
}

.heading-dropdown.show {
    display: block;
}

.heading-dropdown button {
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: white;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.heading-dropdown button:hover {
    background: #e5e7eb;
    color: #2563eb;
}

.heading-dropdown button:first-child {
    border-radius: 5px 5px 0 0;
}

.heading-dropdown button:last-child {
    border-radius: 0 0 5px 5px;
}

.editor-hint {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
    margin-left: auto;
    white-space: nowrap;
}

.editor-content {
    min-height: 150px;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    outline: none;
    word-break: break-word;
    white-space: pre-wrap;
}

.editor-content:focus {
    background: #fafafa;
}

.editor-content[contenteditable]:empty:before {
    content: attr(placeholder);
    color: #9ca3af;
    pointer-events: none;
}

.editor-content ul {
    margin: 0.75rem 0 0.75rem 2rem;
    padding: 0;
}

.editor-content li {
    margin: 0.5rem 0;
}

.editor-content strong {
    font-weight: 600;
    color: #1f2937;
}

/* Healthcare Editor - Highlight & Line Spacing */

.editor-content mark {
    background-color: #fbbf24;
    color: inherit;
    padding: 2px 4px;
}

.editor-content.line-spacing-1-5 {
    line-height: 1.5;
}

.editor-content.line-spacing-2 {
    line-height: 2;
}

.editor-content.line-spacing-1 {
    line-height: 1;
}

.linespacing-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    min-width: 100px;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
}

.linespacing-dropdown.show {
    display: block;
}

.linespacing-dropdown button {
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: white;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.linespacing-dropdown button:hover {
    background: #e5e7eb;
    color: #2563eb;
}

.linespacing-dropdown button:first-child {
    border-radius: 5px 5px 0 0;
}

.linespacing-dropdown button:last-child {
    border-radius: 0 0 5px 5px;
}

/* ============================================
   PROFESSIONAL FILE UPLOAD UX
   ============================================ */

.upload-step {
    margin-bottom: 1.5rem;
}

.upload-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1f2937;
    font-size: 0.95rem;
}

.upload-label i {
    color: #2563eb;
    font-size: 1rem;
}

.file-drop-zone {
    border: 2px dashed #2563eb;
    border-radius: 8px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f0f9ff;
}

.file-drop-zone:hover {
    background: #e0f2fe;
    border-color: #1e40af;
}

.file-drop-zone.dragover {
    background: #dbeafe;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.file-select-icon {
    font-size: 2.5rem;
    color: #2563eb;
    margin-bottom: 0.5rem;
    display: block;
}

.file-drop-zone p {
    margin: 0.5rem 0;
    color: #475569;
    font-size: 0.95rem;
}

.file-drop-zone p strong {
    color: #1e40af;
    font-weight: 600;
}

.file-input {
    display: none;
}

/* Upload Progress Bar */
.upload-progress {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.progress-info span:first-child {
    font-weight: 600;
    color: #1f2937;
    word-break: break-all;
}

.progress-info span:last-child {
    color: #6b7280;
    font-weight: 500;
    min-width: 40px;
    text-align: right;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #1e40af 100%);
    width: 0%;
    transition: width 0.2s ease;
}

/* Upload Status (Success/Error) */
.upload-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.upload-status.success {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

.upload-status.success i {
    color: #10b981;
    font-size: 1.25rem;
}

.upload-status.error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #7f1d1d;
}

.upload-status.error i {
    color: #ef4444;
    font-size: 1.25rem;
}

#status-content {
    flex: 1;
}

.retry-btn {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: #dc2626;
}

/* ============================================
   TinyMCE Live Preview - Matches Recruiter Display Exactly
   ============================================ */

#wc-edit-preview {
    background: white;
}

#wc-edit-preview p {
    margin: clamp(0.9rem, 2.5vw, 1.5rem) 0;
    line-height: 1.8;
}

#wc-edit-preview h1,
#wc-edit-preview h2,
#wc-edit-preview h3 {
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.5px;
    margin: clamp(1.25rem, 3vw, 1.75rem) 0 clamp(0.5rem, 1.5vw, 0.75rem) 0;
}

#wc-edit-preview h1 {
    font-size: clamp(1.35rem, 6vw, 1.75rem);
    color: #0c4a6e;
    border-bottom: 2px solid #0c4a6e;
    padding-bottom: 0.5rem;
}

#wc-edit-preview h2 {
    font-size: clamp(1.15rem, 5vw, 1.5rem);
    color: #1e40af;
    border-left: 4px solid #1e40af;
    padding-left: 0.75rem;
}

#wc-edit-preview h3 {
    font-size: clamp(1rem, 4.5vw, 1.25rem);
    color: #2563eb;
}

#wc-edit-preview ul,
#wc-edit-preview ol {
    margin: clamp(1rem, 2.5vw, 1.5rem) 0;
    padding-left: 0;
    list-style: none;
}

#wc-edit-preview li {
    margin: clamp(1rem, 2.5vw, 1.5rem) 0;
    padding-left: 2rem;
    line-height: 1.85;
    color: #374151;
    display: block;
    position: relative;
}

#wc-edit-preview ul > li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #374151;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: inherit;
}

#wc-edit-preview ol {
    counter-reset: list-counter;
}

#wc-edit-preview ol > li {
    padding-left: 1.75rem;
    counter-increment: list-counter;
}

#wc-edit-preview ol > li:before {
    content: counter(list-counter) ".";
    position: absolute;
    left: 0;
    font-weight: 600;
    color: #374151;
}

#wc-edit-preview blockquote {
    border-left: 4px solid #2563eb;
    padding: clamp(0.75rem, 2vw, 1rem) 0 clamp(0.75rem, 2vw, 1rem) clamp(0.75rem, 2vw, 1.25rem);
    margin: clamp(1rem, 2.5vw, 1.5rem) 0;
    background: #f0f9ff;
    color: #0c4a6e;
    font-style: italic;
    line-height: 1.8;
}

#wc-edit-preview a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 500;
}

#wc-edit-preview a:hover {
    color: #1e40af;
}

#wc-edit-preview mark {
    background-color: #fbbf24;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

/* ============================================
   COMPREHENSIVE MOBILE OPTIMIZATION
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        max-width: 240px;
    }

    .main-content {
        margin-left: 240px;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 1000;
        background: white;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .header {
        padding: 1rem;
        gap: 1rem;
    }

    .search-bar {
        width: 100%;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .modal-content {
        max-width: 95%;
        padding: 1rem;
    }

    .toast {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        max-width: 90vw;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .header {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .page-header {
        padding: 0.75rem;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .btn-group {
        gap: 0.5rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.4rem;
        font-size: 0.85rem;
    }

    .modal-content {
        max-width: 98%;
        padding: 0.75rem;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    .modal-close {
        padding: 0.25rem 0.5rem;
        font-size: 1.5rem;
    }

    .toast-container {
        top: auto;
        bottom: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
    }

    .toast {
        padding: 0.5rem;
        font-size: 0.8rem;
        max-width: 100%;
        min-width: auto;
    }

    .toast i {
        font-size: 1rem;
        flex-shrink: 0;
    }

    .badge {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }

    .nav-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .card {
        padding: 0.75rem;
    }

    .card-header {
        margin-bottom: 0.5rem;
    }

    .card-title {
        font-size: 1rem;
    }
}

/* ============================================
   REPORTS MODULE STYLING
   ============================================ */

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.stat-card:nth-child(2):hover {
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.stat-card:nth-child(3):hover {
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.6);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.4);
}

.stat-card:nth-child(4):hover {
    box-shadow: 0 6px 20px rgba(67, 233, 123, 0.6);
}

.stat-card:nth-child(5) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    box-shadow: 0 4px 15px rgba(250, 112, 154, 0.4);
}

.stat-card:nth-child(5):hover {
    box-shadow: 0 6px 20px rgba(250, 112, 154, 0.6);
}

.stat-card:nth-child(6) {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    box-shadow: 0 4px 15px rgba(48, 207, 208, 0.4);
}

.stat-card:nth-child(6):hover {
    box-shadow: 0 6px 20px rgba(48, 207, 208, 0.6);
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.stat-delta {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.4rem;
    min-height: 1.1em;
    opacity: 0.95;
}

/* Recruiter analytics panel */
.ra-range-label {
    font-weight: 600;
    color: #444;
    align-self: center;
    margin-right: 0.25rem;
}

.ra-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.ra-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.ra-panel {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ra-charts-grid .ra-panel {
    margin-top: 0;
}

.ra-panel h3 {
    margin: 0 0 1rem 0;
    font-size: 1.05rem;
    color: #333;
}

.ra-chart-wrap {
    position: relative;
    height: 280px;
    width: 100%;
}

.ra-chart-wrap canvas {
    max-width: 100%;
}

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

.ra-table table.ra-mini-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ra-mini-table th,
.ra-mini-table td {
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #f0f0f0;
}

.ra-mini-table th {
    color: #777;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ra-divider {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid #eee;
}

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

.export-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #333;
}

.export-card:hover {
    border-color: #2563eb;
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.export-card i {
    font-size: 1.5rem;
    color: #2563eb;
}

.export-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   ENHANCED RESPONSIVENESS FOR ZOOM & SMALLER SCREENS
   ============================================ */

/* For zoomed-out views (90% zoom on large screens = ~1728px effective width) */
@media (max-width: 1200px) {
    .sidebar {
        width: 220px;
        padding: 1.5rem 1rem;
    }

    .main-content {
        margin-left: 220px;
    }

    .sidebar-header h1 {
        font-size: 1.1rem;
    }

    .nav-link span {
        font-size: 0.9rem;
    }

    .tab-content {
        padding: 1.5rem;
    }

    .form-grid {
        gap: 1rem;
    }

    .form-row {
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem 1rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .modal-content {
        max-width: 90%;
    }
}

/* For very compressed views (80% zoom or tighter layouts) */
@media (max-width: 1000px) {
    .sidebar {
        width: 200px;
        padding: 1.5rem 0.75rem;
    }

    .main-content {
        margin-left: 200px;
    }

    .logo {
        font-size: 2rem;
    }

    .sidebar-header h1 {
        font-size: 1rem;
    }

    .tab-content {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem 0.75rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

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

    button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .export-card {
        padding: 1rem;
    }

    .table-container {
        font-size: 0.85rem;
    }
}

/* ============================================
   MOBILE SIDEBAR - CANONICAL OVERRIDE
   This file accumulated several overlapping "responsive" sections above
   (some meant for desktop zoom levels, e.g. the 1000px/1200px "zoom" block)
   that also match phone widths and were clobbering .sidebar/.main-content
   for real mobile viewports. This block is intentionally last so it wins
   the cascade and is the single source of truth for phone-width layout.
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        width: 260px;
        max-width: 80vw;
        left: -280px;
        top: 0;
        transition: left var(--transition, 250ms ease);
        /* Restated because an earlier duplicated block sets background: white,
           which otherwise wins the cascade and makes the sidebar's white text
           invisible on mobile. */
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        color: white;
    }

    .sidebar.open,
    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0 !important;
    }
}
