@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input, textarea {
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
}

a {
    text-decoration: none;
    color: inherit;
}

:root, .theme-light, .theme-dark {
    --sidebar-bg: #ffffff;
    --sidebar-border: #E8EAF0;
    --sidebar-hover: #F4F5F8;
    --sidebar-active: #EEF0FF;
    --sidebar-text: #1A1D2E;
    --sidebar-muted: #6B7280;
    --sidebar-accent: #4F46E5;
    --bg: #F5F6FA;
    --surface: #FFFFFF;
    --surface-2: #F8F9FC;
    --surface-3: #F0F1F5;
    --border: #E8EAF0;
    --border-light: #F0F1F7;
    --text: #111827;
    --text-2: #4B5563;
    --text-3: #9CA3AF;
    --accent: #4F46E5;
    --accent-hover: #4338CA;
    --accent-dim: rgba(79,70,229,0.08);
    --accent-light: #EEF0FF;
    --danger: #EF4444;
    --danger-dim: rgba(239,68,68,0.08);
    --success: #10B981;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
    width: 256px;
    min-width: 256px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    transition: width 0.22s ease, min-width 0.22s ease;
    overflow: visible;
    position: relative;
    z-index: 10;
}

    .sidebar.collapsed {
        width: 60px;
        min-width: 60px;
    }

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: 62px;
}

.workspace-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.workspace-info {
    flex: 1;
    overflow: hidden;
    transition: opacity 0.15s;
}

.sidebar.collapsed .workspace-info {
    opacity: 0;
    width: 0;
}

.workspace-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

.workspace-sub {
    font-size: 11.5px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.sidebar-header .icon-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    color: var(--text-2);
    font-size: 12px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    background: var(--surface-3);
    border: 1px solid var(--border);
    font-weight: 700;
}

    .sidebar-header .icon-btn:hover {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
    }

.sidebar.collapsed .sidebar-header {
    overflow: visible;
    justify-content: center;
}

    .sidebar.collapsed .sidebar-header .icon-btn {
        position: absolute;
        right: -16px;
        top: 17px;
        z-index: 20;
        background: #ffffff;
        border: 1.5px solid var(--border);
        border-radius: 50%;
        width: 32px;
        height: 32px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.15);
        color: var(--accent);
        font-size: 13px;
    }

        .sidebar.collapsed .sidebar-header .icon-btn:hover {
            background: var(--accent);
            color: #fff;
            border-color: var(--accent);
            box-shadow: 0 4px 14px rgba(79,70,229,0.35);
        }

.sidebar-actions {
    padding: 12px 10px 6px;
}

.btn-new-notebook {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    transition: background 0.12s;
    white-space: nowrap;
    background: var(--accent-dim);
}

    .btn-new-notebook:hover {
        background: var(--accent-light);
    }

    .btn-new-notebook .plus-icon {
        width: 20px;
        height: 20px;
        border-radius: 5px;
        background: var(--accent);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        font-weight: 300;
        flex-shrink: 0;
    }

.sidebar-section-label {
    padding: 14px 14px 5px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
    white-space: nowrap;
}

.notebook-tree {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.notebook-item {
    margin-bottom: 2px;
}

.notebook-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}

    .notebook-header:hover {
        background: var(--sidebar-hover);
    }

.notebook-item.active > .notebook-header {
    background: var(--sidebar-active);
}

.nb-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nb-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nb-chevron {
    font-size: 9px;
    color: var(--text-3);
    transition: transform 0.18s;
    flex-shrink: 0;
}

    .nb-chevron.rotated {
        transform: rotate(90deg);
    }

.section-list {
    padding: 2px 0 6px 20px;
}

.section-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}

    .section-item:hover {
        background: var(--sidebar-hover);
    }

    .section-item.active {
        background: var(--accent-dim);
    }

.sec-bar {
    width: 3px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
    opacity: 0.7;
}

.sec-title {
    flex: 1;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-item.active .sec-title {
    color: var(--accent);
    font-weight: 600;
}

.sec-count {
    font-size: 10.5px;
    background: var(--surface-3);
    color: var(--text-3);
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.section-item.active .sec-count {
    background: var(--accent-dim);
    color: var(--accent);
}

.btn-add-section {
    font-size: 12px;
    color: var(--text-3);
    padding: 5px 8px;
    border-radius: var(--radius-xs);
    margin-top: 2px;
    font-weight: 500;
    transition: color 0.12s, background 0.12s;
}

    .btn-add-section:hover {
        color: var(--accent);
        background: var(--accent-dim);
    }

.sidebar-footer {
    padding: 10px 10px 12px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    color: var(--text-3);
    font-size: 15px;
    transition: background 0.12s;
}

    .theme-toggle:hover {
        background: var(--sidebar-hover);
    }

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow: hidden;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    color: var(--text-3);
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}

    .logout-btn:hover {
        background: var(--danger-dim);
        color: var(--danger);
    }

.db-error-banner {
    margin: 8px;
    padding: 10px 12px;
    background: var(--danger-dim);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: var(--radius-sm);
    color: #B91C1C;
    font-size: 12px;
    line-height: 1.4;
}

/* ── MAIN ── */
.main-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

/* ── WELCOME ── */
.welcome-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.welcome-content {
    text-align: center;
    max-width: 480px;
}

.welcome-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--accent);
    margin-bottom: 20px;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
}

.welcome-content h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.4px;
}

.welcome-content > p {
    color: var(--text-2);
    font-size: 14px;
    margin-bottom: 32px;
    line-height: 1.6;
}

.welcome-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.welcome-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    text-align: left;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, transform 0.15s;
}

    .welcome-card:hover {
        box-shadow: var(--shadow);
        transform: translateY(-1px);
    }

.welcome-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--accent-dim);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 600;
}

.welcome-card h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.welcome-card p {
    font-size: 12px;
    color: var(--text-3);
    margin: 0;
    line-height: 1.45;
}

/* ── SECTION PAGE ── */
.section-page {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.notes-panel {
    width: 280px;
    min-width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.notes-panel-header {
    padding: 16px 14px 10px;
    border-bottom: 1px solid var(--border-light);
}

.notes-panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.notes-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
}

.note-count {
    font-size: 11px;
    background: var(--surface-3);
    color: var(--text-3);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.btn-new-note {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 700;
    transition: background 0.12s, transform 0.1s;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(79,70,229,0.3);
}

    .btn-new-note:hover {
        background: var(--accent-hover);
    }

    .btn-new-note:active {
        transform: scale(0.97);
    }

.notes-search {
    padding: 0 10px 10px;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    transition: border-color 0.15s, box-shadow 0.15s;
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='6' cy='6' r='4.5' stroke='%239CA3AF' stroke-width='1.5'/%3E%3Cpath d='m9.5 9.5 2 2' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 11px center;
    font-family: var(--font);
}

    .search-input:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-dim);
        background-color: var(--surface);
    }

    .search-input::placeholder {
        color: var(--text-3);
    }

.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.notes-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
    line-height: 1.7;
}

.link-btn {
    color: var(--accent);
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    padding: 0;
}

    .link-btn:hover {
        text-decoration: underline;
    }

.note-card {
    position: relative;
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 3px;
    transition: background 0.1s, border-color 0.1s;
}

    .note-card:hover {
        background: var(--surface-2);
        border-color: var(--border);
    }

    .note-card.active {
        background: var(--accent-light);
        border-color: rgba(79,70,229,0.2);
    }

    .note-card.pinned {
        border-left: 2px solid var(--accent);
    }

.pin-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    opacity: 0.5;
}

.note-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
    padding-right: 18px;
}

.note-card-preview {
    font-size: 12px;
    color: var(--text-3);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.45;
    margin-bottom: 5px;
}

.note-card-meta {
    font-size: 11px;
    color: var(--text-3);
}

/* ── EDITOR ── */
.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
}

.editor-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-3);
}

.editor-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    opacity: 0.5;
}

.editor-empty p {
    font-size: 14px;
    color: var(--text-2);
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-light);
    height: 48px;
    flex-shrink: 0;
}

.editor-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-3);
    font-weight: 500;
}

.breadcrumb-sep {
    font-size: 10px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.save-indicator {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}

    .save-indicator.saving {
        color: var(--text-3);
    }

    .save-indicator.saved {
        color: var(--success);
        background: rgba(16,185,129,0.08);
    }

.icon-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    color: var(--text-3);
    font-size: 14px;
    transition: background 0.1s, color 0.1s;
}

    .icon-btn:hover {
        background: var(--surface-2);
        color: var(--text-2);
    }

    .icon-btn.pinned {
        color: var(--accent);
    }

    .icon-btn.danger:hover {
        background: var(--danger-dim);
        color: var(--danger);
    }

.editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 36px 52px;
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 860px) {
    .editor-body {
        padding: 24px 20px;
    }
}

.editor-title-input {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    width: 100%;
    line-height: 1.3;
    letter-spacing: -0.4px;
    background: transparent;
    padding: 0;
    margin-bottom: 6px;
    font-family: var(--font);
}

    .editor-title-input::placeholder {
        color: var(--text-3);
    }

.editor-divider {
    height: 1px;
    background: var(--border-light);
    margin-bottom: 22px;
}

.editor-content-input {
    flex: 1;
    width: 100%;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
    resize: none;
    background: transparent;
    padding: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    font-family: var(--font);
}

    .editor-content-input::placeholder {
        color: var(--text-3);
    }

/* ── AUTH ── */
.auth-wrapper {
    min-height: 100vh;
    background: var(--bg);
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.auth-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.auth-brand-name {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.5px;
}

.auth-tagline {
    color: #6B7280;
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.5;
}

.auth-tabs {
    display: flex;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 8px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: #6B7280;
    border-radius: 6px;
    transition: all 0.15s;
    background: transparent;
    font-family: var(--font);
    cursor: pointer;
    border: none;
}

    .auth-tab.active {
        background: #ffffff;
        color: #111827;
        box-shadow: var(--shadow-sm);
    }

    .auth-tab:hover:not(.active) {
        color: #111827;
    }

.auth-error {
    background: #FEF2F2;
    border: 1px solid rgba(239,68,68,0.2);
    color: #B91C1C;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 18px;
    font-weight: 500;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .form-group label {
        font-size: 13px;
        font-weight: 600;
        color: #111827;
    }

.form-input {
    width: 100%;
    padding: 10px 13px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: #111827;
    font-size: 14px;
    font-family: var(--font);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

    .form-input:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-dim);
        background: #ffffff;
    }

    .form-input::placeholder {
        color: #9CA3AF;
    }

.input-wrapper {
    position: relative;
}

    .input-wrapper .form-input {
        padding-right: 60px;
    }

.toggle-pw {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    padding: 3px 6px;
    border-radius: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
}

    .toggle-pw:hover {
        background: var(--accent-dim);
    }

.btn-auth {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    transition: background 0.12s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    box-shadow: 0 2px 8px rgba(79,70,229,0.3);
    border: none;
    cursor: pointer;
}

    .btn-auth:hover {
        background: var(--accent-hover);
    }

    .btn-auth:active {
        transform: scale(0.98);
    }

    .btn-auth:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.auth-footer-note {
    margin-top: 20px;
    font-size: 11.5px;
    color: #9CA3AF;
    text-align: center;
    line-height: 1.5;
}

/* ── MODALS ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,0.4);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fade-in 0.15s ease;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: #ffffff;
    border: 1px solid #E8EAF0;
    border-radius: 16px;
    padding: 28px;
    width: 440px;
    max-width: calc(100vw - 32px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.14);
    animation: slide-up 0.2s cubic-bezier(0.34,1.4,0.64,1);
    color: #111827;
}

.modal-sm {
    width: 380px;
}

@keyframes slide-up {
    from {
        transform: translateY(8px) scale(0.98);
        opacity: 0;
    }

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

.modal h3 {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 20px;
}

.modal p {
    font-size: 14px;
    color: #4B5563;
    line-height: 1.6;
}

    .modal p strong {
        color: #111827;
    }

.modal .form-group {
    margin-bottom: 14px;
}

.icon-picker, .color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.icon-opt {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8F9FC;
    border: 1.5px solid transparent;
    transition: border-color 0.12s, background 0.12s;
    cursor: pointer;
}

    .icon-opt:hover {
        background: #F0F1F5;
    }

    .icon-opt.selected {
        border-color: #4F46E5;
        background: #EEF0FF;
    }

.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    transition: transform 0.12s, border-color 0.12s;
    cursor: pointer;
}

    .color-swatch:hover {
        transform: scale(1.15);
    }

    .color-swatch.selected {
        border-color: #111827;
        transform: scale(1.15);
    }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
}

.btn-primary {
    padding: 9px 20px;
    background: #4F46E5;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    transition: background 0.12s;
    box-shadow: 0 1px 4px rgba(79,70,229,0.25);
}

    .btn-primary:hover {
        background: #4338CA;
    }

.btn-secondary {
    padding: 9px 20px;
    background: #F8F9FC;
    color: #4B5563;
    border: 1px solid #E8EAF0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

    .btn-secondary:hover {
        background: #F0F1F5;
        color: #111827;
    }

.btn-danger {
    padding: 9px 20px;
    background: #EF4444;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    transition: opacity 0.12s;
}

    .btn-danger:hover {
        opacity: 0.88;
    }

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    display: inline-block;
}

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

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #E8EAF0;
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #9CA3AF;
    }

#blazor-error-ui {
    background: #FEF2F2;
    bottom: 0;
    border-top: 1px solid #FECACA;
    color: #B91C1C;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 13px;
    font-family: var(--font);
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
    }

    #blazor-error-ui .reload {
        color: #B91C1C;
        text-decoration: underline;
        margin: 0 6px;
        font-weight: 600;
    }

.sidebar-inner {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
/* ══════════════════════════════════════
   SETTINGS PAGE
══════════════════════════════════════ */

.settings-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    background: var(--bg);
}

.settings-header {
    padding: 24px 40px 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-back {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-3);
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    transition: background 0.12s, color 0.12s;
}

    .settings-back:hover {
        background: var(--surface-3);
        color: var(--text-2);
    }

.settings-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.4px;
}

.settings-body {
    padding: 24px 40px 60px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 760px;
    width: 100%;
}

.settings-card {
    background: #ffffff;
    border: 1px solid #E8EAF0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.settings-card-muted {
    background: #F8F9FC;
}

.settings-card-header {
    padding: 20px 24px 0;
}

    .settings-card-header h2 {
        font-size: 15px;
        font-weight: 700;
        color: #111827;
        margin-bottom: 3px;
    }

    .settings-card-header p {
        font-size: 13px;
        color: #6B7280;
    }

.settings-card-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #F0F1F7;
    margin-top: 4px;
}

.settings-divider {
    height: 1px;
    background: #F0F1F7;
    margin: 20px 24px;
}

/* Avatar */
.avatar-section {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 24px 0;
}

.avatar-preview {
    position: relative;
    flex-shrink: 0;
}

.avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #E8EAF0;
    display: block;
}

.avatar-initials {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.avatar-remove-btn {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #EF4444;
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    opacity: 0;
    transition: opacity 0.15s;
    cursor: pointer;
}

.avatar-preview:hover .avatar-remove-btn {
    opacity: 1;
}

.avatar-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avatar-hint {
    font-size: 12.5px;
    color: #6B7280;
    line-height: 1.5;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #F0F1F5;
    border: 1px solid #E8EAF0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    font-family: var(--font);
}

    .btn-upload:hover {
        background: #E8EAF0;
        color: #111827;
    }

.color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.color-row-label {
    font-size: 12px;
    color: #6B7280;
    font-weight: 500;
}

.avatar-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    transition: transform 0.12s, border-color 0.12s;
}

    .avatar-color-swatch:hover {
        transform: scale(1.2);
    }

    .avatar-color-swatch.selected {
        border-color: #111827;
        transform: scale(1.2);
        box-shadow: 0 0 0 2px #fff inset;
    }

.field-error {
    font-size: 12px;
    color: #EF4444;
    font-weight: 500;
}

/* Fields */
.settings-fields {
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .field-group.full-width {
        grid-column: 1 / -1;
    }

    .field-group label {
        font-size: 12.5px;
        font-weight: 600;
        color: #374151;
    }

.s-input {
    width: 100%;
    padding: 9px 13px;
    background: #F8F9FC;
    border: 1.5px solid #E8EAF0;
    border-radius: 8px;
    color: #111827;
    font-size: 13.5px;
    font-family: var(--font);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

    .s-input:focus {
        border-color: #4F46E5;
        box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
        background: #fff;
    }

    .s-input:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

    .s-input::placeholder {
        color: #9CA3AF;
    }

.settings-success {
    margin: 10px 24px 0;
    padding: 10px 14px;
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #065F46;
}

.settings-error {
    margin: 10px 24px 0;
    padding: 10px 14px;
    background: #FEF2F2;
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #B91C1C;
}

.btn-save {
    padding: 9px 22px;
    background: #4F46E5;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    transition: background 0.12s, opacity 0.12s;
    box-shadow: 0 1px 4px rgba(79,70,229,0.25);
}

    .btn-save:hover {
        background: #4338CA;
    }

    .btn-save:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* Account info */
.account-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 16px 0 4px;
}

.account-info-item {
    padding: 12px 24px;
    border-bottom: 1px solid #F0F1F7;
}

    .account-info-item:nth-last-child(-n+2) {
        border-bottom: none;
    }

.ai-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
}

.ai-value {
    font-size: 13.5px;
    font-weight: 500;
    color: #111827;
}

/* Sidebar avatar with image support */
.user-avatar-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.15);
}

.settings-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-3);
    padding: 4px 6px;
    border-radius: var(--radius-xs);
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}

    .settings-link:hover {
        background: var(--sidebar-hover);
        color: var(--sidebar-text);
        cursor: pointer;
    }

/* ══════════════════════════════════════
   HOME PAGE — Search + Recent
══════════════════════════════════════ */

.home-page {
    flex: 1;
    overflow-y: auto;
    padding: 48px 52px 60px;
}

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

    .home-header h1 {
        font-size: 26px;
        font-weight: 700;
        color: #111827;
        letter-spacing: -0.5px;
        line-height: 1.3;
    }

.home-name {
    color: #4F46E5;
}

.home-subtitle {
    font-size: 14px;
    color: #6B7280;
    margin-top: 4px;
    font-weight: 500;
}

/* Search bar */
.home-search-wrap {
    margin-bottom: 32px;
}

.home-search-box {
    position: relative;
    max-width: 620px;
}

.search-icon-svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
}

.home-search-input {
    width: 100%;
    padding: 14px 48px 14px 48px;
    background: #ffffff;
    border: 1.5px solid #E8EAF0;
    border-radius: 12px;
    font-size: 15px;
    font-family: var(--font);
    color: #111827;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .home-search-input:focus {
        border-color: #4F46E5;
        box-shadow: 0 0 0 4px rgba(79,70,229,0.1), 0 2px 8px rgba(0,0,0,0.05);
        outline: none;
    }

    .home-search-input::placeholder {
        color: #9CA3AF;
    }

.search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #9CA3AF;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
    background: none;
    border: none;
    cursor: pointer;
}

    .search-clear:hover {
        background: #F0F1F5;
        color: #374151;
    }

/* Section label */
.home-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9CA3AF;
    margin-bottom: 14px;
}

/* Results grid */
.home-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    max-width: 960px;
}

.result-card {
    background: #ffffff;
    border: 1px solid #E8EAF0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}

    .result-card:hover {
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
        transform: translateY(-1px);
        border-color: #C7D2FE;
    }

.result-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #6B7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.result-nb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.result-sep {
    color: #D1D5DB;
}

.result-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-preview {
    font-size: 12.5px;
    color: #6B7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.result-meta {
    font-size: 11px;
    color: #9CA3AF;
    font-weight: 500;
}

.home-empty {
    padding: 40px 0;
    color: #9CA3AF;
    font-size: 14px;
}

    .home-empty strong {
        color: #374151;
    }

/* ══════════════════════════════════════
   GRADIENT HERO — Home + Settings
══════════════════════════════════════ */

/* Home hero */
.home-page {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.home-hero {
    background: linear-gradient(135deg, #4F46E5 0%, #6D28D9 60%, #5B21B6 100%);
    padding: 40px 52px 52px;
    flex-shrink: 0;
}

.home-hero-inner {
    max-width: 720px;
}

.home-hero-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.home-hero-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.home-hero-avatar-initials {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    border: 3px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.home-hero-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.4px;
    line-height: 1.3;
    margin-bottom: 3px;
}

.home-hero-sub {
    font-size: 13.5px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    margin-top: 2px;
}

/* Search inside hero */
.home-search-box {
    position: relative;
}

.search-icon-svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
}

.home-search-input {
    width: 100%;
    padding: 14px 48px;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    font-size: 15px;
    font-family: var(--font);
    color: #fff;
    transition: background 0.15s, border-color 0.15s;
    backdrop-filter: blur(8px);
}

    .home-search-input:focus {
        background: rgba(255,255,255,0.22);
        border-color: rgba(255,255,255,0.5);
        outline: none;
    }

    .home-search-input::placeholder {
        color: rgba(255,255,255,0.55);
    }

.search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border: none;
    cursor: pointer;
    transition: background 0.12s;
}

    .search-clear:hover {
        background: rgba(255,255,255,0.25);
        color: #fff;
    }

/* Body below hero */
.home-body {
    flex: 1;
    padding: 32px 52px 60px;
    overflow-y: auto;
}

/* Settings hero (same gradient) */
.settings-hero {
    background: linear-gradient(135deg, #4F46E5 0%, #6D28D9 60%, #5B21B6 100%);
    padding: 32px 40px 36px;
    flex-shrink: 0;
}

.settings-hero-inner {
    max-width: 760px;
}

.settings-back {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    transition: background 0.12s, color 0.12s;
    margin-bottom: 12px;
    display: inline-block;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
}

    .settings-back:hover {
        background: rgba(255,255,255,0.15);
        color: #fff;
    }

.settings-hero-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.4px;
    margin-bottom: 4px;
}

.settings-hero-sub {
    font-size: 13.5px;
    color: rgba(255,255,255,0.7);
}

.settings-page {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.settings-body {
    padding: 28px 40px 60px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    width: 100%;
}

/* Home button on sidebar brand */
.home-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    text-align: left;
    font-family: var(--font);
    transition: opacity 0.15s;
}

    .home-btn:hover {
        opacity: 0.8;
    }

/* ══════════════════════════════════════
   PANEL COLOUR DIFFERENTIATION
══════════════════════════════════════ */

/* Sidebar — very faint warm tint */
.sidebar {
    background: #FAFBFF !important;
}

/* Notes list panel — light indigo wash */
.notes-panel {
    background: #F0F2FA !important;
    border-right: 1.5px solid #D8DCF0 !important;
}

/* Notes panel header — slightly deeper */
.notes-panel-header {
    background: #E8EBF7 !important;
    border-bottom: 1px solid #D0D4EC !important;
}

/* Notes panel section title */
.notes-panel-title {
    color: #1e1b4b !important;
}

/* Note cards sit on the indigo-wash background — make them white */
.note-card {
    background: #ffffff !important;
    border: 1px solid #E0E4F4 !important;
}

    .note-card:hover {
        background: #ffffff !important;
        border-color: #C7CEFF !important;
        box-shadow: 0 2px 8px rgba(79,70,229,0.1) !important;
    }

    .note-card.active {
        background: #EEF0FF !important;
        border-color: rgba(79,70,229,0.35) !important;
    }

/* Search input on indigo background */
.search-input {
    background: #ffffff !important;
    border-color: #D0D4EC !important;
}

/* Editor panel — pure white, clear left border */
.editor-panel {
    background: #ffffff !important;
    border-left: 1px solid #E0E4F4;
}

/* Sidebar border stronger */
.sidebar {
    border-right: 1.5px solid #D8DCF0 !important;
}

/* Sidebar active section item more visible on light bg */
.section-item.active {
    background: #E0E4FF !important;
}

    .section-item.active .sec-title {
        color: #3730A3 !important;
    }

/* ══════════════════════════════════════
   HOME — BOLD REDESIGN (overrides)
══════════════════════════════════════ */

.home-page {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ── Dark hero ── */
.home-hero {
    background: #0C0C14;
    background-image: radial-gradient(ellipse 80% 60% at 10% 100%, rgba(99,70,255,0.35) 0%, transparent 60%), radial-gradient(ellipse 60% 50% at 90% 0%, rgba(139,70,255,0.2) 0%, transparent 55%);
    padding: 44px 52px 56px;
    flex-shrink: 0;
}

.home-hero-content {
    max-width: 760px;
}

.home-hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.home-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.home-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.home-meta-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.home-greeting {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.45);
}

.home-company {
    font-size: 12.5px;
    font-weight: 500;
    color: rgba(255,255,255,0.35);
}

.home-title {
    font-size: 46px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 24px;
}

/* Stat pills */
.home-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 5px 14px;
}

.stat-num {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    font-size: 12px;
    font-weight: 400;
    color: rgba(255,255,255,0.45);
}

/* Search bar — white on dark hero */
.home-search-wrap {
    position: relative;
    max-width: 640px;
}

.home-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
}

.home-search-input {
    width: 100%;
    padding: 16px 56px;
    background: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-family: var(--font);
    color: #111827;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
    transition: box-shadow 0.2s;
}

    .home-search-input:focus {
        outline: none;
        box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 3px rgba(99,70,255,0.5);
    }

    .home-search-input::placeholder {
        color: #9CA3AF;
    }

.home-search-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #9CA3AF;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    border: none;
    cursor: pointer;
    transition: background 0.12s;
}

    .home-search-clear:hover {
        background: #E5E7EB;
        color: #374151;
    }

/* ── Body below hero ── */
.home-body {
    flex: 1;
    padding: 32px 52px 60px;
    background: #F5F6FA;
}

.home-section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.home-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6B7280;
}

/* Note cards grid */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.home-card {
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-top: 4px solid #4F46E5;
    border-radius: 12px;
    padding: 18px 20px 16px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

    .home-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 32px rgba(0,0,0,0.1);
        border-color: #D1D5DB;
        border-top-color: inherit;
    }

.home-card-crumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: #9CA3AF;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-card-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.home-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
    line-height: 1.35;
}

.home-card-preview {
    font-size: 13px;
    color: #6B7280;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
}

.home-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #F3F4F6;
    padding-top: 10px;
}

.home-card-date {
    font-size: 11.5px;
    color: #9CA3AF;
    font-weight: 500;
}

/* Empty state */
.home-empty {
    text-align: center;
    padding: 80px 40px;
    color: #9CA3AF;
}

.home-empty-icon {
    font-size: 36px;
    margin-bottom: 14px;
    opacity: 0.5;
}

.home-empty p {
    font-size: 15px;
    color: #6B7280;
    line-height: 1.6;
}

.home-empty strong {
    color: #374151;
}

/* ══════════════════════════════════════
   HERO TWEAKS — lighter + more rounded
══════════════════════════════════════ */

/* Lighter dark hero */
.home-hero {
    background: #1E1B4B !important;
    background-image: radial-gradient(ellipse 80% 60% at 10% 100%, rgba(99,70,255,0.45) 0%, transparent 60%), radial-gradient(ellipse 60% 50% at 90% 0%, rgba(139,70,255,0.3) 0%, transparent 55%) !important;
    border-radius: 0 0 28px 28px;
}

/* More rounded search bar */
.home-search-input {
    border-radius: 20px !important;
}

/* More rounded cards */
.home-card {
    border-radius: 16px !important;
}

/* More rounded stat pills - already round but soften */
.stat-pill {
    border-radius: 24px !important;
}

/* More rounded notes panel elements */
.note-card {
    border-radius: 12px !important;
}

.btn-new-note {
    border-radius: 10px !important;
}

.search-input {
    border-radius: 10px !important;
}

/* More rounded modals */
.modal {
    border-radius: 20px !important;
}

.modal-sm {
    border-radius: 20px !important;
}

/* More rounded sidebar buttons */
.btn-new-notebook {
    border-radius: 10px !important;
}

.notebook-header {
    border-radius: 10px !important;
}

.section-item {
    border-radius: 8px !important;
}

/* ── Hero: much lighter background + bigger avatar ── */
.home-hero {
    background: #312E81 !important;
    background-image: radial-gradient(ellipse 80% 70% at 0% 100%, rgba(139,92,246,0.5) 0%, transparent 60%), radial-gradient(ellipse 60% 50% at 100% 0%, rgba(167,139,250,0.35) 0%, transparent 55%) !important;
}

.home-avatar {
    width: 72px !important;
    height: 72px !important;
    border: 3px solid rgba(255,255,255,0.3) !important;
}

.home-avatar-initials {
    font-size: 26px !important;
}

/* ══════════════════════════════════════
   HOME HERO — compact horizontal layout
══════════════════════════════════════ */

.home-hero {
    background: #4338CA !important;
    background-image: radial-gradient(ellipse 60% 80% at 0% 100%, rgba(139,92,246,0.45) 0%, transparent 60%), radial-gradient(ellipse 40% 60% at 100% 0%, rgba(167,139,250,0.3) 0%, transparent 55%) !important;
    padding: 20px 28px !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 24px !important;
    flex-shrink: 0 !important;
    min-height: unset !important;
}

.home-hero-content {
    display: none !important;
}

.home-hero-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.home-avatar {
    width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    flex-shrink: 0;
}

.home-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #fff !important;
    letter-spacing: -0.3px !important;
    margin-bottom: 4px !important;
    line-height: 1.2 !important;
}

.home-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.home-meta-chip {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
}

.home-meta-sep {
    color: rgba(255,255,255,0.3);
    font-size: 12px;
}

.home-search-wrap {
    flex: 1 !important;
    max-width: 500px !important;
    position: relative;
}

.home-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
}

.home-search-input {
    width: 100% !important;
    padding: 11px 44px !important;
    background: rgba(255,255,255,0.15) !important;
    border: 1.5px solid rgba(255,255,255,0.25) !important;
    border-radius: 20px !important;
    font-size: 14px !important;
    color: #fff !important;
    box-shadow: none !important;
    backdrop-filter: blur(8px);
    font-family: var(--font);
    transition: background 0.15s, border-color 0.15s !important;
}

    .home-search-input:focus {
        background: rgba(255,255,255,0.22) !important;
        border-color: rgba(255,255,255,0.5) !important;
        box-shadow: none !important;
        outline: none;
    }

    .home-search-input::placeholder {
        color: rgba(255,255,255,0.5) !important;
    }

.home-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.15);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

/* Body */
.home-body {
    flex: 1 !important;
    padding: 24px 28px 40px !important;
    background: #F5F6FA !important;
    overflow-y: auto;
}

.home-section-row {
    margin-bottom: 14px !important;
}

/* ══════════════════════════════════════
   ROUNDED EDGES RESTORE
══════════════════════════════════════ */
.note-card {
    border-radius: 14px !important;
}

.home-card {
    border-radius: 16px !important;
}

.modal {
    border-radius: 20px !important;
}

.modal-sm {
    border-radius: 20px !important;
}

.btn-new-note {
    border-radius: 10px !important;
}

.search-input {
    border-radius: 10px !important;
}

.home-search-input {
    border-radius: 20px !important;
}

.btn-new-notebook {
    border-radius: 10px !important;
}

.notebook-header {
    border-radius: 10px !important;
}

.section-item {
    border-radius: 8px !important;
}

/* ══════════════════════════════════════
   NOTIFICATION BAR + PANEL
══════════════════════════════════════ */

.notif-bar {
    position: relative;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 100;
}

.notif-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-bell {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: none;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    color: var(--text-2);
}

    .notif-bell:hover {
        background: var(--surface-2);
    }

    .notif-bell.has-notif {
        border-color: #4F46E5;
        background: #EEF0FF;
    }

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #EF4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}

.notif-panel {
    position: absolute;
    top: 48px;
    right: 12px;
    width: 380px;
    background: #ffffff;
    border: 1px solid #E8EAF0;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    z-index: 200;
    overflow: hidden;
    animation: slide-up 0.18s cubic-bezier(0.34,1.4,0.64,1);
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #F0F1F7;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

    .notif-panel-header button {
        color: #9CA3AF;
        font-size: 14px;
        background: none;
        border: none;
        cursor: pointer;
        width: 24px;
        height: 24px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .notif-panel-header button:hover {
            background: #F3F4F6;
            color: #374151;
        }

.notif-empty {
    padding: 28px 16px;
    text-align: center;
    color: #9CA3AF;
    font-size: 13px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #F9FAFB;
    transition: background 0.1s;
}

    .notif-item:hover {
        background: #F9FAFB;
    }

    .notif-item:last-child {
        border-bottom: none;
    }

.notif-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
    margin-bottom: 4px;
}

    .notif-item-title strong {
        color: #111827;
    }

.notif-item-msg {
    font-size: 12px;
    color: #6B7280;
    font-style: italic;
    margin-bottom: 4px;
}

.notif-item-meta {
    font-size: 11px;
    color: #9CA3AF;
    margin-bottom: 10px;
}

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

.notif-btn-accept {
    padding: 6px 14px;
    background: #4F46E5;
    color: #fff;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.12s;
}

    .notif-btn-accept:hover {
        background: #4338CA;
    }

.notif-btn-dismiss {
    padding: 6px 14px;
    background: #F3F4F6;
    color: #6B7280;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.12s;
}

    .notif-btn-dismiss:hover {
        background: #E5E7EB;
        color: #374151;
    }

.notif-action-result {
    font-size: 12px;
    color: #059669;
    font-weight: 600;
    margin-top: 6px;
}

/* Share button on notebook items */
.nb-share-btn {
    opacity: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, background 0.12s, color 0.12s;
    flex-shrink: 0;
}

.notebook-header:hover .nb-share-btn {
    opacity: 1;
}

.nb-share-btn:hover {
    background: var(--accent-dim);
    color: var(--accent);
}

/* Notebook delete button (hover reveal, same as share) */
.nb-delete-btn {
    opacity: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, background 0.12s;
    flex-shrink: 0;
}

.notebook-header:hover .nb-delete-btn {
    opacity: 1;
}

.nb-delete-btn:hover {
    background: var(--danger-dim);
}

/* ══════════════════════════════════════
   HOME HERO — inline stats + search row
══════════════════════════════════════ */

.home-hero {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 18px 28px 20px !important;
}

.home-hero-top-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-hero-bottom-row {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.home-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
}

.home-search-wrap {
    flex: 1 !important;
    max-width: 480px !important;
}

/* Keep avatar and title compact */
.home-avatar {
    width: 36px !important;
    height: 36px !important;
}

.home-avatar-initials {
    font-size: 13px !important;
}

.home-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    margin-bottom: 0 !important;
    letter-spacing: -0.2px !important;
}

/* ── More rounded edges everywhere ── */
:root, .theme-light, .theme-dark {
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
}

.sidebar {
    border-radius: 0 16px 16px 0 !important;
}

.notes-panel {
    border-radius: 0 !important;
}

.note-card {
    border-radius: 14px !important;
}

.home-card {
    border-radius: 18px !important;
}

.modal, .modal-sm {
    border-radius: 24px !important;
}

.auth-card {
    border-radius: 24px !important;
}

.home-search-input {
    border-radius: 24px !important;
}

.search-input {
    border-radius: 12px !important;
}

.btn-new-note {
    border-radius: 12px !important;
}

.btn-new-notebook {
    border-radius: 12px !important;
}

.btn-auth {
    border-radius: 12px !important;
}

.btn-primary, .btn-secondary, .btn-danger, .btn-save {
    border-radius: 10px !important;
}

.s-input, .form-input {
    border-radius: 10px !important;
}

.stat-pill {
    border-radius: 24px !important;
}

.notif-panel {
    border-radius: 20px !important;
}

.notif-bell {
    border-radius: 12px !important;
}

.workspace-icon {
    border-radius: 12px !important;
}

.user-avatar {
    border-radius: 50% !important;
}

.note-count {
    border-radius: 20px !important;
}

/* ── Hero size fix — restore avatar and title to proper size ── */
.home-avatar {
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    border: 2.5px solid rgba(255,255,255,0.35) !important;
    flex-shrink: 0;
}

.home-avatar-initials {
    font-size: 20px !important;
}

.home-title {
    font-size: 26px !important;
    font-weight: 800 !important;
    color: #fff !important;
    letter-spacing: -0.5px !important;
    line-height: 1.2 !important;
    margin-bottom: 0 !important;
}

/* ══════════════════════════════════════
   HOME HERO — final clean layout
══════════════════════════════════════ */

.home-page {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.home-hero {
    background: #4338CA !important;
    background-image: radial-gradient(ellipse 60% 80% at 0% 100%, rgba(139,92,246,0.5) 0%, transparent 60%), radial-gradient(ellipse 40% 60% at 100% 0%, rgba(167,139,250,0.35) 0%, transparent 55%) !important;
    padding: 24px 32px 28px !important;
    border-radius: 0 0 28px 28px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    align-items: stretch !important;
}

/* Row 1 — avatar + name + stats inline */
.home-hero-row1 {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.home-avatar {
    width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
    border: 2.5px solid rgba(255,255,255,0.35) !important;
    flex-shrink: 0;
    object-fit: cover;
}

    .home-avatar.home-avatar-initials {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 18px !important;
        font-weight: 700 !important;
        color: #fff !important;
    }

.home-hero-name {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    line-height: 1;
}

.home-hero-divider {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.25);
    flex-shrink: 0;
}

.home-hero-stat {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
}

.home-hero-dot {
    color: rgba(255,255,255,0.3);
    font-size: 13px;
}

/* Row 2 — big search */
.home-search-outer {
    width: 100%;
}

.home-search-box {
    position: relative;
    background: #fff;
    border-radius: 20px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
}

.home-search-svg {
    position: absolute;
    left: 18px;
    flex-shrink: 0;
    pointer-events: none;
}

.home-search-input {
    width: 100% !important;
    padding: 16px 52px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 20px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #111827 !important;
    box-shadow: none !important;
    font-family: var(--font) !important;
}

    .home-search-input:focus {
        outline: none !important;
        box-shadow: none !important;
    }

    .home-search-input::placeholder {
        color: #9CA3AF !important;
        font-weight: 400 !important;
    }

.home-search-clear {
    position: absolute;
    right: 16px;
    color: #9CA3AF;
    background: #F3F4F6;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 12px;
}

    .home-search-clear:hover {
        background: #E5E7EB;
        color: #374151;
    }

/* Body */
.home-body {
    flex: 1;
    padding: 24px 32px 48px;
    background: #F5F6FA;
    overflow-y: auto;
}

.home-section-row {
    margin-bottom: 14px;
}

.home-section-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9CA3AF;
}

/* ══════════════════════════════════════
   USER LOOKUP DROPDOWN
══════════════════════════════════════ */

.user-lookup-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #E8EAF0;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    z-index: 500;
    overflow: hidden;
}

.user-lookup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s;
}

    .user-lookup-item:hover {
        background: #F5F6FA;
    }

    .user-lookup-item:not(:last-child) {
        border-bottom: 1px solid #F9FAFB;
    }

.user-lookup-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-lookup-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.user-lookup-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #111827;
}

.user-lookup-username {
    font-size: 12px;
    color: #9CA3AF;
}

/* ══════════════════════════════════════
   EMOJI PICKER
══════════════════════════════════════ */

.icon-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.icon-current-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-current-preview {
    font-size: 32px;
    width: 52px;
    height: 52px;
    background: #F0F2FA;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #E0E4F4;
}

.emoji-text-input {
    width: 52px;
    height: 40px;
    text-align: center;
    font-size: 22px;
    background: #F8F9FC;
    border: 1.5px solid #E8EAF0;
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: border-color 0.15s;
}

    .emoji-text-input:focus {
        border-color: #4F46E5;
        box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
        outline: none;
    }

.btn-emoji-panel {
    padding: 8px 14px;
    background: #F0F2FA;
    border: 1.5px solid #E0E4F4;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: #4F46E5;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.12s, border-color 0.12s;
    white-space: nowrap;
}

    .btn-emoji-panel:hover {
        background: #E8EBF7;
        border-color: #C7CEFF;
    }

.emoji-os-hint {
    font-size: 12px;
    color: #4F46E5;
    background: #EEF0FF;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: center;
    transition: opacity 0.3s;
}

/* ── Back to home button in section view ── */
.section-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    padding: 5px 10px 5px 8px;
    border-radius: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.12s, color 0.12s;
    margin-bottom: 8px;
}

    .section-back-btn:hover {
        background: var(--accent-dim);
        color: var(--accent);
    }

/* ── Emoji picker button ── */
.btn-emoji-panel {
    padding: 8px 14px;
    background: #EEF0FF;
    border: 1.5px solid #C7D2FE;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: #4F46E5;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.12s;
}

    .btn-emoji-panel:hover {
        background: #E0E7FF;
    }

/* emoji-picker-element styling */
emoji-picker {
    --num-columns: 8;
    --emoji-size: 1.6rem;
    width: 380px;
    height: 380px;
    border: none;
}

/* ── Search bar fix — no blur, smaller height ── */
.home-search-box {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #ffffff !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18) !important;
}

.home-search-input {
    padding: 12px 48px !important;
    font-size: 14px !important;
    border-radius: 14px !important;
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
}

/* ══════════════════════════════════════
   LOGIN PAGE — full screen, animated
══════════════════════════════════════ */

.login-page {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #fff;
}

/* ── Left panel ── */
.login-left {
    flex: 1.1;
    background: #1E1B4B;
    background-image: radial-gradient(ellipse 70% 60% at 10% 90%, rgba(99,70,255,0.5) 0%, transparent 60%), radial-gradient(ellipse 50% 50% at 90% 10%, rgba(139,92,246,0.35) 0%, transparent 55%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 44px 48px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2;
    position: relative;
}

.login-brand-icon {
    font-size: 22px;
    color: rgba(255,255,255,0.9);
}

.login-brand-name {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    font-family: var(--font);
}

.login-tagline {
    margin-top: auto;
    margin-bottom: 60px;
    z-index: 2;
    position: relative;
}

    .login-tagline h2 {
        font-size: 36px;
        font-weight: 800;
        color: #fff;
        line-height: 1.2;
        letter-spacing: -0.8px;
        margin-bottom: 14px;
        font-family: var(--font);
    }

    .login-tagline p {
        font-size: 15px;
        color: rgba(255,255,255,0.55);
        line-height: 1.6;
        font-family: var(--font);
    }

/* ── Floating note cards ── */
.floating-notes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.fnote {
    position: absolute;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 14px 18px;
    width: 240px;
    backdrop-filter: blur(4px);
    animation: floatUp 18s ease-in-out infinite;
    opacity: 0;
}

.fnote-title {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    margin-bottom: 6px;
    font-family: var(--font);
}

.fnote-body {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    line-height: 1.5;
    font-family: var(--font);
}

/* Individual card positions & animation timings */
.fnote-1 {
    left: 8%;
    top: 15%;
    animation-delay: 0s;
    animation-duration: 20s;
}

.fnote-2 {
    left: 55%;
    top: 8%;
    animation-delay: 3s;
    animation-duration: 22s;
}

.fnote-3 {
    left: 20%;
    top: 45%;
    animation-delay: 6s;
    animation-duration: 18s;
}

.fnote-4 {
    left: 60%;
    top: 40%;
    animation-delay: 1.5s;
    animation-duration: 24s;
}

.fnote-5 {
    left: 5%;
    top: 65%;
    animation-delay: 9s;
    animation-duration: 20s;
}

.fnote-6 {
    left: 50%;
    top: 70%;
    animation-delay: 4.5s;
    animation-duration: 19s;
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    10% {
        opacity: 1;
    }

    80% {
        opacity: 0.7;
    }

    90% {
        opacity: 0;
        transform: translateY(-60px) scale(1.02);
    }

    100% {
        opacity: 0;
        transform: translateY(-80px);
    }
}

/* ── Right panel ── */
.login-right {
    width: 480px;
    min-width: 420px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 52px;
    overflow-y: auto;
}

.login-form-wrap {
    width: 100%;
    max-width: 360px;
}

.login-logo-sm {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    color: #4F46E5;
    margin-bottom: 28px;
    font-family: var(--font);
}

    .login-logo-sm span:first-child {
        font-size: 18px;
    }

.login-form-title {
    font-size: 26px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    font-family: var(--font);
}

.login-form-sub {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 28px;
    line-height: 1.5;
    font-family: var(--font);
}

.login-tabs {
    display: flex;
    background: #F3F4F6;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}

.login-tab {
    flex: 1;
    padding: 9px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: #6B7280;
    border-radius: 9px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s;
}

    .login-tab.active {
        background: #fff;
        color: #111827;
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    }

.login-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 18px;
    font-weight: 500;
    font-family: var(--font);
}

.login-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .login-field label {
        font-size: 13px;
        font-weight: 600;
        color: #374151;
        font-family: var(--font);
    }

.login-input-wrap {
    position: relative;
}

    .login-input-wrap .login-input {
        padding-right: 62px;
    }

.login-input {
    width: 100%;
    padding: 11px 14px;
    background: #F9FAFB;
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    color: #111827;
    font-size: 14px;
    font-family: var(--font);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    outline: none;
}

    .login-input:focus {
        border-color: #4F46E5;
        box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
        background: #fff;
    }

    .login-input::placeholder {
        color: #9CA3AF;
    }

.login-show-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: #4F46E5;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    padding: 3px 6px;
    border-radius: 6px;
}

    .login-show-pw:hover {
        background: #EEF2FF;
    }

.login-submit {
    width: 100%;
    padding: 13px 20px;
    background: #4F46E5;
    color: #fff;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(79,70,229,0.35);
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    margin-bottom: 16px;
}

    .login-submit:hover {
        background: #4338CA;
        box-shadow: 0 6px 20px rgba(79,70,229,0.4);
    }

    .login-submit:active {
        transform: scale(0.98);
    }

    .login-submit:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

.login-arrow {
    font-size: 18px;
    transition: transform 0.15s;
}

.login-submit:hover .login-arrow {
    transform: translateX(3px);
}

.login-footer {
    font-size: 11.5px;
    color: #9CA3AF;
    text-align: center;
    line-height: 1.5;
    font-family: var(--font);
}

.login-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    display: inline-block;
}

@media (max-width: 720px) {
    .login-left {
        display: none;
    }

    .login-right {
        width: 100%;
        min-width: unset;
    }
}

/* ══════════════════════════════════════
   LOGIN — centred card over animated bg
══════════════════════════════════════ */

.login-page {
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: hidden;
}

/* Full-screen gradient background */
.login-bg {
    position: absolute;
    inset: 0;
    background: #1E1B4B;
    background-image: radial-gradient(ellipse 80% 60% at 15% 85%, rgba(109,40,217,0.55) 0%, transparent 55%), radial-gradient(ellipse 60% 50% at 85% 10%, rgba(139,92,246,0.4) 0%, transparent 50%), radial-gradient(ellipse 40% 40% at 50% 50%, rgba(67,56,202,0.3) 0%, transparent 60%);
}

/* Brand top-left */
.login-topbar {
    position: absolute;
    top: 28px;
    left: 36px;
    display: flex;
    align-items: center;
    gap: 9px;
    z-index: 2;
}

.login-brand-icon {
    font-size: 20px;
    color: rgba(255,255,255,0.85);
}

.login-brand-name {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.4px;
    font-family: var(--font);
}

/* Floating notes across whole page */
.floating-notes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.fnote {
    position: absolute;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 14px 18px;
    width: 230px;
    animation: floatNote 20s ease-in-out infinite;
    opacity: 0;
}

.fnote-title {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    margin-bottom: 6px;
    font-family: var(--font);
}

.fnote-body {
    font-size: 11px;
    line-height: 1.55;
    color: rgba(255,255,255,0.4);
    font-family: var(--font);
}

/* Spread cards across the full viewport */
.fnote-1 {
    left: 3%;
    top: 12%;
    animation-delay: 0s;
    animation-duration: 22s;
}

.fnote-2 {
    left: 72%;
    top: 6%;
    animation-delay: 2.5s;
    animation-duration: 19s;
}

.fnote-3 {
    left: 40%;
    top: 15%;
    animation-delay: 5s;
    animation-duration: 24s;
}

.fnote-4 {
    left: 78%;
    top: 55%;
    animation-delay: 1s;
    animation-duration: 21s;
}

.fnote-5 {
    left: 5%;
    top: 58%;
    animation-delay: 8s;
    animation-duration: 20s;
}

.fnote-6 {
    left: 55%;
    top: 68%;
    animation-delay: 3.5s;
    animation-duration: 23s;
}

.fnote-7 {
    left: 20%;
    top: 75%;
    animation-delay: 6.5s;
    animation-duration: 18s;
}

.fnote-8 {
    left: 65%;
    top: 30%;
    animation-delay: 11s;
    animation-duration: 22s;
}

@keyframes floatNote {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }

    12% {
        opacity: 1;
    }

    75% {
        opacity: 0.6;
    }

    92% {
        opacity: 0;
        transform: translateY(-50px) scale(1.02);
    }

    100% {
        opacity: 0;
        transform: translateY(-60px);
    }
}

/* Centred card wrapper */
.login-card-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    padding: 20px;
}

/* The white rounded card */
.login-card {
    background: #ffffff;
    border-radius: 28px;
    padding: 44px 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.05);
}

.login-card-title {
    font-size: 26px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    font-family: var(--font);
}

.login-card-sub {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 24px;
    line-height: 1.5;
    font-family: var(--font);
}

/* Tabs */
.login-tabs {
    display: flex;
    background: #F3F4F6;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 22px;
    gap: 4px;
}

.login-tab {
    flex: 1;
    padding: 9px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: #6B7280;
    border-radius: 9px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s;
}

    .login-tab.active {
        background: #fff;
        color: #111827;
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    }

/* Error */
.login-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
    font-weight: 500;
    font-family: var(--font);
}

/* Fields */
.login-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .login-field label {
        font-size: 13px;
        font-weight: 600;
        color: #374151;
        font-family: var(--font);
    }

.login-input-wrap {
    position: relative;
}

    .login-input-wrap .login-input {
        padding-right: 62px;
    }

.login-input {
    width: 100%;
    padding: 11px 14px;
    background: #F9FAFB;
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    color: #111827;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

    .login-input:focus {
        border-color: #4F46E5;
        box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
        background: #fff;
    }

    .login-input::placeholder {
        color: #9CA3AF;
    }

.login-show-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: #4F46E5;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    padding: 3px 6px;
    border-radius: 6px;
}

    .login-show-pw:hover {
        background: #EEF2FF;
    }

/* Submit button */
.login-submit {
    width: 100%;
    padding: 13px 20px;
    background: #4F46E5;
    color: #fff;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(79,70,229,0.4);
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    margin-bottom: 16px;
}

    .login-submit:hover {
        background: #4338CA;
        box-shadow: 0 6px 22px rgba(79,70,229,0.45);
    }

    .login-submit:active {
        transform: scale(0.98);
    }

    .login-submit:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

.login-footer {
    font-size: 11.5px;
    color: #9CA3AF;
    text-align: center;
    font-family: var(--font);
}

.login-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    display: inline-block;
}

/* ── Login card title & subtitle — centred, no click outline ── */
.login-card-title {
    text-align: center !important;
    outline: none !important;
    border: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    cursor: default !important;
}

.login-card-sub {
    text-align: center !important;
    outline: none !important;
    user-select: none !important;
    cursor: default !important;
}

/* ══════════════════════════════════════
   HOME PAGE — dark animated background
══════════════════════════════════════ */

.home-page {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Same dark bg as login */
.home-animated-bg {
    position: absolute;
    inset: 0;
    background: #1E1B4B;
    background-image: radial-gradient(ellipse 80% 60% at 15% 85%, rgba(109,40,217,0.55) 0%, transparent 55%), radial-gradient(ellipse 60% 50% at 85% 10%, rgba(139,92,246,0.4) 0%, transparent 50%), radial-gradient(ellipse 40% 40% at 50% 50%, rgba(67,56,202,0.3) 0%, transparent 60%);
    z-index: 0;
}

/* Content sits above the bg */
.home-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Hero bar on dark bg */
.home-hero {
    background: rgba(255,255,255,0.06) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 0 !important;
    padding: 20px 32px 22px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

/* Body — transparent so bg shows through */
.home-body {
    flex: 1;
    padding: 28px 32px 48px;
    overflow-y: auto;
    background: transparent !important;
}

/* Section label on dark bg */
.home-section-title {
    color: rgba(255,255,255,0.5) !important;
}

/* Cards on dark bg — keep white but lift more */
.home-card {
    background: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.2) !important;
}

    .home-card:hover {
        transform: translateY(-4px) !important;
        box-shadow: 0 16px 48px rgba(0,0,0,0.45), 0 4px 12px rgba(0,0,0,0.25) !important;
    }

/* Empty state on dark */
.home-empty {
    color: rgba(255,255,255,0.4) !important;
}

    .home-empty p {
        color: rgba(255,255,255,0.5) !important;
    }

    .home-empty strong {
        color: rgba(255,255,255,0.8) !important;
    }

.home-empty-icon {
    opacity: 0.4 !important;
}

/* Search box on dark hero */
.home-search-box {
    background: #ffffff !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3) !important;
    backdrop-filter: none !important;
}

.home-search-input {
    background: transparent !important;
    color: #111827 !important;
    backdrop-filter: none !important;
    border: none !important;
}

    .home-search-input::placeholder {
        color: #9CA3AF !important;
    }

/* ── Restore coloured top border on home cards ── */
.home-card {
    border-top-width: 4px !important;
    border-top-style: solid !important;
    /* border-top-color comes from inline style on each card */
    border-right: 1px solid rgba(255,255,255,0.12) !important;
    border-bottom: 1px solid rgba(255,255,255,0.12) !important;
    border-left: 1px solid rgba(255,255,255,0.12) !important;
}

/* ── Card accent colour via CSS variable (beats !important) ── */
.home-card {
    border-top: 4px solid var(--card-accent, #4F46E5) !important;
    border-right: 1px solid rgba(255,255,255,0.1) !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    border-left: 1px solid rgba(255,255,255,0.1) !important;
}

/* ══════════════════════════════════════
   SIDEBAR — dark to match home bg
══════════════════════════════════════ */

.sidebar {
    background: #1a1740 !important;
    border-right: 1px solid rgba(255,255,255,0.08) !important;
}

.sidebar-header {
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    background: transparent !important;
}

.brand-name, .workspace-name {
    color: #fff !important;
}

.brand-icon {
    color: rgba(255,255,255,0.85) !important;
}

.sidebar-collapse-btn {
    color: rgba(255,255,255,0.5) !important;
    background: rgba(255,255,255,0.07) !important;
    border-color: rgba(255,255,255,0.1) !important;
}

    .sidebar-collapse-btn:hover {
        background: rgba(255,255,255,0.15) !important;
        color: #fff !important;
    }

.btn-new-notebook {
    background: rgba(255,255,255,0.1) !important;
    color: #fff !important;
}

    .btn-new-notebook:hover {
        background: rgba(255,255,255,0.18) !important;
    }

    .btn-new-notebook .plus-icon {
        background: #4F46E5 !important;
    }

.sidebar-section-label {
    color: rgba(255,255,255,0.35) !important;
}

.nb-title {
    color: rgba(255,255,255,0.85) !important;
}

.nb-chevron {
    color: rgba(255,255,255,0.35) !important;
}

.nb-icon {
    opacity: 0.9;
}

.notebook-header:hover {
    background: rgba(255,255,255,0.08) !important;
}

.notebook-item.active > .notebook-header {
    background: rgba(255,255,255,0.12) !important;
}

.sec-title {
    color: rgba(255,255,255,0.55) !important;
}

.section-item:hover {
    background: rgba(255,255,255,0.07) !important;
}

.section-item.active {
    background: rgba(79,70,229,0.35) !important;
}

    .section-item.active .sec-title {
        color: #fff !important;
    }

.sec-count {
    background: rgba(255,255,255,0.08) !important;
    color: rgba(255,255,255,0.4) !important;
}

.section-item.active .sec-count {
    background: rgba(79,70,229,0.4) !important;
    color: rgba(255,255,255,0.8) !important;
}

.btn-add-section {
    color: rgba(255,255,255,0.35) !important;
}

    .btn-add-section:hover {
        background: rgba(255,255,255,0.08) !important;
        color: rgba(255,255,255,0.75) !important;
    }

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08) !important;
    background: transparent !important;
}

.theme-toggle {
    color: rgba(255,255,255,0.5) !important;
    background: rgba(255,255,255,0.07) !important;
}

    .theme-toggle:hover {
        background: rgba(255,255,255,0.14) !important;
        color: #fff !important;
    }

.user-name {
    color: rgba(255,255,255,0.85) !important;
}

.logout-btn {
    color: rgba(255,255,255,0.4) !important;
}

    .logout-btn:hover {
        background: rgba(239,68,68,0.2) !important;
        color: #fca5a5 !important;
    }

.settings-link {
    color: rgba(255,255,255,0.4) !important;
}

    .settings-link:hover {
        background: rgba(255,255,255,0.08) !important;
        color: rgba(255,255,255,0.8) !important;
    }

.db-error-banner {
    background: rgba(239,68,68,0.15) !important;
    border-color: rgba(239,68,68,0.3) !important;
    color: #fca5a5 !important;
}

.nb-share-btn {
    color: rgba(255,255,255,0.4) !important;
}

    .nb-share-btn:hover {
        background: rgba(255,255,255,0.1) !important;
        color: #fff !important;
    }

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

/* ── Notification bar — dark to match theme ── */
.notif-bar {
    background: #1a1740 !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

.notif-bell {
    border-color: rgba(255,255,255,0.15) !important;
    background: rgba(255,255,255,0.07) !important;
    color: rgba(255,255,255,0.6) !important;
}

    .notif-bell:hover {
        background: rgba(255,255,255,0.14) !important;
        color: #fff !important;
    }

    .notif-bell.has-notif {
        border-color: #818cf8 !important;
        background: rgba(79,70,229,0.25) !important;
    }

/* ══════════════════════════════════════
   SECTION VIEW — dark theme
══════════════════════════════════════ */

/* Notes list panel */
.notes-panel {
    background: #1a1740 !important;
    border-right: 1px solid rgba(255,255,255,0.08) !important;
}

.notes-panel-header {
    background: #16133a !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

.notes-panel-title {
    color: #fff !important;
}

.note-count {
    background: rgba(255,255,255,0.1) !important;
    color: rgba(255,255,255,0.5) !important;
}

.section-back-btn {
    color: rgba(255,255,255,0.45) !important;
}

    .section-back-btn:hover {
        background: rgba(255,255,255,0.08) !important;
        color: rgba(255,255,255,0.85) !important;
    }

.search-input {
    background: rgba(255,255,255,0.07) !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: #fff !important;
}

    .search-input::placeholder {
        color: rgba(255,255,255,0.3) !important;
    }

    .search-input:focus {
        border-color: #818cf8 !important;
        box-shadow: 0 0 0 3px rgba(129,140,248,0.15) !important;
        background: rgba(255,255,255,0.1) !important;
    }

/* Note cards in list */
.notes-list {
    background: transparent !important;
}

.note-card {
    background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}

    .note-card:hover {
        background: rgba(255,255,255,0.1) !important;
        border-color: rgba(255,255,255,0.15) !important;
        box-shadow: none !important;
    }

    .note-card.active {
        background: rgba(79,70,229,0.3) !important;
        border-color: rgba(129,140,248,0.4) !important;
    }

    .note-card.pinned {
        border-left-color: #818cf8 !important;
    }

.note-card-title {
    color: rgba(255,255,255,0.9) !important;
}

.note-card-preview {
    color: rgba(255,255,255,0.4) !important;
}

.note-card-meta {
    color: rgba(255,255,255,0.3) !important;
}

.notes-empty {
    color: rgba(255,255,255,0.35) !important;
}

.link-btn {
    color: #818cf8 !important;
}

/* Editor panel */
.editor-panel {
    background: #1e1b4b !important;
}

.editor-toolbar {
    background: #16133a !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

.editor-breadcrumb {
    color: rgba(255,255,255,0.4) !important;
}

.breadcrumb-sep {
    color: rgba(255,255,255,0.25) !important;
}

.save-indicator.saved {
    color: #6ee7b7 !important;
    background: rgba(110,231,183,0.12) !important;
}

.save-indicator.saving {
    color: rgba(255,255,255,0.35) !important;
}

.icon-btn {
    color: rgba(255,255,255,0.4) !important;
}

    .icon-btn:hover {
        background: rgba(255,255,255,0.08) !important;
        color: rgba(255,255,255,0.85) !important;
    }

    .icon-btn.pinned {
        color: #818cf8 !important;
    }

    .icon-btn.danger:hover {
        background: rgba(239,68,68,0.2) !important;
        color: #fca5a5 !important;
    }

.editor-title-input {
    color: #fff !important;
}

    .editor-title-input::placeholder {
        color: rgba(255,255,255,0.2) !important;
    }

.editor-divider {
    background: rgba(255,255,255,0.08) !important;
}

.editor-content-input {
    color: rgba(255,255,255,0.85) !important;
}

    .editor-content-input::placeholder {
        color: rgba(255,255,255,0.2) !important;
    }

.editor-empty {
    color: rgba(255,255,255,0.35) !important;
}

    .editor-empty p {
        color: rgba(255,255,255,0.4) !important;
    }

.editor-empty-icon {
    background: rgba(255,255,255,0.07) !important;
}

/* New note button stays indigo */
.btn-new-note {
    background: #4F46E5 !important;
    box-shadow: 0 2px 8px rgba(79,70,229,0.4) !important;
}

    .btn-new-note:hover {
        background: #4338CA !important;
    }

/* ── Editor body — tighter under the toolbar ── */
.editor-body {
    padding: 24px 48px 36px !important;
    max-width: 860px !important;
}

.editor-title-input {
    font-size: 28px !important;
    margin-bottom: 4px !important;
}

/* ── Editor body — left aligned under breadcrumb ── */
.editor-body {
    margin: 0 !important;
    padding: 24px 32px 36px !important;
    max-width: 100% !important;
}

/* ══════════════════════════════════════
   QUILL RICH TEXT EDITOR — dark theme
══════════════════════════════════════ */

.quill-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Override Quill snow theme for dark */
.ql-toolbar.ql-snow {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 10px !important;
    margin-bottom: 12px;
    padding: 8px 10px;
}

.ql-snow .ql-stroke {
    stroke: rgba(255,255,255,0.6) !important;
}

.ql-snow .ql-fill {
    fill: rgba(255,255,255,0.6) !important;
}

.ql-snow .ql-picker-label {
    color: rgba(255,255,255,0.6) !important;
}

.ql-toolbar.ql-snow .ql-picker-options {
    background: #1e1b4b !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 8px !important;
}

.ql-toolbar.ql-snow button:hover .ql-stroke,
.ql-toolbar.ql-snow .ql-active .ql-stroke {
    stroke: #818cf8 !important;
}

.ql-toolbar.ql-snow button:hover .ql-fill,
.ql-toolbar.ql-snow .ql-active .ql-fill {
    fill: #818cf8 !important;
}

.ql-toolbar.ql-snow button:hover,
.ql-toolbar.ql-snow .ql-active {
    background: rgba(129,140,248,0.15) !important;
    border-radius: 6px !important;
}

.ql-snow .ql-picker-label:hover,
.ql-snow .ql-picker-label.ql-active {
    color: #818cf8 !important;
}

.ql-snow .ql-picker-item:hover,
.ql-snow .ql-picker-item.ql-selected {
    color: #818cf8 !important;
}

/* Editor area */
.ql-container.ql-snow {
    border: none !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    font-family: var(--font) !important;
    font-size: 15px !important;
    overflow: hidden;
}

.ql-editor {
    flex: 1;
    color: rgba(255,255,255,0.88) !important;
    font-family: var(--font) !important;
    font-size: 15px !important;
    line-height: 1.8 !important;
    padding: 0 !important;
    overflow-y: auto;
}

    .ql-editor.ql-blank::before {
        color: rgba(255,255,255,0.2) !important;
        font-style: normal !important;
        font-family: var(--font) !important;
    }

    .ql-editor h1, .ql-editor h2, .ql-editor h3 {
        color: #fff !important;
        font-weight: 700 !important;
        letter-spacing: -0.3px;
    }

    .ql-editor h1 {
        font-size: 26px !important;
        margin-bottom: 10px;
    }

    .ql-editor h2 {
        font-size: 20px !important;
        margin-bottom: 8px;
    }

    .ql-editor h3 {
        font-size: 16px !important;
        margin-bottom: 6px;
    }

    .ql-editor blockquote {
        border-left: 3px solid rgba(129,140,248,0.6) !important;
        color: rgba(255,255,255,0.55) !important;
        padding-left: 16px !important;
        margin: 12px 0 !important;
    }

    .ql-editor code, .ql-editor pre {
        background: rgba(0,0,0,0.3) !important;
        color: #a5f3fc !important;
        border-radius: 6px !important;
    }

        .ql-editor pre.ql-syntax {
            background: rgba(0,0,0,0.4) !important;
            padding: 14px 18px !important;
            border-radius: 10px !important;
        }

    .ql-editor a {
        color: #818cf8 !important;
    }

    .ql-editor img {
        max-width: 100% !important;
        border-radius: 10px !important;
        margin: 8px 0 !important;
    }

    .ql-editor ul, .ql-editor ol {
        padding-left: 1.5em !important;
    }

    /* Scrollbar inside Quill */
    .ql-editor::-webkit-scrollbar {
        width: 5px;
    }

    .ql-editor::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.1);
        border-radius: 3px;
    }

/* ── Quill image resize bar ── */
.ql-img-resize-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 4px;
    flex-wrap: wrap;
}

    .ql-img-resize-bar span {
        font-size: 11px;
        font-weight: 600;
        color: rgba(255,255,255,0.5);
        font-family: var(--font);
    }

    .ql-img-resize-bar button {
        padding: 3px 10px;
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: 6px;
        font-size: 11.5px;
        font-weight: 600;
        color: rgba(255,255,255,0.7);
        cursor: pointer;
        font-family: var(--font);
        transition: background 0.12s, color 0.12s;
    }

        .ql-img-resize-bar button:hover {
            background: rgba(129,140,248,0.3);
            color: #fff;
            border-color: rgba(129,140,248,0.4);
        }

    .ql-img-resize-bar .ql-img-close {
        color: rgba(239,68,68,0.7);
        border-color: rgba(239,68,68,0.2);
        margin-left: 4px;
    }

        .ql-img-resize-bar .ql-img-close:hover {
            background: rgba(239,68,68,0.2);
            color: #fca5a5;
        }

.ql-editor img[data-resizing] {
    outline: 2px solid #818cf8 !important;
    border-radius: 6px;
}

/* ── Image resize popup (fixed, floats above image) ── */
#ql-img-popup.ql-img-resize-bar {
    position: fixed !important;
    background: #1e1b4b !important;
    border: 1px solid rgba(129,140,248,0.4) !important;
    border-radius: 12px !important;
    padding: 8px 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    z-index: 9000 !important;
}

/* ── Notebook lock icons & password UI ── */
.nb-lock-icon {
    font-size: 12px;
    opacity: 0.6;
    flex-shrink: 0;
}

.nb-lock-btn {
    opacity: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, background 0.12s;
    flex-shrink: 0;
}

.notebook-header:hover .nb-lock-btn {
    opacity: 1;
}

.nb-lock-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Notification share password input */
.notif-password-row {
    margin-bottom: 8px;
}

.notif-pw-input {
    width: 100%;
    padding: 7px 11px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #111827;
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    background: #F9FAFB;
    border-color: #E5E7EB;
}

    .notif-pw-input:focus {
        border-color: #4F46E5;
        box-shadow: 0 0 0 2px rgba(79,70,229,0.1);
    }

/* ── Sidebar wider + full notebook title ── */
.sidebar {
    width: 300px !important;
    min-width: 300px !important;
}

    .sidebar.collapsed {
        width: 60px !important;
        min-width: 60px !important;
    }

.nb-title {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word !important;
    flex: 1 !important;
    min-width: 0 !important;
    line-height: 1.3 !important;
}

/* Collapse action buttons to 0 width when not hovered so title gets full space */
.nb-share-btn,
.nb-lock-btn,
.nb-delete-btn {
    width: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0;
    transition: width 0.15s, opacity 0.15s;
}

.notebook-header:hover .nb-share-btn,
.notebook-header:hover .nb-lock-btn,
.notebook-header:hover .nb-delete-btn {
    width: 22px !important;
    opacity: 1 !important;
    padding: 0 !important;
}

/* ── Notebook row tinted background ── */
.notebook-item {
    transition: background 0.15s !important;
}

    /* Active notebook — stronger tint + left accent bar */
    .notebook-item.active {
        background: transparent !important; /* colour set via inline style with higher opacity */
    }

        .notebook-item.active > .notebook-header {
            background: rgba(255,255,255,0.12) !important;
        }

    /* Make sure text stays readable on tinted rows */
    .notebook-item .nb-title {
        color: rgba(255,255,255,0.9) !important;
    }

    .notebook-item .nb-chevron {
        color: rgba(255,255,255,0.4) !important;
    }

/* ── Notebook edit button ── */
.nb-edit-btn {
    opacity: 0;
    width: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border-radius: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: width 0.15s, opacity 0.15s, background 0.12s;
}

.notebook-header:hover .nb-edit-btn {
    opacity: 1;
    width: 22px;
}

.nb-edit-btn:hover {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
}

/* ══════════════════════════════════════
   SETTINGS PANEL MODAL — dark theme
══════════════════════════════════════ */

.sp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    animation: fade-in 0.15s ease;
}

.sp-modal {
    display: flex;
    width: 860px;
    max-width: calc(100vw - 32px);
    height: 580px;
    max-height: calc(100vh - 48px);
    background: #16133a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6);
    animation: slide-up 0.2s cubic-bezier(0.34,1.3,0.64,1);
}

/* Left nav */
.sp-nav {
    width: 220px;
    flex-shrink: 0;
    background: #0f0d2e;
    border-right: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    padding: 28px 0 20px;
}

.sp-nav-profile {
    padding: 0 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.sp-nav-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
}

.sp-nav-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.sp-nav-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    font-family: var(--font);
}

.sp-nav-company {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    font-family: var(--font);
}

.sp-nav-tabs {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px;
}

.sp-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.12s, color 0.12s;
    text-align: left;
}

    .sp-tab:hover {
        background: rgba(255,255,255,0.07);
        color: rgba(255,255,255,0.85);
    }

    .sp-tab.active {
        background: rgba(79,70,229,0.3);
        color: #fff;
    }

    .sp-tab span {
        font-size: 16px;
    }

/* Right content */
.sp-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sp-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

    .sp-content-header h2 {
        font-size: 18px;
        font-weight: 700;
        color: #fff;
        letter-spacing: -0.3px;
        font-family: var(--font);
    }

.sp-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,0.07);
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}

    .sp-close:hover {
        background: rgba(255,255,255,0.14);
        color: #fff;
    }

.sp-content-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px 28px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sp-section {
    margin-bottom: 24px;
}

.sp-section-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-bottom: 14px;
    font-family: var(--font);
}

/* Avatar row */
.sp-avatar-row {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.sp-avatar-preview {
    position: relative;
    flex-shrink: 0;
}

.sp-avatar-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
}

.sp-avatar-initials {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.sp-avatar-remove {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #EF4444;
    color: #fff;
    font-size: 10px;
    border: 2px solid #16133a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sp-avatar-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sp-btn-upload {
    padding: 8px 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.12s;
}

    .sp-btn-upload:hover {
        background: rgba(255,255,255,0.14);
    }

.sp-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .sp-color-row span {
        font-size: 11px;
        color: rgba(255,255,255,0.4);
        font-family: var(--font);
    }

.sp-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.12s;
}

    .sp-color-swatch:hover {
        transform: scale(1.2);
    }

    .sp-color-swatch.selected {
        border-color: #fff;
        transform: scale(1.2);
    }

.sp-field-error {
    font-size: 12px;
    color: #fca5a5;
    font-family: var(--font);
}

/* Fields */
.sp-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.sp-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sp-field-full {
    grid-column: 1 / -1;
}

.sp-field label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    font-family: var(--font);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sp-input {
    width: 100%;
    padding: 10px 13px;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-family: var(--font);
    transition: border-color 0.15s, background 0.15s;
}

    .sp-input:focus {
        border-color: #818cf8;
        background: rgba(255,255,255,0.1);
        outline: none;
        box-shadow: 0 0 0 3px rgba(129,140,248,0.15);
    }

    .sp-input:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    .sp-input::placeholder {
        color: rgba(255,255,255,0.2);
    }

/* Account info */
.sp-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.sp-info-item {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 14px 16px;
}

.sp-info-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    font-family: var(--font);
}

.sp-info-value {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    font-family: var(--font);
    word-break: break-all;
}

/* Messages */
.sp-success {
    margin-bottom: 14px;
    padding: 10px 14px;
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 10px;
    font-size: 13px;
    color: #6ee7b7;
    font-family: var(--font);
}

.sp-error {
    margin-bottom: 14px;
    padding: 10px 14px;
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 10px;
    font-size: 13px;
    color: #fca5a5;
    font-family: var(--font);
}

/* Save button */
.sp-save-btn {
    padding: 10px 24px;
    background: #4F46E5;
    color: #fff;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79,70,229,0.4);
    transition: background 0.12s;
}

    .sp-save-btn:hover {
        background: #4338CA;
    }

    .sp-save-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* ══════════════════════════════════════
   PROSPECT SEARCH PAGE
══════════════════════════════════════ */

.prospects-page {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.prospects-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px 48px;
    display: flex;
    flex-direction: column;
}

.prospect-no-key {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(255,255,255,0.7);
    padding: 40px;
}

    .prospect-no-key h2 {
        font-size: 22px;
        font-weight: 700;
        color: #fff;
        margin-bottom: 12px;
        font-family: var(--font);
    }

    .prospect-no-key p {
        font-size: 14px;
        line-height: 1.6;
        color: rgba(255,255,255,0.5);
        font-family: var(--font);
    }

.prospect-layout {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

/* ── Left search panel ── */
.prospect-search-panel {
    width: 280px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    max-height: 100%;
}

.psp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .psp-header h3 {
        font-size: 14px;
        font-weight: 700;
        color: #fff;
        font-family: var(--font);
    }

.psp-reset {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
}

    .psp-reset:hover {
        color: rgba(255,255,255,0.8);
    }

.psp-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.psp-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.psp-filter-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255,255,255,0.4);
    font-family: var(--font);
}

.psp-remove-filter {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .psp-remove-filter:hover {
        background: rgba(239,68,68,0.25);
        color: #fca5a5;
    }

.psp-input {
    width: 100%;
    padding: 9px 12px;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s;
}

    .psp-input:focus {
        border-color: #818cf8;
        box-shadow: 0 0 0 3px rgba(129,140,248,0.12);
    }

    .psp-input::placeholder {
        color: rgba(255,255,255,0.25);
    }

.psp-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.psp-suggestion {
    padding: 3px 9px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-family: var(--font);
}

    .psp-suggestion:hover {
        background: rgba(129,140,248,0.2);
        border-color: rgba(129,140,248,0.4);
        color: #fff;
    }

.psp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.psp-chip {
    padding: 4px 11px;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.12s;
}

    .psp-chip:hover {
        background: rgba(255,255,255,0.1);
        color: rgba(255,255,255,0.9);
    }

    .psp-chip.active {
        background: rgba(79,70,229,0.35);
        border-color: rgba(129,140,248,0.6);
        color: #fff;
    }

.psp-add-filter-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.psp-add-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    font-family: var(--font);
}

.psp-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.psp-filter-opt {
    padding: 4px 10px;
    background: rgba(129,140,248,0.1);
    border: 1px solid rgba(129,140,248,0.2);
    border-radius: 8px;
    font-size: 11.5px;
    color: rgba(129,140,248,0.9);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.12s;
}

    .psp-filter-opt:hover {
        background: rgba(129,140,248,0.25);
        border-color: rgba(129,140,248,0.5);
        color: #fff;
    }

.psp-per-page {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .psp-per-page label {
        font-size: 12px;
        color: rgba(255,255,255,0.4);
        font-family: var(--font);
        white-space: nowrap;
    }

.psp-select {
    flex: 1;
    padding: 7px 10px;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-family: var(--font);
    outline: none;
}

    .psp-select option {
        background: #1e1b4b;
    }

.psp-search-btn {
    padding: 11px;
    background: #4F46E5;
    color: #fff;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    box-shadow: 0 4px 14px rgba(79,70,229,0.4);
    transition: background 0.12s;
}

    .psp-search-btn:hover {
        background: #4338CA;
    }

    .psp-search-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.psp-error {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12.5px;
    color: #fca5a5;
    font-family: var(--font);
}

.psp-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #818cf8;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Right results panel ── */
.prospect-results-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    overflow: hidden;
    min-height: 0;
}

.prp-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.35);
    font-family: var(--font);
    font-size: 14px;
}

.prp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.prp-count {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    font-family: var(--font);
}

.prp-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prp-select-all {
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.12s;
}

    .prp-select-all:hover {
        background: rgba(255,255,255,0.12);
        color: #fff;
    }

.prp-import-btn {
    padding: 7px 16px;
    background: #4F46E5;
    color: #fff;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    box-shadow: 0 2px 8px rgba(79,70,229,0.4);
    transition: background 0.12s;
}

    .prp-import-btn:hover {
        background: #4338CA;
    }

.prp-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.prp-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

    .prp-card:hover {
        background: rgba(255,255,255,0.05);
    }

    .prp-card.selected {
        background: rgba(79,70,229,0.15) !important;
        border-left: 3px solid #818cf8;
    }

.prp-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    flex-shrink: 0;
    transition: all 0.12s;
}

    .prp-checkbox.checked {
        background: #4F46E5;
        border-color: #4F46E5;
    }

.prp-card-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.prp-avatar-initials {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(129,140,248,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.prp-card-body {
    flex: 1;
    min-width: 0;
}

.prp-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    font-family: var(--font);
}

.prp-card-title {
    font-size: 12.5px;
    color: rgba(255,255,255,0.5);
    font-family: var(--font);
    margin-top: 1px;
}

.prp-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.prp-badge {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-family: var(--font);
}

    .prp-badge.email {
        background: rgba(79,70,229,0.2);
        color: #a5b4fc;
    }

    .prp-badge.phone {
        background: rgba(5,150,105,0.2);
        color: #6ee7b7;
    }

    .prp-badge.loc {
        background: rgba(255,255,255,0.06);
        color: rgba(255,255,255,0.45);
    }

.prp-linkedin {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #0A66C2;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
}

    .prp-linkedin:hover {
        background: #0856a0;
    }

.prp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    font-family: var(--font);
    flex-shrink: 0;
}

.prp-page-btn {
    padding: 7px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.12s;
}

    .prp-page-btn:hover:not(:disabled) {
        background: rgba(255,255,255,0.15);
        color: #fff;
    }

    .prp-page-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

/* Prospects sidebar button */
.prospects-nav-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,0.07);
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}

    .prospects-nav-btn:hover {
        background: rgba(255,255,255,0.14);
        color: #fff;
    }

/* ── Prospect search — static dark bg, no animation ── */
.prospects-static-bg {
    position: absolute;
    inset: 0;
    background: #1E1B4B;
    background-image: radial-gradient(ellipse 60% 50% at 20% 80%, rgba(67,56,202,0.4) 0%, transparent 55%), radial-gradient(ellipse 40% 40% at 80% 20%, rgba(109,40,217,0.25) 0%, transparent 50%);
    z-index: 0;
}

/* ── Prospect tabs ── */
.prospect-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.prospect-tab {
    padding: 8px 16px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s;
}

    .prospect-tab:hover {
        background: rgba(255,255,255,0.12);
        color: rgba(255,255,255,0.9);
    }

    .prospect-tab.active {
        background: rgba(79,70,229,0.35);
        border-color: rgba(129,140,248,0.5);
        color: #fff;
    }

/* ── Hunter find result card ── */
.hunter-find-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 20px 22px;
}

.hfc-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(79,70,229,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.hfc-body {
    flex: 1;
}

.hfc-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    font-family: var(--font);
}

.hfc-title {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin: 4px 0 12px;
    font-family: var(--font);
}

.hfc-email {
    font-size: 14px;
    color: #a5b4fc;
    font-family: var(--font);
    margin-bottom: 10px;
}

.hfc-noemail {
    font-size: 13px;
    color: rgba(255,255,255,0.35);
    font-family: var(--font);
}

.hfc-score {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hfc-score-bar {
    height: 5px;
    background: #4F46E5;
    border-radius: 3px;
    max-width: 200px;
    transition: width 0.4s;
}

.hfc-score span {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    font-family: var(--font);
}

.psp-success {
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #6ee7b7;
    font-family: var(--font);
}

/* ══════════════════════════════════════
   ADMIN AREA
══════════════════════════════════════ */

.admin-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: fixed;
    inset: 0;
    background: #0f0d2e;
    font-family: var(--font);
}

/* ── Sidebar ── */
.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #0a0820;
    border-right: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    padding: 28px 0 20px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 28px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 16px;
}

.admin-brand-icon {
    font-size: 20px;
    color: #818cf8;
}

.admin-brand-name {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px;
    flex: 1;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

    .admin-nav-item:hover {
        background: rgba(255,255,255,0.07);
        color: rgba(255,255,255,0.85);
    }

    .admin-nav-item.active {
        background: rgba(79,70,229,0.3);
        color: #fff;
    }

.admin-sidebar-footer {
    padding: 16px 14px 0;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.admin-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(79,70,229,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.admin-user-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
}

.admin-user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
}

.admin-logout {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 6px 4px;
    transition: color 0.12s;
}

    .admin-logout:hover {
        color: #fca5a5;
    }

/* ── Main content ── */
.admin-main {
    flex: 1;
    overflow-y: auto;
    background: #13103a;
    background-image: radial-gradient(ellipse 60% 40% at 80% 20%, rgba(79,70,229,0.15) 0%, transparent 60%);
}

.admin-page {
    padding: 36px 40px;
    max-width: 1100px;
}

.admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
}

    .admin-page-header h1 {
        font-size: 26px;
        font-weight: 800;
        color: #fff;
        letter-spacing: -0.5px;
        margin-bottom: 4px;
    }

    .admin-page-header p {
        font-size: 13px;
        color: rgba(255,255,255,0.4);
    }

.admin-back {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-bottom: 8px;
    display: block;
    transition: color 0.12s;
}

    .admin-back:hover {
        color: rgba(255,255,255,0.8);
    }

/* ── Buttons ── */
.admin-btn-primary {
    padding: 10px 20px;
    background: #4F46E5;
    color: #fff;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    box-shadow: 0 3px 10px rgba(79,70,229,0.4);
    transition: background 0.12s;
}

    .admin-btn-primary:hover {
        background: #4338CA;
    }

    .admin-btn-primary:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.admin-btn-secondary {
    padding: 10px 20px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.12s;
}

    .admin-btn-secondary:hover {
        background: rgba(255,255,255,0.14);
    }

.admin-btn-danger {
    padding: 10px 20px;
    background: #DC2626;
    color: #fff;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.12s;
}

    .admin-btn-danger:hover {
        background: #B91C1C;
    }

.admin-btn-sm {
    padding: 5px 12px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.65);
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.12s;
}

    .admin-btn-sm:hover {
        background: rgba(255,255,255,0.14);
        color: #fff;
    }

    .admin-btn-sm.danger:hover {
        background: rgba(220,38,38,0.25);
        border-color: rgba(220,38,38,0.4);
        color: #fca5a5;
    }

/* ── Messages ── */
.admin-message {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
}

    .admin-message.success {
        background: rgba(16,185,129,0.15);
        border: 1px solid rgba(16,185,129,0.25);
        color: #6ee7b7;
    }

    .admin-message.error {
        background: rgba(220,38,38,0.15);
        border: 1px solid rgba(220,38,38,0.25);
        color: #fca5a5;
    }

/* ── Table ── */
.admin-table-wrap {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
}

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

    .admin-table thead tr {
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }

    .admin-table th {
        padding: 12px 18px;
        text-align: left;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.07em;
        color: rgba(255,255,255,0.35);
    }

    .admin-table td {
        padding: 14px 18px;
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }

    .admin-table tbody tr:last-child td {
        border-bottom: none;
    }

    .admin-table tbody tr:hover {
        background: rgba(255,255,255,0.03);
    }

    .admin-table .inactive-row {
        opacity: 0.5;
    }

.admin-co-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.admin-co-slug {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    margin-top: 2px;
}

.admin-muted {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

.admin-badge {
    padding: 3px 10px;
    background: rgba(129,140,248,0.15);
    color: #a5b4fc;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.admin-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.admin-empty {
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 13px;
    padding: 24px !important;
}

.admin-status {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

    .admin-status.active {
        background: rgba(16,185,129,0.15);
        color: #6ee7b7;
    }

    .admin-status.inactive {
        background: rgba(255,255,255,0.07);
        color: rgba(255,255,255,0.4);
    }

/* ── User cells ── */
.admin-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

    .admin-user-avatar-sm.initials {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: 700;
        color: #fff;
    }

.admin-user-display {
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
}

.admin-user-username {
    font-size: 11.5px;
    color: rgba(255,255,255,0.35);
}

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

.admin-modal {
    background: #1a1740;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 32px 36px;
    width: 480px;
    max-width: calc(100vw - 32px);
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

    .admin-modal h2 {
        font-size: 18px;
        font-weight: 800;
        color: #fff;
        margin-bottom: 20px;
    }

.admin-modal-body {
    font-size: 13.5px;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    margin-bottom: 20px;
}

.admin-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.admin-modal-error {
    padding: 10px 14px;
    background: rgba(220,38,38,0.15);
    border: 1px solid rgba(220,38,38,0.25);
    border-radius: 10px;
    font-size: 13px;
    color: #fca5a5;
    margin-top: 12px;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

    .admin-field label {
        font-size: 12px;
        font-weight: 700;
        color: rgba(255,255,255,0.4);
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

.admin-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s;
}

    .admin-input:focus {
        border-color: #818cf8;
        box-shadow: 0 0 0 3px rgba(129,140,248,0.12);
    }

    .admin-input::placeholder {
        color: rgba(255,255,255,0.25);
    }

.admin-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    font-size: 13.5px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

/* Add user search */
.admin-user-list {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 6px;
    margin-bottom: 12px;
}

.admin-user-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.12s;
}

    .admin-user-result:hover {
        background: rgba(255,255,255,0.07);
    }

    .admin-user-result:not(:last-child) {
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

.admin-selected-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(79,70,229,0.2);
    border: 1px solid rgba(129,140,248,0.3);
    border-radius: 10px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 4px;
}

/* ── Company cards ── */
.admin-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.admin-co-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: background 0.12s;
}

    .admin-co-card:hover {
        background: rgba(255,255,255,0.08);
    }

    .admin-co-card.inactive {
        opacity: 0.5;
    }

.admin-co-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-co-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

    .admin-co-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.admin-co-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.admin-co-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.admin-co-card-date {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
}

.admin-co-card-actions {
    display: flex;
    gap: 6px;
}

/* Logo upload */
.admin-logo-upload {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
}

.admin-logo-preview {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

    .admin-logo-preview img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.admin-logo-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #EF4444;
    color: #fff;
    font-size: 10px;
    border: 2px solid #1a1740;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Admin empty state */
.admin-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.35);
    font-family: var(--font);
}

    .admin-empty-state p {
        font-size: 14px;
    }

/* Filter bar */
.admin-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Role badges */
.admin-role-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

    .admin-role-badge.superadmin {
        background: rgba(124,58,237,0.25);
        color: #c4b5fd;
    }

    .admin-role-badge.companyadmin {
        background: rgba(79,70,229,0.25);
        color: #a5b4fc;
    }

    .admin-role-badge.user {
        background: rgba(255,255,255,0.07);
        color: rgba(255,255,255,0.45);
    }

/* Company link in table */
.admin-co-link {
    color: #a5b4fc;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

    .admin-co-link:hover {
        text-decoration: underline;
    }

/* ── Admin dark select/dropdown ── */
.admin-select {
    padding: 10px 14px;
    background: #1a1740 !important;
    border: 1.5px solid rgba(255,255,255,0.12) !important;
    border-radius: 10px;
    color: rgba(255,255,255,0.85) !important;
    font-size: 13.5px;
    font-family: var(--font);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.4)' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 32px !important;
    transition: border-color 0.15s;
}

    .admin-select:focus {
        border-color: #818cf8 !important;
        box-shadow: 0 0 0 3px rgba(129,140,248,0.12);
    }

    .admin-select option {
        background: #1a1740 !important;
        color: rgba(255,255,255,0.85) !important;
    }

/* ── Import page ── */
.import-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px 48px;
}

.import-dropzone {
    border: 2px dashed rgba(129,140,248,0.4);
    border-radius: 20px;
    padding: 56px 32px;
    text-align: center;
    cursor: pointer;
    background: rgba(79,70,229,0.06);
    transition: all 0.2s;
    max-width: 600px;
    margin: 0 auto 28px;
}

    .import-dropzone:hover, .import-dropzone.drag-over {
        border-color: #818cf8;
        background: rgba(79,70,229,0.12);
    }

.import-dropzone-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.import-dropzone h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    font-family: var(--font);
}

.import-dropzone p {
    font-size: 13.5px;
    color: rgba(255,255,255,0.45);
    font-family: var(--font);
    line-height: 1.6;
}

.import-dropzone-btn {
    margin-top: 20px;
    display: inline-block;
    padding: 10px 24px;
    background: #4F46E5;
    color: #fff;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    box-shadow: 0 3px 10px rgba(79,70,229,0.4);
    transition: background 0.12s;
}

    .import-dropzone-btn:hover {
        background: #4338CA;
    }

.import-how {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 22px 26px;
}

    .import-how h4 {
        font-size: 13px;
        font-weight: 700;
        color: rgba(255,255,255,0.6);
        text-transform: uppercase;
        letter-spacing: 0.07em;
        margin-bottom: 12px;
        font-family: var(--font);
    }

    .import-how ol {
        padding-left: 18px;
        color: rgba(255,255,255,0.6);
        font-size: 13.5px;
        line-height: 1.9;
        font-family: var(--font);
    }

    .import-how p {
        font-size: 12.5px;
        color: rgba(255,255,255,0.35);
        margin-top: 12px;
        font-family: var(--font);
    }

    .import-how strong {
        color: rgba(255,255,255,0.8);
    }

.import-preview {
    max-width: 760px;
    margin: 0 auto;
}

.import-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

    .import-preview-header h3 {
        font-size: 15px;
        font-weight: 700;
        color: #fff;
        font-family: var(--font);
    }

.import-reset {
    font-size: 12.5px;
    color: rgba(255,255,255,0.4);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: color 0.12s;
}

    .import-reset:hover {
        color: rgba(255,255,255,0.8);
    }

.import-nb-name {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

    .import-nb-name label {
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.07em;
        color: rgba(255,255,255,0.4);
        white-space: nowrap;
        font-family: var(--font);
    }

    .import-nb-name input {
        flex: 1;
        padding: 10px 14px;
        background: rgba(255,255,255,0.07);
        border: 1.5px solid rgba(255,255,255,0.12);
        border-radius: 10px;
        color: #fff;
        font-size: 14px;
        font-family: var(--font);
        outline: none;
    }

        .import-nb-name input:focus {
            border-color: #818cf8;
        }

.import-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.import-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: rgba(255,255,255,0.6);
    font-family: var(--font);
    cursor: pointer;
}

.import-select-all {
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 5px 12px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.12s;
}

    .import-select-all:hover {
        background: rgba(255,255,255,0.12);
        color: #fff;
    }

.import-pages-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
    max-height: 420px;
    overflow-y: auto;
}

.import-page-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.12s;
}

    .import-page-item:hover {
        background: rgba(255,255,255,0.08);
    }

    .import-page-item.selected {
        background: rgba(79,70,229,0.15);
        border-color: rgba(129,140,248,0.35);
    }

.import-page-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    font-family: var(--font);
}

.import-page-preview {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    font-family: var(--font);
    margin-top: 3px;
}

.import-page-check {
    flex-shrink: 0;
}

.import-error {
    padding: 12px 16px;
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 12px;
    font-size: 13px;
    color: #fca5a5;
    margin-bottom: 14px;
    font-family: var(--font);
}

.import-success {
    padding: 14px 18px;
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 12px;
    font-size: 13.5px;
    color: #6ee7b7;
    margin-bottom: 14px;
    font-family: var(--font);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.import-goto {
    padding: 7px 16px;
    background: #4F46E5;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: var(--font);
}

.import-btn {
    width: 100%;
    padding: 14px 20px;
    background: #4F46E5;
    color: #fff;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(79,70,229,0.4);
    transition: background 0.12s;
}

    .import-btn:hover:not(:disabled) {
        background: #4338CA;
    }

    .import-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* ══════════════════════════════════════
   QUILL RULED LINES
══════════════════════════════════════ */

.ql-editor {
    background-image: repeating-linear-gradient( to bottom, transparent, transparent calc(1.8em - 1px), rgba(255,255,255,0.06) calc(1.8em - 1px), rgba(255,255,255,0.06) 1.8em ) !important;
    background-attachment: local !important;
    line-height: 1.8em !important;
    padding-top: 4px !important;
}

    /* Make sure paragraphs sit on the lines */
    .ql-editor p,
    .ql-editor li,
    .ql-editor h1,
    .ql-editor h2,
    .ql-editor h3 {
        line-height: 1.8em !important;
    }

/* ── Ruled lines fix — fill full editor height ── */
.ql-editor {
    min-height: 100% !important;
    height: 100% !important;
    background-size: 100% 1.8em !important;
    background-origin: content-box !important;
    background-image: repeating-linear-gradient( to bottom, transparent 0px, transparent calc(1.8em - 1px), rgba(255, 255, 255, 0.08) calc(1.8em - 1px), rgba(255, 255, 255, 0.08) 1.8em ) !important;
    background-attachment: local !important;
}

/* ── Ruled lines — pixel-based, stronger approach ── */
.ql-container.ql-snow {
    background: transparent !important;
}

.ql-editor {
    background-color: transparent !important;
    background-image: repeating-linear-gradient( 180deg, transparent 0px, transparent 27px, rgba(255,255,255,0.1) 27px, rgba(255,255,255,0.1) 28px ) !important;
    background-size: 100% 28px !important;
    background-position: 0 0 !important;
    background-attachment: local !important;
    line-height: 28px !important;
    min-height: 400px !important;
}

    .ql-editor p, .ql-editor li, .ql-editor ol, .ql-editor ul {
        line-height: 28px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

/* ── Section delete button ── */
.sec-delete-btn {
    opacity: 0;
    width: 0;
    overflow: hidden;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
    padding: 0;
    flex-shrink: 0;
    transition: opacity 0.15s, width 0.15s, background 0.12s;
    line-height: 1;
}

.section-item:hover .sec-delete-btn {
    opacity: 1;
    width: 18px;
}

.sec-delete-btn:hover {
    background: rgba(239,68,68,0.25);
    color: #fca5a5;
}

/* ══════════════════════════════════════
   DRAWING / HANDWRITING PANEL
══════════════════════════════════════ */

.drawing-panel {
    display: flex;
    flex-direction: column;
    border: 1.5px solid rgba(129,140,248,0.35);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
    background: rgba(0,0,0,0.25);
    flex-shrink: 0;
}

.drawing-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-wrap: wrap;
}

.drawing-tools {
    display: flex;
    gap: 4px;
}

.draw-tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
}

    .draw-tool-btn:hover {
        background: rgba(255,255,255,0.14);
        color: #fff;
    }

    .draw-tool-btn.active {
        background: rgba(79,70,229,0.4);
        border-color: rgba(129,140,248,0.6);
        color: #fff;
    }

.drawing-colors {
    display: flex;
    gap: 5px;
    align-items: center;
}

.draw-color-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.12s, border-color 0.12s;
    flex-shrink: 0;
}

    .draw-color-btn:hover {
        transform: scale(1.2);
    }

    .draw-color-btn.active {
        border-color: #fff;
        transform: scale(1.2);
    }

.drawing-sizes {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    font-family: var(--font);
}

.draw-size-slider {
    width: 80px;
    height: 4px;
    accent-color: #818cf8;
    cursor: pointer;
}

.drawing-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.draw-action-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.12s;
}

    .draw-action-btn:hover {
        background: rgba(255,255,255,0.14);
        color: #fff;
    }

    .draw-action-btn.primary {
        background: #4F46E5;
        border-color: transparent;
        color: #fff;
        box-shadow: 0 2px 8px rgba(79,70,229,0.4);
    }

        .draw-action-btn.primary:hover {
            background: #4338CA;
        }

.drawing-canvas-wrap {
    width: 100%;
    height: 320px;
    position: relative;
    cursor: crosshair;
    touch-action: none;
}

    .drawing-canvas-wrap canvas {
        width: 100%;
        height: 100%;
        display: block;
    }

/* Active draw button in editor toolbar */
.icon-btn.active-tool {
    background: rgba(79,70,229,0.3) !important;
    color: #a5b4fc !important;
}

/* ── OCR result bar ── */
.ocr-result-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(79,70,229,0.15);
    border: 1px solid rgba(129,140,248,0.3);
    border-radius: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ocr-result-text {
    flex: 1;
    font-size: 13.5px;
    color: #e0e7ff;
    font-family: var(--font);
    line-height: 1.5;
    min-width: 0;
    word-break: break-word;
}

.ocr-error-bar {
    padding: 9px 14px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #fca5a5;
    font-family: var(--font);
}

.draw-action-btn.ocr {
    background: rgba(99,102,241,0.2);
    border-color: rgba(129,140,248,0.35);
    color: #a5b4fc;
}

    .draw-action-btn.ocr:hover {
        background: rgba(99,102,241,0.35);
        color: #fff;
    }

/* ══════════════════════════════════════
   MOBILE RESPONSIVE — PWA
══════════════════════════════════════ */

/* Safe area for notch/home bar */
:root {
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --sar: env(safe-area-inset-right, 0px);
}

/* Mobile sidebar toggle button — hidden on desktop */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    top: calc(14px + var(--sat));
    left: 14px;
    z-index: 200;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(79,70,229,0.85);
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 18px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
}

/* Mobile overlay when sidebar is open */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}

    .sidebar-overlay.visible {
        display: block;
    }


/* ══════════════════════════════════════
   MOBILE — single clean block
══════════════════════════════════════ */


/* ══════════════════════════════════════
   MOBILE — one clean block, no conflicts
══════════════════════════════════════ */

/* ══════════════════════════════════════
   MOBILE — body.is-mobile (JS class, max specificity)
══════════════════════════════════════ */

body.is-mobile {
    overflow: hidden;
}

    /* Break the flex layout — sidebar no longer takes space */
    body.is-mobile .app-shell {
        display: block;
        position: relative;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }

    /* Notif bar pinned at top */
    body.is-mobile .notif-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100vw;
        height: 52px;
        z-index: 500;
        display: flex;
        align-items: center;
        padding: 0 12px;
        gap: 10px;
        box-sizing: border-box;
    }

    body.is-mobile .notif-bell {
        margin-left: auto;
    }

    body.is-mobile .mobile-sidebar-toggle {
        display: flex;
        flex-shrink: 0;
    }

    /* Sidebar — out of flow, slides in */
    body.is-mobile .sidebar {
        position: fixed;
        top: 52px;
        left: 0;
        bottom: 0;
        width: 280px;
        min-width: 0;
        max-width: 85vw;
        z-index: 400;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

        body.is-mobile .sidebar.open {
            transform: translateX(0);
        }

    body.is-mobile .sidebar-collapse-btn {
        display: none;
    }

    body.is-mobile .sidebar-overlay {
        display: none;
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.55);
        z-index: 399;
    }

        body.is-mobile .sidebar-overlay.visible {
            display: block;
        }

    /* Main content — fills full screen below notif bar */
    body.is-mobile .main-content {
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        padding: 0;
        overflow-y: auto;
        overflow-x: hidden;
        background: #1E1B4B;
    }

    /* Floating notes — hide */
    body.is-mobile .floating-notes, body.is-mobile .fnote {
        display: none;
    }

    body.is-mobile .home-animated-bg {
        overflow: hidden;
    }

    /* Home page */
    body.is-mobile .home-page,
    body.is-mobile .home-content {
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }

    body.is-mobile .home-hero {
        padding: 14px;
        overflow: hidden;
    }

    body.is-mobile .home-hero-row1 {
        flex-wrap: wrap;
        gap: 6px;
        overflow: hidden;
    }

    body.is-mobile .home-hero-name {
        font-size: 20px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100vw - 100px);
    }

    body.is-mobile .home-hero-divider {
        display: none;
    }

    body.is-mobile .home-hero-dot {
        display: none;
    }

    body.is-mobile .home-hero-stat {
        font-size: 12px;
    }

    body.is-mobile .home-avatar {
        width: 36px;
        height: 36px;
    }

    body.is-mobile .home-search-outer,
    body.is-mobile .home-search-box {
        width: 100%;
    }

    body.is-mobile .home-body {
        padding: 12px;
        padding-bottom: 80px;
        width: 100vw;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Grid — force single column */
    body.is-mobile .home-grid {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    /* Cards — fully contained */
    body.is-mobile .home-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow: hidden;
        border-top: 4px solid var(--card-accent, #4F46E5);
    }

    body.is-mobile .home-card-crumb {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.is-mobile .home-card-preview {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    body.is-mobile .home-card-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Section view */
    body.is-mobile .section-page {
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    body.is-mobile .notes-panel {
        width: 100%;
        height: 170px;
        max-height: 170px;
        flex-shrink: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    body.is-mobile .editor-panel {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    body.is-mobile .editor-body {
        padding: 12px;
        margin: 0;
        max-width: 100%;
    }

    /* Login */
    body.is-mobile .login-bg .floating-notes {
        display: none;
    }

    body.is-mobile .login-card-wrap {
        align-items: flex-end;
        padding: 0;
    }

    body.is-mobile .login-card {
        width: 100vw;
        max-width: 100vw;
        border-radius: 24px 24px 0 0;
        padding: 28px 20px 36px;
    }

    /* Modals */
    body.is-mobile .modal, body.is-mobile .modal-sm {
        width: calc(100vw - 20px);
    }

    body.is-mobile .sp-modal {
        flex-direction: column;
        width: calc(100vw - 16px);
        height: 90vh;
    }

    body.is-mobile .sp-nav {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.07);
        padding: 10px;
    }

    body.is-mobile .sp-nav-profile {
        display: none;
    }

    body.is-mobile .sp-nav-tabs {
        flex-direction: row;
        width: 100%;
    }

    body.is-mobile .sp-tab {
        flex: 1;
        font-size: 11px;
        padding: 6px 4px;
    }

    /* ══════════════════════════════════════
   MOBILE FINAL — targeting confirmed structure
   body.is-mobile confirmed working
   sidebar is flex child — must remove it from flow
══════════════════════════════════════ */

    body.is-mobile aside.sidebar {
        position: fixed !important;
        top: 52px !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        min-width: 0 !important;
        max-width: 85vw !important;
        z-index: 400 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.25s ease !important;
        flex-shrink: 0 !important;
        /* Remove from flex flow */
        margin-right: -280px !important;
    }

        body.is-mobile aside.sidebar.open {
            transform: translateX(0) !important;
        }

    body.is-mobile main.main-content {
        position: fixed !important;
        top: 52px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: 0 !important;
        flex: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        background: #1E1B4B !important;
    }

    body.is-mobile div.app-shell,
    body.is-mobile .theme-dark.app-shell,
    body.is-mobile .theme-light.app-shell {
        display: block !important;
    }

    /* Home body background fix for mobile */
    body.is-mobile .home-body {
        background: transparent !important;
    }

/* ══════════════════════════════════════
   MOBILE — nuclear option
   Sidebar width 0, no flex offset
══════════════════════════════════════ */
@media (max-width: 900px) {

    /* Kill sidebar width in flex */
    .app-shell > aside,
    .app-shell > aside.sidebar,
    aside.sidebar {
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        overflow: hidden !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        z-index: 400 !important;
        transition: max-width 0.25s ease !important;
    }

        aside.sidebar.open {
            width: 280px !important;
            max-width: 280px !important;
            overflow: visible !important;
        }

    /* Main content now fills full width */
    main.main-content {
        width: 100% !important;
        max-width: 100vw !important;
        margin-left: 0 !important;
        overflow-x: hidden !important;
    }

    /* Notif bar full width */
    .notif-bar {
        width: 100% !important;
        max-width: 100vw !important;
        overflow: hidden !important;
    }

    /* Home page and all children */
    .home-page, .home-content, .home-hero,
    .home-body, .home-grid, .home-card,
    .home-search-outer, .home-search-box {
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Floating notes must not create width */
    .home-animated-bg, .floating-notes {
        overflow: hidden !important;
        max-width: 100vw !important;
    }

    .fnote {
        display: none !important;
    }

    /* Show hamburger */
    .mobile-sidebar-toggle {
        display: flex !important;
    }

    .sidebar-collapse-btn {
        display: none !important;
    }
}

/* ── Mobile width stretch + content fill ── */
@media (max-width: 900px) {
    main.main-content {
        width: 100vw !important;
        flex: none !important;
    }

    .home-hero {
        width: 100% !important;
        border-radius: 0 !important;
    }

    .home-body {
        padding: 12px !important;
        padding-bottom: 80px !important;
    }

    /* Scrollbar causing right gap */
    main.main-content::-webkit-scrollbar {
        width: 0 !important;
    }

    /* Overlay visible when sidebar open */
    .sidebar-overlay {
        display: none;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0,0,0,0.5) !important;
        z-index: 399 !important;
    }

        .sidebar-overlay.visible {
            display: block !important;
        }
}

/* ══════════════════════════════════════
   MOBILE — kill all large padding
══════════════════════════════════════ */
@media (max-width: 900px) {

    /* Remove all large side padding from containers */
    .home-page {
        padding: 0 !important;
    }

    .home-hero {
        padding: 14px 14px 16px !important;
    }

    .home-body {
        padding: 10px 10px 80px !important;
    }

    .home-hero-inner {
        max-width: 100% !important;
    }

    /* Cards full width */
    .home-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .home-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Main content truly full width */
    main.main-content {
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 0 !important;
        margin: 0 !important;
        left: 0 !important;
    }

    /* Hide scrollbar gap */
    main.main-content,
    .home-body {
        scrollbar-width: none !important;
    }

        main.main-content::-webkit-scrollbar,
        .home-body::-webkit-scrollbar {
            display: none !important;
        }

    /* Sidebar overlay — full screen tap to close */
    .sidebar-overlay {
        position: fixed !important;
        inset: 0 !important;
        z-index: 350 !important;
        background: rgba(0,0,0,0.5) !important;
        display: none !important;
        cursor: pointer !important;
    }

        .sidebar-overlay.visible {
            display: block !important;
        }
}

/* ── Card accent top border — restore on mobile ── */
@media (max-width: 900px) {
    .home-card {
        border-top: 4px solid var(--card-accent, #4F46E5) !important;
        border-right: 1px solid rgba(255,255,255,0.08) !important;
        border-bottom: 1px solid rgba(255,255,255,0.08) !important;
        border-left: 1px solid rgba(255,255,255,0.08) !important;
    }
}

/* ══════════════════════════════════════
   REAL-TIME COLLABORATION UI
══════════════════════════════════════ */

/* Active editors in note toolbar */
.active-editors {
    display: flex;
    align-items: center;
    gap: -6px;
    margin-left: 12px;
}

.active-editor-avatar {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #1e1b4b;
    margin-left: -6px;
    cursor: default;
}

    .active-editor-avatar img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
    }

.active-editor-initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

.active-editor-pulse {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    border: 1.5px solid #1e1b4b;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Last edited by */
.last-edited-by {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    margin-left: 14px;
    font-family: var(--font);
    white-space: nowrap;
}

.last-edited-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.last-edited-initial {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    color: #fff;
}

/* ── Incoming share toast ── */
.incoming-share-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    cursor: pointer;
    position: relative;
    animation: toast-in 0.35s cubic-bezier(0.34,1.3,0.64,1);
    max-width: 280px;
    border: 1px solid #E8EAF0;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.95);
    }

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

.incoming-share-toast:hover {
    background: #F5F6FF;
}

.ist-avatar {
    flex-shrink: 0;
}

    .ist-avatar img {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
    }

.ist-initials {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.ist-body {
    min-width: 0;
}

.ist-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #111827;
    font-family: var(--font);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ist-sub {
    font-size: 11.5px;
    color: #6B7280;
    font-family: var(--font);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ist-pulse {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #4F46E5;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}
@media (max-width: 900px) {
    .notif-panel {
        position: fixed !important;
        top: 52px !important;
        right: 8px !important;
        left: 8px !important;
        width: auto !important;
        z-index: 600 !important;
        max-height: 70vh !important;
        overflow-y: auto !important;
    }
}

