/* ============================================================
   MON CAHIER PREMIUM - DESIGN NOTION AI
   VERSION 6.0 - COULEURS NEUTRES & SOBRES
   ============================================================ */

:root {
    /* ---- Palette Notion AI (neutre, sobre) ---- */
    --premium-bg: #f7f6f3;
    --premium-panel-bg: #ffffff;
    --premium-border: #efeee9;
    --premium-border-hover: #e3e2dc;
    --premium-text: #191919;
    --premium-text-secondary: #8C8382;
    --premium-text-muted: #9b9b9b;
    --premium-text-light: #c4c4c4;
    
    /* ---- Accents - GRIS UNIQUEMENT ---- */
    --premium-accent: #8C8382;
    --premium-accent-soft: rgba(107, 107, 107, 0.08);
    --premium-accent-hover: #4a4a4a;
    --premium-gold: #8b8b8b;
    
    /* ---- Ombres douces ---- */
    --premium-shadow: 0 1px 3px rgba(0,0,0,0.04);
    --premium-shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --premium-shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
    
    /* ---- Rayons ---- */
    --premium-radius: 8px;
    --premium-radius-lg: 12px;
    
    /* ---- Transitions ---- */
    --transition-smooth: all 0.15s ease;
}

/* ============================================================
   MODE SOMBRE NOTION AI
   ============================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --premium-bg: #191919;
        --premium-panel-bg: #1f1f1f;
        --premium-border: #2a2a2a;
        --premium-border-hover: #3a3a3a;
        --premium-text: #ebebeb;
        --premium-text-secondary: #9b9b9b;
        --premium-text-muted: #6b6b6b;
        --premium-text-light: #4b4b4b;
        --premium-accent: #9b9b9b;
        --premium-accent-soft: rgba(155, 155, 155, 0.08);
        --premium-gold: #8b8b8b;
    }
}

/* ============================================================
   CONTENEUR PRINCIPAL
   ============================================================ */
#notebookFullscreen {
    background: var(--premium-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    border: none;
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 0;
    position: relative;
    box-shadow: none;
}

#notebookFullscreen.visible {
    display: flex;
}

/* ============================================================
   HEADER - NOTION STYLE
   ============================================================ */
.premium-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 10px 20px;
    border-bottom: 1px solid var(--premium-border);
    flex-shrink: 0;
    background: var(--premium-panel-bg);
}

.premium-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.premium-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: var(--premium-radius);
    background: var(--premium-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--premium-border);
}

.premium-icon-wrapper i {
    color: var(--premium-text-secondary);
    font-size: 0.9rem;
}

.premium-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--premium-text);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

.premium-title span {
    color: var(--premium-text-secondary);
    font-weight: 400;
}

.premium-subtitle {
    font-size: 0.4rem;
    color: var(--premium-text-muted);
    letter-spacing: 0.5px;
    font-weight: 400;
    text-transform: uppercase;
    display: block;
    margin-top: -2px;
}

.premium-badge {
    background: var(--premium-bg);
    color: var(--premium-text-secondary);
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.45rem;
    font-weight: 500;
    border: 1px solid var(--premium-border);
    white-space: nowrap;
}

.premium-badge .badge-number {
    font-weight: 600;
    color: var(--premium-text);
}

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

.premium-btn {
    padding: 4px 12px;
    border-radius: var(--premium-radius);
    background: transparent;
    border: 1px solid transparent;
    color: var(--premium-text-secondary);
    font-size: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.premium-btn:hover {
    background: var(--premium-bg);
    color: var(--premium-text);
    border-color: var(--premium-border);
}

.premium-btn-ai {
    color: var(--premium-text-secondary);
}

.premium-btn-ai:hover {
    background: var(--premium-bg);
    color: var(--premium-text);
}

.premium-btn-fullscreen {
    color: var(--premium-text-secondary);
}

.premium-btn-fullscreen:hover {
    background: var(--premium-bg);
    color: var(--premium-text);
}

/* ============================================================
   ONGLETS - NOTION STYLE
   ============================================================ */
.premium-tabs {
    display: flex;
    padding: 0 16px;
    gap: 0;
    border-bottom: 1px solid var(--premium-border);
    flex-shrink: 0;
    background: var(--premium-panel-bg);
}

.premium-tab {
    padding: 8px 14px 6px 14px;
    background: none;
    border: none;
    color: var(--premium-text-muted);
    font-size: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: 'Inter', sans-serif;
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.premium-tab:hover {
    color: var(--premium-text-secondary);
    background: var(--premium-bg);
}

.premium-tab.active {
    color: var(--premium-text);
    border-bottom-color: var(--premium-text);
}

.premium-tab .tab-icon {
    font-size: 0.7rem;
    color: var(--premium-text-muted);
}

.premium-tab.active .tab-icon {
    color: var(--premium-text-secondary);
}

.premium-tab .tab-badge {
    background: var(--premium-bg);
    color: var(--premium-text-secondary);
    padding: 0px 6px;
    border-radius: 8px;
    font-size: 0.35rem;
    font-weight: 500;
}

.premium-tab.active .tab-badge {
    background: var(--premium-border);
}

.premium-tab .tab-shortcut {
    font-size: 0.35rem;
    color: var(--premium-text-light);
    opacity: 0.3;
    margin-left: 2px;
    font-weight: 400;
}

/* ============================================================
   CONTENU DES ONGLETS
   ============================================================ */
.premium-tab-content {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.premium-tab-pane {
    display: none;
    height: 100%;
    overflow: hidden;
    padding: 10px 14px 14px 14px;
}

.premium-tab-pane.active {
    display: block;
}

/* ============================================================
   PANEL NOTES
   ============================================================ */
.notes-panel {
    display: flex;
    gap: 12px;
    height: 100%;
    overflow: hidden;
}

.notes-list-panel {
    flex: 0 0 260px;
    background: var(--premium-panel-bg);
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notes-list-header {
    padding: 8px 12px;
    border-bottom: 1px solid var(--premium-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: var(--premium-panel-bg);
}

.notes-list-header span {
    font-size: 0.45rem;
    font-weight: 500;
    color: var(--premium-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.notes-list-header span i {
    color: var(--premium-text-muted);
    margin-right: 3px;
}

.notes-search {
    display: flex;
    align-items: center;
    background: var(--premium-bg);
    border: 1px solid var(--premium-border);
    border-radius: var(--premium-radius);
    padding: 2px 6px 2px 10px;
    transition: var(--transition-smooth);
}

.notes-search:focus-within {
    border-color: var(--premium-border-hover);
}

.notes-search i {
    font-size: 0.4rem;
    color: var(--premium-text-muted);
}

.notes-search input {
    background: none;
    border: none;
    color: var(--premium-text);
    font-size: 0.45rem;
    font-family: 'Inter', sans-serif;
    padding: 3px 4px;
    outline: none;
    width: 80px;
    transition: width 0.3s ease;
}

.notes-search input:focus {
    width: 120px;
}

.notes-search input::placeholder {
    color: var(--premium-text-muted);
    opacity: 0.5;
}

.notes-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 4px 6px;
}

.notes-list-container::-webkit-scrollbar {
    width: 3px;
}

.notes-list-container::-webkit-scrollbar-thumb {
    background: var(--premium-border);
    border-radius: 3px;
}

/* CARTE NOTE - NOTION STYLE */
.note-item-small {
    padding: 6px 10px;
    border-radius: var(--premium-radius);
    margin-bottom: 1px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.note-item-small:hover {
    background: var(--premium-bg);
    border-color: var(--premium-border);
}

.note-item-small.active {
    background: var(--premium-border);
    border-color: var(--premium-border-hover);
}

.note-item-small .note-title {
    font-size: 0.55rem;
    font-weight: 500;
    color: var(--premium-text);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 1px;
}

.note-item-small .note-title .color-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.note-item-small .note-preview {
    font-size: 0.45rem;
    color: var(--premium-text-secondary);
    line-height: 1.3;
    opacity: 0.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-item-small .note-date-small {
    font-size: 0.35rem;
    color: var(--premium-text-muted);
    margin-top: 3px;
}

/* ============================================================
   EDITEUR NOTES
   ============================================================ */
.notes-editor-panel {
    flex: 1;
    background: var(--premium-panel-bg);
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notes-editor-header {
    padding: 6px 12px;
    border-bottom: 1px solid var(--premium-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: var(--premium-panel-bg);
}

.notes-editor-header span {
    font-size: 0.45rem;
    font-weight: 500;
    color: var(--premium-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.notes-editor-header span i {
    color: var(--premium-text-muted);
    margin-right: 3px;
}

.editor-actions {
    display: flex;
    gap: 3px;
}

.editor-actions button {
    padding: 3px 10px;
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    background: transparent;
    color: var(--premium-text-secondary);
    font-size: 0.45rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.editor-actions button:hover {
    background: var(--premium-bg);
    color: var(--premium-text);
    border-color: var(--premium-border-hover);
}

.editor-actions .save-btn {
    background: var(--premium-bg);
    color: var(--premium-text);
    border-color: var(--premium-border-hover);
}

.editor-actions .save-btn:hover {
    background: var(--premium-border);
}

.notes-editor-body {
    flex: 1;
    padding: 12px 14px 14px 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notes-editor-body::-webkit-scrollbar {
    width: 3px;
}

.notes-editor-body::-webkit-scrollbar-thumb {
    background: var(--premium-border);
    border-radius: 3px;
}

.editor-title-input {
    width: 100%;
    background: none;
    border: none;
    color: var(--premium-text);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 3px 0;
    outline: none;
}

.editor-title-input::placeholder {
    color: var(--premium-text-muted);
    font-weight: 400;
}

.editor-content {
    width: 100%;
    background: none;
    border: none;
    color: var(--premium-text);
    font-size: 0.65rem;
    font-family: 'Inter', sans-serif;
    padding: 3px 0;
    outline: none;
    resize: none;
    flex: 1;
    min-height: 80px;
    line-height: 1.6;
}

.editor-content::placeholder {
    color: var(--premium-text-muted);
}

.editor-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 6px;
    border-top: 1px solid var(--premium-border);
    margin-top: auto;
}

.editor-meta span {
    font-size: 0.4rem;
    color: var(--premium-text-muted);
}

.editor-meta span i {
    margin-right: 3px;
    color: var(--premium-text-muted);
}

/* ============================================================
   REFERENCER / LIENS
   ============================================================ */
.references-section {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--premium-border);
}

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

.references-header span {
    font-size: 0.45rem;
    color: var(--premium-text-secondary);
}

.references-header span i {
    color: var(--premium-text-muted);
    margin-right: 3px;
}

.add-link-btn {
    padding: 2px 8px;
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    background: transparent;
    color: var(--premium-text-secondary);
    font-size: 0.4rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.add-link-btn:hover {
    background: var(--premium-bg);
    color: var(--premium-text);
    border-color: var(--premium-border-hover);
}

.reference-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 8px;
    background: var(--premium-bg);
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    transition: var(--transition-smooth);
}

.reference-card:hover {
    background: var(--premium-border);
}

.reference-card .reference-card-main {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    flex: 1;
}

.reference-card .reference-card-main i {
    color: var(--premium-text-muted);
    font-size: 0.5rem;
}

.reference-card .reference-label {
    font-size: 0.45rem;
    color: var(--premium-text-secondary);
}

.reference-remove {
    background: none;
    border: none;
    color: var(--premium-text-muted);
    cursor: pointer;
    font-size: 0.35rem;
    padding: 2px 4px;
    border-radius: 3px;
    transition: var(--transition-smooth);
}

.reference-remove:hover {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.06);
}

.ref-empty {
    font-size: 0.45rem;
    color: var(--premium-text-muted);
    text-align: center;
    padding: 8px 0;
    opacity: 0.5;
}

/* ============================================================
   AGENDA - PANEL PRINCIPAL
   ============================================================ */
.agenda-panel {
    display: flex;
    gap: 12px;
    height: 100%;
    overflow: hidden;
    min-height: 350px;
}

/* ============================================================
   CALENDRIER
   ============================================================ */
.agenda-calendar-panel {
    flex: 0 0 35%;
    min-width: 240px;
    max-width: 35%;
    background: var(--premium-panel-bg);
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.agenda-header {
    padding: 5px 10px;
    border-bottom: 1px solid var(--premium-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: var(--premium-panel-bg);
    min-height: 30px;
}

.agenda-header .month-year {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--premium-text);
    letter-spacing: 0.2px;
}

.agenda-header .month-year i {
    color: var(--premium-text-muted);
    margin-right: 3px;
}

.month-nav {
    display: flex;
    gap: 2px;
}

.month-nav button {
    padding: 2px 6px;
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    background: transparent;
    color: var(--premium-text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 0.4rem;
    font-family: 'Inter', sans-serif;
}

.month-nav button:hover {
    background: var(--premium-bg);
    color: var(--premium-text);
}

.month-nav button.today-btn {
    background: var(--premium-bg);
    color: var(--premium-text);
    border-color: var(--premium-border-hover);
}

.agenda-calendar-grid {
    flex: 1;
    padding: 3px 4px 2px 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 1px;
    flex-shrink: 0;
}

.weekdays span {
    font-size: 0.3rem;
    font-weight: 500;
    color: var(--premium-text-muted);
    padding: 1px 0;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    flex: 1;
    min-height: 0;
}

.day-cell-agenda {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1px 0;
    border-radius: var(--premium-radius);
    font-size: 0.4rem;
    font-weight: 400;
    color: var(--premium-text-secondary);
    cursor: pointer;
    transition: all 0.1s ease;
    background: transparent;
    position: relative;
    min-height: 18px;
    max-height: 28px;
    user-select: none;
    border: 1px solid transparent;
}

.day-cell-agenda:hover:not(.other-month) {
    background: var(--premium-bg);
}

.day-cell-agenda .day-number {
    font-size: 0.4rem;
    font-weight: 400;
}

.day-cell-agenda .task-dots {
    display: flex;
    gap: 1px;
    margin-top: 1px;
    height: 2px;
    justify-content: center;
    min-height: 2px;
}

.day-cell-agenda .task-dot {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    flex-shrink: 0;
}

.day-cell-agenda.today {
    background: var(--premium-bg);
    border: 1px solid var(--premium-border);
}

.day-cell-agenda.today .day-number {
    color: var(--premium-text);
    font-weight: 600;
}

.day-cell-agenda.selected {
    background: var(--premium-border);
    border: 1px solid var(--premium-border-hover);
}

.day-cell-agenda.selected .day-number {
    color: var(--premium-text);
    font-weight: 600;
}

.day-cell-agenda.other-month {
    opacity: 0.15;
    cursor: default;
    pointer-events: none;
}

.day-cell-agenda .day-summary {
    font-size: 0.3rem;
    color: var(--premium-text-secondary);
    opacity: 0;
    transition: all 0.2s ease;
    height: 0;
    overflow: hidden;
}

.day-cell-agenda.selected .day-summary {
    opacity: 0.5;
    height: 10px;
    margin-top: 1px;
    font-size: 0.28rem;
}

/* ============================================================
   PANEL TÂCHES
   ============================================================ */
.agenda-tasks-panel {
    flex: 1;
    min-width: 0;
    background: var(--premium-panel-bg);
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.agenda-tasks-header {
    padding: 6px 12px;
    border-bottom: 1px solid var(--premium-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: var(--premium-panel-bg);
    min-height: 32px;
}

.agenda-tasks-header span {
    font-size: 0.5rem;
    font-weight: 500;
    color: var(--premium-text-secondary);
}

.agenda-tasks-header span i {
    color: var(--premium-text-muted);
    margin-right: 4px;
}

.add-task-btn {
    padding: 3px 10px;
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    background: transparent;
    color: var(--premium-text-secondary);
    font-size: 0.45rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.add-task-btn:hover {
    background: var(--premium-bg);
    color: var(--premium-text);
    border-color: var(--premium-border-hover);
}

.agenda-tasks-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
}

.agenda-tasks-list::-webkit-scrollbar {
    width: 3px;
}

.agenda-tasks-list::-webkit-scrollbar-thumb {
    background: var(--premium-border);
    border-radius: 3px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: var(--premium-radius);
    margin-bottom: 1px;
    background: transparent;
    transition: var(--transition-smooth);
    border-left: 2px solid transparent;
}

.task-item:hover {
    background: var(--premium-bg);
}

.task-check {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--premium-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    flex-shrink: 0;
    background: transparent;
}

.task-check i {
    font-size: 0.3rem;
    color: transparent;
    transition: var(--transition-smooth);
}

.task-check.done {
    background: var(--premium-text);
    border-color: var(--premium-text);
}

.task-check.done i {
    color: var(--premium-panel-bg);
}

.task-info {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-size: 0.5rem;
    color: var(--premium-text);
    font-weight: 400;
}

.task-title.done {
    text-decoration: line-through;
    opacity: 0.3;
}

.task-meta {
    display: flex;
    gap: 6px;
    margin-top: 1px;
}

.task-time {
    font-size: 0.35rem;
    color: var(--premium-text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

.task-priority {
    font-size: 0.35rem;
    padding: 0px 6px;
    border-radius: 6px;
    background: var(--premium-bg);
    color: var(--premium-text-muted);
}

.task-priority.high {
    color: #e53e3e;
}

.task-priority.medium {
    color: #d9730d;
}

.task-priority.low {
    color: #0b8b5e;
}

.task-delete {
    background: none;
    border: none;
    color: var(--premium-text-muted);
    cursor: pointer;
    font-size: 0.35rem;
    padding: 3px;
    border-radius: 3px;
    transition: var(--transition-smooth);
    opacity: 0;
}

.task-item:hover .task-delete {
    opacity: 0.4;
}

.task-delete:hover {
    color: #e53e3e;
    opacity: 1;
}

/* ============================================================
   LÉGENDE DES COULEURS
   ============================================================ */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    padding: 3px 10px;
    border-top: 1px solid var(--premium-border);
    flex-shrink: 0;
    background: var(--premium-bg);
    min-height: 20px;
}

.calendar-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.3rem;
    color: var(--premium-text-muted);
}

.calendar-legend .legend-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================================
   COMMENTAIRES & ANNOTATIONS
   ============================================================ */
.comments-grid,
.annotations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
    padding: 4px 0 6px 0;
    overflow-y: auto;
    max-height: 50vh;
}

.comments-grid::-webkit-scrollbar,
.annotations-grid::-webkit-scrollbar {
    width: 3px;
}

.comments-grid::-webkit-scrollbar-thumb,
.annotations-grid::-webkit-scrollbar-thumb {
    background: var(--premium-border);
    border-radius: 3px;
}

.comment-card,
.annotation-card {
    background: var(--premium-panel-bg);
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    padding: 10px 12px 8px 12px;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.comment-card:hover,
.annotation-card:hover {
    background: var(--premium-bg);
    box-shadow: var(--premium-shadow-md);
}

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

.comment-user {
    font-size: 0.5rem;
    font-weight: 500;
    color: var(--premium-text);
    display: flex;
    align-items: center;
    gap: 3px;
}

.comment-user i {
    color: var(--premium-text-muted);
    font-size: 0.6rem;
}

.comment-date {
    font-size: 0.35rem;
    color: var(--premium-text-muted);
}

.comment-text {
    font-size: 0.5rem;
    color: var(--premium-text-secondary);
    line-height: 1.4;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comment-law {
    font-size: 0.4rem;
    color: var(--premium-text-secondary);
    background: var(--premium-bg);
    padding: 2px 8px;
    border-radius: 8px;
    align-self: flex-start;
    margin-top: 3px;
}

.annotation-passage {
    font-size: 0.5rem;
    color: var(--premium-text);
    font-style: italic;
    padding: 4px 8px;
    background: var(--premium-bg);
    border-radius: var(--premium-radius);
    border-left: 2px solid var(--premium-text-muted);
    margin-bottom: 3px;
}

.annotation-note {
    font-size: 0.5rem;
    color: var(--premium-text-secondary);
    line-height: 1.4;
    margin-bottom: 3px;
}

.annotation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 3px;
}

.annotation-tags .tag {
    font-size: 0.35rem;
    background: var(--premium-bg);
    color: var(--premium-text-secondary);
    padding: 1px 6px;
    border-radius: 6px;
}

.annotation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--premium-border);
}

.annotation-meta span {
    font-size: 0.35rem;
    color: var(--premium-text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

.annotation-meta .color-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.comment-actions,
.annotation-actions {
    display: flex;
    gap: 3px;
    margin-top: 4px;
    flex-wrap: wrap;
    border-top: 1px solid var(--premium-border);
    padding-top: 4px;
}

.comment-actions button,
.annotation-actions button {
    padding: 2px 8px;
    border-radius: var(--premium-radius);
    border: none;
    background: transparent;
    color: var(--premium-text-muted);
    font-size: 0.4rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.comment-actions button:hover,
.annotation-actions button:hover {
    background: var(--premium-bg);
    color: var(--premium-text);
}

.comment-actions .edit-comment-btn:hover,
.annotation-actions .edit-ann-btn:hover {
    color: var(--premium-text);
}

.comment-actions .delete-comment-btn:hover,
.annotation-actions .delete-ann-btn:hover {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.06);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.premium-pagination-container {
    padding: 6px 0 4px 0;
    border-top: 1px solid var(--premium-border);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    background: var(--premium-bg);
    border-radius: 0 0 var(--premium-radius) var(--premium-radius);
}

.premium-pagination-container button {
    padding: 3px 8px;
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    background: transparent;
    color: var(--premium-text-secondary);
    font-size: 0.45rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: 'Inter', sans-serif;
}

.premium-pagination-container button:hover:not(:disabled) {
    background: var(--premium-bg);
    color: var(--premium-text);
}

.premium-pagination-container button:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.premium-pagination-container button.active {
    background: var(--premium-border);
    color: var(--premium-text);
    border-color: var(--premium-border-hover);
    font-weight: 500;
}

.premium-pagination-container .page-info {
    font-size: 0.4rem;
    color: var(--premium-text-muted);
    padding: 0 4px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.agenda-empty,
.comments-empty,
.annotations-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    color: var(--premium-text-muted);
    text-align: center;
}

.agenda-empty i,
.comments-empty i,
.annotations-empty i {
    font-size: 2rem;
    color: var(--premium-text-light);
    opacity: 0.3;
    margin-bottom: 6px;
}

.agenda-empty h3,
.comments-empty h3,
.annotations-empty h3 {
    font-size: 0.75rem;
    color: var(--premium-text-secondary);
    font-weight: 500;
    margin-bottom: 3px;
}

.agenda-empty p,
.comments-empty p,
.annotations-empty p {
    font-size: 0.45rem;
    opacity: 0.4;
    margin: 0;
}

/* ============================================================
   MODALS
   ============================================================ */
.task-modal-overlay,
.edit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

.task-modal-overlay.active,
.edit-modal-overlay.active {
    display: flex;
}

.task-modal,
.edit-modal {
    background: var(--premium-panel-bg);
    border-radius: var(--premium-radius-lg);
    padding: 20px 24px;
    max-width: 420px;
    width: 92%;
    border: 1px solid var(--premium-border);
    box-shadow: var(--premium-shadow-lg);
    animation: modalSlide 0.2s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.task-modal h3,
.edit-modal h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--premium-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-modal h3 i,
.edit-modal h3 i {
    color: var(--premium-text-muted);
}

.task-modal .form-group,
.edit-modal .form-group {
    margin-bottom: 10px;
}

.task-modal .form-group label,
.edit-modal .form-group label {
    display: block;
    font-size: 0.45rem;
    font-weight: 500;
    color: var(--premium-text-secondary);
    margin-bottom: 3px;
}

.task-modal .form-group label i,
.edit-modal .form-group label i {
    margin-right: 3px;
    color: var(--premium-text-muted);
}

.task-modal .form-group input,
.task-modal .form-group select,
.edit-modal textarea {
    width: 100%;
    padding: 6px 10px;
    background: var(--premium-bg);
    border: 1px solid var(--premium-border);
    border-radius: var(--premium-radius);
    color: var(--premium-text);
    font-size: 0.65rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--transition-smooth);
}

.task-modal .form-group input:focus,
.task-modal .form-group select:focus,
.edit-modal textarea:focus {
    border-color: var(--premium-border-hover);
}

.task-modal .form-row {
    display: flex;
    gap: 8px;
}

.task-modal .form-row .form-group {
    flex: 1;
}

.task-modal .color-picker-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 2px 0;
}

.task-modal .color-picker-group .color-opt {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-smooth);
}

.task-modal .color-picker-group .color-opt:hover {
    transform: scale(1.1);
}

.task-modal .color-picker-group .color-opt.active {
    border-color: var(--premium-text);
}

.modal-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--premium-border);
}

.modal-actions button {
    padding: 4px 14px;
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    background: transparent;
    color: var(--premium-text-secondary);
    font-size: 0.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: 'Inter', sans-serif;
}

.modal-actions button:hover {
    background: var(--premium-bg);
    color: var(--premium-text);
}

.modal-actions .btn-primary,
.modal-actions .save-modal-btn {
    background: var(--premium-bg);
    color: var(--premium-text);
    border-color: var(--premium-border-hover);
}

.modal-actions .btn-primary:hover,
.modal-actions .save-modal-btn:hover {
    background: var(--premium-border);
}

/* ============================================================
   BOUTON RETOUR
   ============================================================ */
.back-to-note-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    border-radius: var(--premium-radius);
    background: var(--premium-panel-bg);
    border: 1px solid var(--premium-border);
    color: var(--premium-text-secondary);
    font-size: 0.5rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 6px;
    box-shadow: var(--premium-shadow-md);
}

.back-to-note-btn:hover {
    background: var(--premium-bg);
    color: var(--premium-text);
    border-color: var(--premium-border-hover);
    box-shadow: var(--premium-shadow-lg);
}

/* ============================================================
   PLEIN ÉCRAN
   ============================================================ */
body.notebook-premium-fullscreen .main-content {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99998 !important;
    background: var(--premium-bg) !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body.notebook-premium-fullscreen #notebookFullscreen {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    max-height: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--premium-bg) !important;
    overflow: hidden !important;
    position: relative !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

body.notebook-premium-fullscreen #volumeContentWrapper {
    display: none !important;
}

body.notebook-premium-fullscreen .top-bar,
body.notebook-premium-fullscreen .pagination-section,
body.notebook-premium-fullscreen .nav-markers,
body.notebook-premium-fullscreen .progress-counter,
body.notebook-premium-fullscreen .floating-hamburger,
body.notebook-premium-fullscreen .notes-sidebar {
    display: none !important;
}

/* ---- PLEIN ÉCRAN - POLICES ---- */
body.notebook-premium-fullscreen .premium-title {
    font-size: 1.3rem !important;
}

body.notebook-premium-fullscreen .premium-subtitle {
    font-size: 0.6rem !important;
}

body.notebook-premium-fullscreen .premium-badge {
    font-size: 0.6rem !important;
    padding: 3px 14px !important;
}

body.notebook-premium-fullscreen .premium-btn {
    font-size: 0.65rem !important;
    padding: 6px 16px !important;
}

body.notebook-premium-fullscreen .premium-tab {
    font-size: 0.7rem !important;
    padding: 10px 18px 8px 18px !important;
}

body.notebook-premium-fullscreen .notes-list-panel {
    flex: 0 0 300px !important;
}

body.notebook-premium-fullscreen .editor-title-input {
    font-size: 1rem !important;
}

body.notebook-premium-fullscreen .editor-content {
    font-size: 0.8rem !important;
    min-height: 120px !important;
}

body.notebook-premium-fullscreen .day-cell-agenda {
    font-size: 0.55rem !important;
    min-height: 26px !important;
    max-height: 36px !important;
}

body.notebook-premium-fullscreen .comments-grid,
body.notebook-premium-fullscreen .annotations-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    max-height: 60vh !important;
}

/* ============================================================
   DASHBOARD - NOTION STYLE (TOUT EN GRIS)
   ============================================================ */
.dashboard-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    overflow-y: auto;
    padding: 2px 0 8px 0;
}

.dashboard-panel::-webkit-scrollbar {
    width: 3px;
}

.dashboard-panel::-webkit-scrollbar-thumb {
    background: var(--premium-border);
    border-radius: 3px;
}

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

.dashboard-header h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--premium-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-header h2 i {
    color: var(--premium-text-muted);
    background: var(--premium-bg);
    padding: 4px;
    border-radius: var(--premium-radius);
}

.dashboard-header .dashboard-date {
    font-size: 0.45rem;
    color: var(--premium-text-muted);
    background: var(--premium-panel-bg);
    padding: 3px 12px;
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
}

.dashboard-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.dashboard-actions .action-btn {
    padding: 3px 10px;
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    background: transparent;
    color: var(--premium-text-secondary);
    font-size: 0.4rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.dashboard-actions .action-btn:hover {
    background: var(--premium-bg);
    color: var(--premium-text);
}

.dashboard-actions .action-btn.primary {
    background: var(--premium-bg);
    color: var(--premium-text);
    border-color: var(--premium-border-hover);
}

.dashboard-actions .action-btn.primary:hover {
    background: var(--premium-border);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.dashboard-stat-card {
    background: var(--premium-panel-bg);
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    padding: 12px 14px;
    transition: var(--transition-smooth);
}

.dashboard-stat-card:hover {
    box-shadow: var(--premium-shadow-md);
}

.dashboard-stat-card .stat-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3px;
}

.dashboard-stat-card .stat-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--premium-radius);
    background: var(--premium-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--premium-text-secondary);
}

.dashboard-stat-card .stat-trend {
    font-size: 0.3rem;
    padding: 1px 8px;
    border-radius: 8px;
    font-weight: 500;
}

.dashboard-stat-card .stat-trend.up {
    background: rgba(11, 139, 94, 0.08);
    color: #0b8b5e;
}

.dashboard-stat-card .stat-trend.down {
    background: rgba(229, 62, 62, 0.08);
    color: #e53e3e;
}

.dashboard-stat-card .stat-trend.neutral {
    background: var(--premium-bg);
    color: var(--premium-text-muted);
}

.dashboard-stat-card .stat-number {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--premium-text);
    line-height: 1.2;
}

.dashboard-stat-card .stat-label {
    font-size: 0.4rem;
    color: var(--premium-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dashboard-stat-card .stat-sub {
    font-size: 0.35rem;
    color: var(--premium-text-muted);
    margin-top: 1px;
    opacity: 0.5;
}

.prediction-panel {
    background: var(--premium-panel-bg);
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.prediction-panel .prediction-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prediction-panel .prediction-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--premium-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--premium-text-secondary);
}

.prediction-panel .prediction-text {
    font-size: 0.5rem;
    color: var(--premium-text-secondary);
}

.prediction-panel .prediction-text strong {
    color: var(--premium-text);
}

.prediction-panel .prediction-badge {
    padding: 2px 10px;
    border-radius: 8px;
    font-size: 0.4rem;
    font-weight: 500;
}

.prediction-panel .prediction-badge.positive {
    background: rgba(11, 139, 94, 0.08);
    color: #0b8b5e;
}

.prediction-panel .prediction-badge.negative {
    background: rgba(229, 62, 62, 0.08);
    color: #e53e3e;
}

.prediction-panel .prediction-badge.neutral {
    background: var(--premium-bg);
    color: var(--premium-text-muted);
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
}

.dashboard-chart-box {
    background: var(--premium-panel-bg);
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    padding: 10px 12px 8px 12px;
    transition: var(--transition-smooth);
}

.dashboard-chart-box:hover {
    box-shadow: var(--premium-shadow-md);
}

.dashboard-chart-box .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.dashboard-chart-box .chart-header h4 {
    font-size: 0.5rem;
    font-weight: 500;
    color: var(--premium-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.dashboard-chart-box .chart-header h4 i {
    color: var(--premium-text-muted);
}

.dashboard-chart-box .chart-header .chart-badge {
    font-size: 0.35rem;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--premium-bg);
    color: var(--premium-text-muted);
}

.dashboard-chart-box .chart-wrapper {
    height: 140px;
    position: relative;
}

.dashboard-chart-box .chart-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
}

.dashboard-task-analysis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dashboard-task-analysis .analysis-box {
    background: var(--premium-panel-bg);
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    padding: 10px 12px;
    transition: var(--transition-smooth);
}

.dashboard-task-analysis .analysis-box:hover {
    box-shadow: var(--premium-shadow-md);
}

.dashboard-task-analysis .analysis-box .analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.dashboard-task-analysis .analysis-box .analysis-header h4 {
    font-size: 0.5rem;
    font-weight: 500;
    color: var(--premium-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.dashboard-task-analysis .analysis-box .analysis-header h4 i {
    color: var(--premium-text-muted);
}

.dashboard-task-analysis .analysis-box .analysis-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--premium-text);
}

.dashboard-task-analysis .analysis-box .analysis-value.high {
    color: #e53e3e;
}

.dashboard-task-analysis .analysis-box .analysis-value.medium {
    color: #d9730d;
}

.dashboard-task-analysis .analysis-box .analysis-value.low {
    color: #0b8b5e;
}

.dashboard-task-analysis .analysis-box .analysis-bar {
    width: 100%;
    height: 2px;
    background: var(--premium-bg);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.dashboard-task-analysis .analysis-box .analysis-bar .bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

.dashboard-task-analysis .analysis-box .analysis-bar .bar-fill.gray {
    background: var(--premium-text-muted);
}

.dashboard-task-analysis .analysis-box .analysis-bar .bar-fill.green {
    background: #0b8b5e;
}

.dashboard-task-analysis .analysis-box .analysis-bar .bar-fill.orange {
    background: #d9730d;
}

.dashboard-task-analysis .analysis-box .analysis-bar .bar-fill.red {
    background: #e53e3e;
}

.dashboard-priority-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 3px;
}

.priority-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    border-radius: var(--premium-radius);
    background: var(--premium-bg);
    border: 1px solid var(--premium-border);
    transition: var(--transition-smooth);
}

.priority-item:hover {
    background: var(--premium-border);
}

.priority-item .priority-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-bottom: 3px;
}

.priority-item .priority-dot.high {
    background: #e53e3e;
}

.priority-item .priority-dot.medium {
    background: #d9730d;
}

.priority-item .priority-dot.low {
    background: #0b8b5e;
}

.priority-item .priority-label {
    font-size: 0.35rem;
    color: var(--premium-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.priority-item .priority-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--premium-text);
}

.badge-system {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px 0;
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px 3px 6px;
    border-radius: 12px;
    background: var(--premium-bg);
    border: 1px solid var(--premium-border);
    transition: var(--transition-smooth);
    cursor: default;
}

.badge-item:hover {
    transform: scale(1.03);
}

.badge-item .badge-icon {
    font-size: 0.7rem;
}

.badge-item .badge-name {
    font-size: 0.4rem;
    color: var(--premium-text-secondary);
    font-weight: 500;
}

.badge-item .badge-progress {
    font-size: 0.3rem;
    color: var(--premium-text-muted);
    margin-left: 1px;
}

.badge-item.locked {
    opacity: 0.2;
    filter: grayscale(1);
}

.badge-item.locked:hover {
    transform: none;
}

.badge-item.badge-rare {
    background: rgba(217, 115, 13, 0.06);
    border-color: rgba(217, 115, 13, 0.12);
}

.badge-item.badge-rare .badge-name {
    color: #d9730d;
}

.badge-item.badge-epic {
    background: var(--premium-border);
    border-color: var(--premium-border-hover);
}

.badge-item.badge-epic .badge-name {
    color: var(--premium-text);
}

.badge-item.badge-legendary {
    background: rgba(229, 62, 62, 0.06);
    border-color: rgba(229, 62, 62, 0.12);
}

.badge-item.badge-legendary .badge-name {
    color: #e53e3e;
    animation: legendaryPulse 2s ease-in-out infinite;
}

@keyframes legendaryPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.dashboard-mini-calendar {
    background: var(--premium-panel-bg);
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    padding: 8px 10px 6px 10px;
}

.dashboard-mini-calendar .mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.dashboard-mini-calendar .mini-header h4 {
    font-size: 0.5rem;
    font-weight: 500;
    color: var(--premium-text-secondary);
}

.dashboard-mini-calendar .mini-header h4 i {
    color: var(--premium-text-muted);
    margin-right: 3px;
}

.dashboard-mini-calendar .mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.dashboard-mini-calendar .mini-grid .mini-day {
    text-align: center;
    font-size: 0.35rem;
    padding: 2px 0;
    border-radius: var(--premium-radius);
    color: var(--premium-text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.dashboard-mini-calendar .mini-grid .mini-day:hover {
    background: var(--premium-bg);
}

.dashboard-mini-calendar .mini-grid .mini-day.today {
    background: var(--premium-bg);
    color: var(--premium-text);
    font-weight: 600;
}

.dashboard-mini-calendar .mini-grid .mini-day.has-task::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--premium-text-muted);
}

.dashboard-mini-calendar .mini-grid .mini-day.other-month {
    opacity: 0.15;
    cursor: default;
    pointer-events: none;
}

.dashboard-activity {
    background: var(--premium-panel-bg);
    border-radius: var(--premium-radius);
    border: 1px solid var(--premium-border);
    padding: 10px 12px;
}

.dashboard-activity .activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.dashboard-activity .activity-header h4 {
    font-size: 0.5rem;
    font-weight: 500;
    color: var(--premium-text-secondary);
}

.dashboard-activity .activity-header h4 i {
    color: var(--premium-text-muted);
    margin-right: 3px;
}

.dashboard-activity .activity-header .view-all {
    font-size: 0.4rem;
    color: var(--premium-text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.dashboard-activity .activity-header .view-all:hover {
    color: var(--premium-text);
    text-decoration: underline;
}

.dashboard-activity .activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 160px;
    overflow-y: auto;
}

.dashboard-activity .activity-timeline::-webkit-scrollbar {
    width: 2px;
}

.dashboard-activity .activity-timeline::-webkit-scrollbar-thumb {
    background: var(--premium-border);
    border-radius: 2px;
}

.dashboard-activity .activity-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
    border-radius: var(--premium-radius);
    transition: var(--transition-smooth);
}

.dashboard-activity .activity-item:hover {
    background: var(--premium-bg);
}

.dashboard-activity .activity-item .activity-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--premium-text-muted);
}

.dashboard-activity .activity-item .activity-content {
    flex: 1;
    min-width: 0;
}

.dashboard-activity .activity-item .activity-text {
    font-size: 0.45rem;
    color: var(--premium-text-secondary);
}

.dashboard-activity .activity-item .activity-text strong {
    color: var(--premium-text);
}

.dashboard-activity .activity-item .activity-time {
    font-size: 0.3rem;
    color: var(--premium-text-muted);
    flex-shrink: 0;
}

.dashboard-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dashboard-grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
    .dashboard-task-analysis {
        grid-template-columns: 1fr;
    }
    .dashboard-grid-2col,
    .dashboard-grid-3col {
        grid-template-columns: 1fr;
    }
    .notes-list-panel {
        flex: 0 0 220px;
    }
    .agenda-calendar-panel {
        flex: 0 0 30%;
        min-width: 200px;
    }
    .premium-header {
        padding: 10px 16px 8px 16px;
    }
    .premium-tabs {
        padding: 0 12px;
    }
    .premium-tab {
        padding: 6px 10px;
        font-size: 0.45rem;
    }
    .premium-tab .tab-shortcut {
        display: none;
    }
    .premium-tab-pane {
        padding: 8px 10px 10px 10px;
    }
}

@media (max-width: 768px) {
    .notes-panel,
    .agenda-panel {
        flex-direction: column;
        height: auto;
        min-height: 400px;
    }
    .notes-list-panel {
        flex: 1 1 auto;
        max-height: 140px;
    }
    .notes-editor-panel {
        flex: 1 1 auto;
        min-height: 220px;
    }
    .agenda-calendar-panel {
        flex: 0 0 auto;
        max-width: 100%;
        min-height: 200px;
    }
    .agenda-tasks-panel {
        flex: 1 1 auto;
        min-height: 160px;
    }
    .comments-grid,
    .annotations-grid {
        grid-template-columns: 1fr;
        max-height: 40vh;
    }
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .dashboard-stat-card {
        padding: 10px 12px;
    }
    .dashboard-stat-card .stat-number {
        font-size: 1.1rem;
    }
    .premium-title {
        font-size: 0.9rem;
    }
    .premium-subtitle {
        font-size: 0.35rem;
    }
    .premium-badge {
        font-size: 0.4rem;
        padding: 2px 8px;
    }
    .premium-icon-wrapper {
        width: 28px;
        height: 28px;
    }
    .premium-icon-wrapper i {
        font-size: 0.8rem;
    }
    .premium-btn {
        padding: 3px 8px;
        font-size: 0.4rem;
    }
    .premium-btn-fullscreen span {
        display: none;
    }
    .editor-title-input {
        font-size: 0.7rem;
    }
    .editor-content {
        font-size: 0.6rem;
        min-height: 50px;
    }
    .edit-modal,
    .task-modal {
        padding: 14px 16px;
        max-width: 95%;
    }
    .edit-modal h3,
    .task-modal h3 {
        font-size: 0.75rem;
    }
    .back-to-note-btn {
        bottom: 14px;
        padding: 5px 12px;
        font-size: 0.45rem;
    }
    .task-modal .form-row {
        flex-direction: column;
        gap: 0;
    }
    .day-cell-agenda {
        min-height: 16px;
        max-height: 24px;
        font-size: 0.35rem;
    }
    .day-cell-agenda .day-number {
        font-size: 0.35rem;
    }
    .day-cell-agenda .task-dots {
        height: 2px;
        min-height: 2px;
    }
    .day-cell-agenda .task-dot {
        width: 2px;
        height: 2px;
    }
    .weekdays span {
        font-size: 0.25rem;
    }
}

@media (max-width: 480px) {
    .premium-tabs {
        gap: 0;
        padding: 0 4px;
    }
    .premium-tab {
        padding: 4px 6px;
        font-size: 0.35rem;
        gap: 2px;
    }
    .premium-tab .tab-badge {
        font-size: 0.3rem;
        padding: 0px 4px;
    }
    .notes-list-panel {
        max-height: 100px;
    }
    .agenda-calendar-panel {
        min-height: 160px;
    }
    .agenda-tasks-panel {
        min-height: 120px;
    }
    .notes-editor-panel {
        min-height: 140px;
    }
    .premium-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        padding: 6px 10px 4px 10px;
    }
    .premium-header-right {
        width: 100%;
        justify-content: flex-start;
    }
    .premium-title {
        font-size: 0.8rem;
    }
    .day-cell-agenda {
        min-height: 14px;
        max-height: 20px;
        font-size: 0.3rem;
        padding: 0;
    }
    .day-cell-agenda .day-number {
        font-size: 0.3rem;
    }
    .day-cell-agenda .task-dots {
        display: none;
    }
    .day-cell-agenda.selected .day-summary,
    .day-cell-agenda:hover .day-summary {
        display: none;
    }
    .weekdays span {
        font-size: 0.2rem;
        padding: 1px 0;
    }
    .agenda-header .month-year {
        font-size: 0.45rem;
    }
    .month-nav button {
        padding: 1px 4px;
        font-size: 0.35rem;
    }
    .calendar-legend {
        display: none;
    }
    .task-modal {
        padding: 12px 14px;
    }
    .task-modal h3 {
        font-size: 0.7rem;
    }
    .task-modal .color-picker-group .color-opt {
        width: 18px;
        height: 18px;
    }
    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    .dashboard-stat-card {
        padding: 8px 10px;
    }
    .dashboard-stat-card .stat-number {
        font-size: 0.9rem;
    }
    .dashboard-stat-card .stat-icon {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    .dashboard-chart-box {
        padding: 8px 10px;
    }
    .dashboard-chart-box .chart-wrapper {
        height: 100px;
    }
    .dashboard-header h2 {
        font-size: 0.75rem;
    }
    .dashboard-actions .action-btn {
        font-size: 0.3rem;
        padding: 2px 6px;
    }
    .dashboard-priority-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
    }
    .priority-item {
        padding: 4px 2px;
    }
    .priority-item .priority-value {
        font-size: 0.7rem;
    }
    .priority-item .priority-label {
        font-size: 0.3rem;
    }
    .badge-item {
        padding: 2px 6px 2px 4px;
    }
    .badge-item .badge-icon {
        font-size: 0.6rem;
    }
    .badge-item .badge-name {
        font-size: 0.35rem;
    }

    body.notebook-premium-fullscreen .main-content {
        padding: 4px 8px !important;
    }
    body.notebook-premium-fullscreen .premium-title {
        font-size: 0.9rem !important;
    }
    body.notebook-premium-fullscreen .premium-btn {
        font-size: 0.4rem !important;
        padding: 3px 8px !important;
    }
    body.notebook-premium-fullscreen .day-cell-agenda {
        min-height: 18px !important;
        max-height: 26px !important;
        font-size: 0.4rem !important;
    }
    body.notebook-premium-fullscreen .day-cell-agenda .day-number {
        font-size: 0.4rem !important;
    }
}