:root {
    --primary-color: #34d399;
    --primary-hover: #2cc48d;
    --primary-soft: #ecfdf5;
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --gray-50: #f8fdfb;
    --gray-100: #f0f9f5;
    --gray-200: #dff0e8;
    --gray-300: #c6ddd2;
    --gray-500: #7a9e8e;
    --gray-600: #4d7363;
    --gray-700: #2d4f42;
    --gray-800: #1e3a30;
    --gray-900: #143026;
    --shadow-sm: 0 1px 3px rgba(52, 211, 153, 0.06);
    --shadow-md: 0 4px 8px rgba(52, 211, 153, 0.08);
    --shadow-lg: 0 10px 20px rgba(52, 211, 153, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.logo {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-leaf {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 1.15rem;
    color: #111827;
    letter-spacing: -0.3px;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
}

.pro-badge {
    display: none;
}

.logo p {
    font-size: 0.65rem;
    color: var(--gray-500);
    margin: 0;
    letter-spacing: 0.2px;
}

/* Workspace Tabs */
.workspace-tabs {
    display: flex;
    padding: 0.75rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.workspace-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    background: white;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.workspace-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.workspace-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.workspace-tab.drag-over {
    background: #dbeafe;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* Navigation */
.nav-menu {
    padding: 0.5rem;
    flex: 1;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border: none;
    background: none;
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.15s;
    text-align: left;
}

.nav-item:hover {
    background-color: var(--gray-100);
    color: var(--gray-900);
}

.nav-item.active {
    background: linear-gradient(135deg, #34d399, #60a5fa);
    color: white;
    box-shadow: 0 2px 10px rgba(52, 211, 153, 0.3);
}

.nav-item.highlight {
    background: linear-gradient(135deg, #ecfdf5, #dbeafe);
    border: 1.5px solid #6ee7b7;
}

.nav-item.highlight.active {
    background: linear-gradient(135deg, #34d399, #60a5fa);
    border-color: #34d399;
    color: white;
}

.nav-item .icon {
    font-size: 1.1rem;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.nav-item.active .badge {
    background: rgba(255,255,255,0.2);
    color: white;
}

.nav-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.5rem 1rem;
}

.nav-item.drag-over {
    background-color: #dbeafe !important;
    transform: scale(1.02);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
}

.btn-process {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #34d399, #60a5fa);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-process:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    padding: 1.5rem 2rem;
    background: white;
    border-bottom: 1px solid var(--gray-200);
}

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

.header-content h2 {
    font-size: 1.5rem;
    color: var(--gray-900);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

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

.btn-icon {
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    border-radius: 0.25rem;
}

.btn-icon:hover {
    background: var(--gray-100);
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

/* Bulk Action Bar */
.bulk-action-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    gap: 1rem;
}

.bulk-action-bar.active {
    display: flex;
}

.bulk-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

.bulk-info .btn-link {
    color: rgba(255,255,255,0.9);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.85rem;
}

.bulk-info .btn-link:hover {
    color: white;
}

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

.bulk-actions .btn {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    color: white;
}

.bulk-actions .btn:hover {
    background: rgba(255,255,255,0.3);
}

.bulk-actions .btn-danger {
    background: rgba(220, 38, 38, 0.8);
    border-color: rgba(220, 38, 38, 0.9);
}

.bulk-actions .btn-danger:hover {
    background: rgba(220, 38, 38, 1);
}

#bulk-cancel {
    background: transparent;
    border-color: rgba(255,255,255,0.5);
    color: white;
}

/* Bulk Select Mode Item Cards */
.bulk-select-mode .item-card {
    cursor: pointer;
}

.bulk-select-mode .item-card:hover {
    background: var(--gray-50);
}

.item-card.selected {
    background: #eff6ff;
    border-color: var(--primary-color);
}

.bulk-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view-header {
    margin-bottom: 1.5rem;
}

.view-description {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Filter Row */
.filter-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.filter-select {
    min-width: 150px;
}

/* Quick Capture */
.quick-capture {
    margin-top: 1rem;
}

.quick-capture input {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.quick-capture input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Items List */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1rem;
    cursor: grab;
    transition: all 0.15s;
}

.item-card:hover {
    box-shadow: var(--shadow-md);
}

.item-card.dragging {
    opacity: 0.5;
    transform: scale(1.02);
}

.item-card.overdue {
    border-left: 4px solid var(--danger-color);
}

.item-card.completed {
    opacity: 0.6;
    background: var(--gray-50);
}

.item-card.focus {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(to right, #fffbeb, white);
}

.item-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.item-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
    cursor: pointer;
}

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

.item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.item-title.strikethrough {
    text-decoration: line-through;
    color: var(--gray-600);
}

.item-description {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

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

.tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    background: var(--gray-100);
    color: var(--gray-700);
}

.tag-priority-low { background: #e0f2fe; color: #0369a1; }
.tag-priority-medium { background: #fef9c3; color: #a16207; }
.tag-priority-high { background: #fed7aa; color: #c2410c; }
.tag-priority-prio_week { background: #fecaca; color: #dc2626; font-weight: 700; border: 1px solid #f87171; animation: prio-pulse 2s infinite; }
.tag-priority-very_high { background: #dc2626; color: white; font-weight: 700; animation: prio-pulse 1.5s infinite; }
.tag-priority-urgent { background: #7f1d1d; color: white; font-weight: 700; animation: prio-pulse 1s infinite; }

@keyframes prio-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Priority flag on item card */
.item-card:has(.tag-priority-prio_week),
.item-card:has(.tag-priority-very_high) {
    border-left: 4px solid #dc2626;
    background: linear-gradient(to right, #fef2f2, white);
}

.item-card:has(.tag-priority-urgent) {
    border-left: 4px solid #7f1d1d;
    background: linear-gradient(to right, #fef2f2, #fff);
    box-shadow: 0 0 0 1px #fca5a5;
}

.tag-energy-low { background: #e0e7ff; color: #4338ca; }
.tag-energy-medium { background: #fef3c7; color: #d97706; }
.tag-energy-high { background: #dcfce7; color: #16a34a; }

.tag-context { background: #f3e8ff; color: #7c3aed; }
.tag-project { background: #cffafe; color: #0891b2; }

/* Quick Project Select Dropdown */
.quick-project-select {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    border-radius: 1rem;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    cursor: pointer;
    max-width: 140px;
    transition: all 0.15s;
}

.quick-project-select:hover {
    border-color: var(--primary-color);
    background: var(--gray-50);
}

.quick-project-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.tag-duration { background: #fce7f3; color: #be185d; }
.tag-waiting { background: #fef3c7; color: #92400e; }

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

/* Dropdown Menu for Move Actions */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 100;
    overflow: hidden;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--gray-700);
    transition: all 0.15s;
}

.dropdown-item:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

.dropdown-item:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

/* Focus View */
.focus-list .item-card {
    border-left: 4px solid #f59e0b;
}

.focus-empty {
    text-align: center;
    padding: 3rem;
    color: var(--gray-600);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

.project-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s;
    cursor: grab;
}

.project-card:hover {
    box-shadow: var(--shadow-md);
}

/* Project Drag & Drop */
.project-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    box-shadow: var(--shadow-lg);
    transform: scale(0.98);
}

.project-card.drag-over {
    border: 2px dashed var(--primary-color);
    background: #eff6ff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.project-card.drag-over-invalid {
    border: 2px dashed #ef4444;
    background: #fef2f2;
}

.project-drag-handle {
    cursor: grab;
    color: var(--gray-400);
    font-size: 0.9rem;
    padding: 0.25rem;
    margin-right: 0.25rem;
    user-select: none;
}

.project-drag-handle:hover {
    color: var(--primary-color);
}

.project-card.dragging .project-drag-handle {
    cursor: grabbing;
}

/* Mother project with children */
.project-card.has-children {
    border-left: 4px solid var(--primary-color);
}

/* Sub-project styling */
.project-card.sub-project {
    background: var(--gray-50);
    border-left: 3px solid var(--gray-300);
    margin-left: 0.5rem;
}

.sub-project-badge {
    font-size: 0.65rem;
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.mother-project-badge {
    font-size: 0.65rem;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Sub-projects container */
.sub-projects {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--gray-300);
}

.sub-projects-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.sub-projects .project-card {
    margin-bottom: 0.75rem;
}

.sub-projects .project-card:last-child {
    margin-bottom: 0;
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.5rem;
    margin: -0.25rem;
    margin-bottom: 0.5rem;
}

.project-header:hover {
    background: var(--gray-50);
}

.project-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.project-header h4 {
    margin: 0;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-header h4:hover {
    white-space: normal;
    overflow: visible;
}

.expand-icon {
    font-size: 0.75rem;
    color: var(--gray-400);
    transition: transform 0.2s;
    width: 1rem;
    text-align: center;
}

.expand-icon.expanded {
    color: var(--primary-color);
}

.project-actions {
    display: flex;
    gap: 0;
    flex-shrink: 0;
}

.project-actions .btn-icon {
    padding: 0.3rem;
    font-size: 0.95rem;
}

.project-card:hover .project-actions {
    background: var(--gray-50);
    border-radius: 0.375rem;
}

.project-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--gray-500);
    padding-left: 1.75rem;
}

.project-count {
    color: var(--gray-600);
}

.project-completed {
    color: var(--success-color);
}

.project-next {
    color: var(--primary-color);
    font-weight: 500;
}

.project-warning {
    color: var(--warning-color);
}

/* Expandable Items Container */
.project-items-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
}

.project-item:hover {
    background: var(--gray-100);
    transform: translateX(4px);
}

.project-item.next-action {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.project-item-status {
    font-size: 0.9rem;
}

.project-item-title {
    flex: 1;
    font-size: 0.9rem;
}

.project-item-priority {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
}

.no-items {
    color: var(--gray-400);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
}

.btn-add-item-to-project {
    width: 100%;
    font-size: 0.85rem;
}

.project-hint {
    font-size: 0.7rem;
    color: var(--gray-400);
    text-align: center;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.project-card:hover .project-hint {
    opacity: 1;
}

/* ============================================================
   PROJECT FOCUS MODE
   ============================================================ */

.project-focus-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.project-focus-title {
    flex: 1;
}

.project-focus-title h2 {
    margin: 0;
    font-size: 1.75rem;
    color: var(--gray-900);
}

.project-focus-badge {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

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

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Progress */
.project-focus-progress {
    margin-bottom: 2rem;
}

.progress-container {
    height: 12px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #10b981);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.progress-stats {
    font-size: 0.9rem;
    color: var(--gray-600);
    text-align: center;
}

/* Sections */
.project-focus-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.project-focus-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-focus-section.collapsible h3 {
    cursor: pointer;
    user-select: none;
}

.project-focus-section.collapsible h3:hover {
    color: var(--primary-color);
}

.collapse-icon {
    font-size: 0.75rem;
    color: var(--gray-400);
    transition: transform 0.2s;
}

.section-count {
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    margin-left: auto;
}

/* Sub-projects grid */
.focus-subprojects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.focus-subproject-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.focus-subproject-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.focus-subproject-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}

.subproject-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

/* Focus item cards */
.focus-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.focus-item-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
}

.focus-item-card:hover {
    border-color: var(--primary-color);
    background: white;
    box-shadow: var(--shadow-sm);
}

.focus-item-card.completed {
    opacity: 0.6;
    background: white;
}

.focus-item-card.completed .focus-item-title {
    text-decoration: line-through;
    color: var(--gray-500);
}

.focus-item-status {
    font-size: 1.1rem;
}

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

.focus-item-title {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.focus-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.focus-item-meta .tag {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
}

.btn-complete-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.btn-complete-item:hover {
    border-color: #10b981;
    background: #ecfdf5;
}

.btn-small {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
}

/* Create as Project Section */
.create-project-section {
    border-top: 1px dashed var(--gray-300);
    margin-top: 1rem;
    padding-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-700);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#project-creation-fields {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
}

.next-actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.next-action-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-number {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 1.5rem;
}

.next-action-input .form-control {
    flex: 1;
}

.btn-remove-action {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-action:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Weekly Review */
.review-container {
    max-width: 900px;
}

/* Bulk Select Mode */
.bulk-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    gap: 1rem;
    flex-wrap: wrap;
}

.bulk-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

.btn-link {
    background: none;
    border: none;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.85rem;
}

.btn-link:hover {
    color: white;
}

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

.bulk-actions .btn {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    color: white;
}

.bulk-actions .btn:hover {
    background: rgba(255,255,255,0.3);
}

.bulk-actions .btn-danger {
    background: rgba(220, 38, 38, 0.8);
    border-color: rgba(220, 38, 38, 0.9);
}

.bulk-actions .btn-danger:hover {
    background: rgba(220, 38, 38, 1);
}

.bulk-select-mode .item-card {
    cursor: pointer;
    transition: all 0.15s;
}

.bulk-select-mode .item-card:hover {
    background: #eff6ff;
}

.item-card.selected {
    background: #dbeafe !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.bulk-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3b82f6;
}

#bulk-select-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.health-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
}

.health-card h3 {
    margin-bottom: 1rem;
}

.health-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.health-status.green {
    background: #dcfce7;
}

.health-status.yellow {
    background: #fef3c7;
}

.health-status.red {
    background: #fecaca;
}

.health-indicator {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
}

.health-status.green .health-indicator { background: #16a34a; }
.health-status.yellow .health-indicator { background: #d97706; }
.health-status.red .health-indicator { background: #dc2626; }

.health-text {
    font-weight: 600;
}

.health-indicators {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.indicator-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
}

.indicator-item.green { background: #f0fdf4; }
.indicator-item.yellow { background: #fffbeb; }
.indicator-item.red { background: #fef2f2; }

.indicator-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}

.indicator-item.green .indicator-dot { background: #16a34a; }
.indicator-item.yellow .indicator-dot { background: #d97706; }
.indicator-item.red .indicator-dot { background: #dc2626; }

.review-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
}

.stat-card.warning {
    border-color: var(--danger-color);
    background: #fef2f2;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card.warning .stat-value {
    color: var(--danger-color);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.review-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.review-section h3 {
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 1.25rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
}

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

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--gray-700);
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-section {
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
    margin-top: 1rem;
}

.form-section h4 {
    font-size: 0.9rem;
    color: var(--gray-700);
    margin-bottom: 1rem;
}

/* Processing Modal */
.processing-modal .processing-content {
    background: white;
    border-radius: 1rem;
    width: 90%;
    max-width: 700px;
    padding: 2rem;
}

.processing-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.processing-header h2 {
    flex: 1;
}

.processing-count {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.processing-item {
    background: var(--gray-50);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 100px;
}

.processing-title-input {
    width: 100%;
    font-size: 1.4rem;
    font-weight: 600;
    border: none;
    background: transparent;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    color: var(--gray-900);
    resize: none;
    overflow: hidden;
    font-family: inherit;
    line-height: 1.4;
    min-height: 2.5rem;
}

.processing-title-input:hover,
.processing-title-input:focus {
    background: white;
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.processing-description-input {
    width: 100%;
    min-height: 60px;
    font-size: 0.95rem;
    border: none;
    background: transparent;
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: var(--gray-600);
    resize: vertical;
    font-family: inherit;
}

.processing-description-input:hover,
.processing-description-input:focus {
    background: white;
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.processing-question {
    text-align: center;
    margin-bottom: 1.5rem;
}

.processing-question p {
    font-size: 1.1rem;
    font-weight: 500;
}

.processing-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.process-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    background: white;
    cursor: pointer;
    transition: all 0.15s;
}

.process-btn:hover {
    border-color: var(--primary-color);
    background: var(--gray-50);
}

.process-btn.action:hover { border-color: #f59e0b; background: #fffbeb; }
.process-btn.project:hover { border-color: #3b82f6; background: #eff6ff; }
.process-btn.waiting:hover { border-color: #8b5cf6; background: #f5f3ff; }
.process-btn.someday:hover { border-color: #06b6d4; background: #ecfeff; }
.process-btn.reference:hover { border-color: #6b7280; background: #f9fafb; }
.process-btn.done:hover { border-color: #10b981; background: #ecfdf5; }
.process-btn.delete:hover { border-color: #ef4444; background: #fef2f2; }

.process-btn .icon {
    font-size: 1.5rem;
}

.process-btn span:last-child {
    font-size: 0.85rem;
    font-weight: 500;
}

.processing-options {
    background: var(--gray-50);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Project creation form in processing */
.project-creation-form {
    margin-bottom: 1rem;
}

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

.project-creation-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--gray-700);
}

.option-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.option-row .form-control {
    flex: 1;
}

.processing-footer {
    text-align: center;
}

/* Day Plan Modal */
.day-plan-content {
    max-width: 700px;
}

#day-plan-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.plan-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
}

.plan-time {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 120px;
}

.plan-title {
    flex: 1;
}

.plan-duration {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.day-plan-summary {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    color: var(--gray-600);
}

/* Settings */
.settings-container {
    max-width: 700px;
}

.settings-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.settings-section h3 {
    margin-bottom: 1rem;
}

.status-box {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.status-box.success {
    background: #dcfce7;
    color: #166534;
}

.status-box.warning {
    background: #fef3c7;
    color: #92400e;
}

.status-box.error {
    background: #fecaca;
    color: #dc2626;
}

/* Drop Zone */
.drop-zone {
    min-height: 100px;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.drop-zone.drag-over {
    background: #dbeafe;
    border: 2px dashed var(--primary-color);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    color: white;
    animation: slideIn 0.3s ease;
}

.toast.success { background: var(--success-color); }
.toast.error { background: var(--danger-color); }
.toast.warning { background: var(--warning-color); }
.toast.info { background: var(--primary-color); }

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

/* Responsive */
@media (max-width: 768px) {
    /* Sidebar - Hidden by default on mobile */
    .sidebar {
        position: fixed;
        z-index: 1000;
        transform: translateX(-100%);
        width: 85%;
        max-width: 320px;
        height: 100vh;
        box-shadow: var(--shadow-lg);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Main content */
    .main-content {
        width: 100%;
        margin-left: 0;
    }
    
    /* Header */
    .header {
        padding: 1rem;
        position: sticky;
        top: 0;
        background: white;
        z-index: 100;
    }
    
    .header-content {
        flex-direction: row;
        align-items: center;
    }
    
    .header-content h2 {
        font-size: 1.25rem;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .header-actions .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    /* Add hamburger menu button */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        background: var(--gray-100);
        border-radius: 0.5rem;
        font-size: 1.25rem;
        cursor: pointer;
        margin-right: 0.75rem;
    }
    
    /* Content area */
    .content-area {
        padding: 1rem;
    }
    
    /* Item cards */
    .item-card {
        padding: 0.875rem;
    }
    
    .item-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .item-content {
        width: calc(100% - 50px);
    }
    
    .item-title {
        font-size: 0.95rem;
    }
    
    .item-meta {
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    
    .item-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--gray-100);
    }
    
    /* Larger touch targets */
    .btn-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .item-checkbox,
    .bulk-checkbox {
        width: 24px;
        height: 24px;
    }
    
    /* Tags */
    .tag {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    /* Processing modal */
    .processing-content {
        width: 95%;
        max-height: 90vh;
        margin: 5vh auto;
    }
    
    .processing-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .process-btn {
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 5vh auto;
    }
    
    /* Projects grid */
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    /* Bulk action bar */
    .bulk-action-bar {
        flex-direction: column;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    
    .bulk-info {
        font-size: 0.9rem;
    }
    
    .bulk-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Focus view */
    .focus-list .item-card {
        margin-bottom: 0.75rem;
    }
    
    /* Quick capture */
    .quick-capture input {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* All inputs - prevent iOS zoom */
    input[type="text"],
    input[type="email"],
    input[type="datetime-local"],
    textarea,
    select {
        font-size: 16px;
    }
    
    /* Project focus view */
    .project-focus-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .project-focus-title h2 {
        font-size: 1.25rem;
    }
    
    /* Navigation items */
    .nav-item {
        padding: 0.875rem 1.25rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .header-actions {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    #bulk-select-btn {
        display: none;
    }
    
    .processing-actions {
        grid-template-columns: 1fr;
    }
    
    .bulk-actions .btn {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }
}

/* Safari-specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix for Safari touch */
    .btn, button {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Fix for sticky header in Safari */
    .header {
        -webkit-sticky;
        position: sticky;
    }
    
    /* Prevent rubber-banding on scroll */
    .content-area {
        -webkit-overflow-scrolling: touch;
    }
}

/* AI Cleanup Modal */
.ai-modal .ai-modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.ai-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
}

.ai-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.ai-modal-header .btn-close {
    color: white;
    opacity: 0.8;
}

.ai-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.ai-intro {
    text-align: center;
}

.ai-intro p {
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.ai-intro ul {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.ai-intro li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.ai-scope-select {
    margin: 1.5rem 0;
    text-align: left;
}

.ai-scope-select label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ai-api-key {
    margin: 1.5rem 0;
    text-align: left;
}

.ai-api-key label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-ai {
    background: linear-gradient(135deg, #60a5fa, #818cf8);
    color: white;
    border: none;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #4f96eb, #7078e8);
}

/* AI Loading */
.ai-loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* AI Suggestions */
.ai-suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.ai-suggestions-header h3 {
    margin: 0;
}

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

.ai-suggestions-list {
    max-height: 400px;
    overflow-y: auto;
}

.ai-suggestion-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.ai-suggestion-card:hover {
    border-color: #8b5cf6;
    box-shadow: var(--shadow-sm);
}

.ai-suggestion-card.accepted {
    background: #f0fdf4;
    border-color: #10b981;
}

.ai-suggestion-card.rejected {
    background: var(--gray-50);
    opacity: 0.6;
}

.ai-suggestion-type {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ai-suggestion-type.create-project { background: #dbeafe; color: #1d4ed8; }
.ai-suggestion-type.move-item { background: #fef3c7; color: #92400e; }
.ai-suggestion-type.group-items { background: #f3e8ff; color: #7c3aed; }
.ai-suggestion-type.rename { background: #ecfdf5; color: #047857; }

.ai-suggestion-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ai-suggestion-details {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.ai-suggestion-items {
    background: var(--gray-50);
    border-radius: 0.25rem;
    padding: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    list-style: none;
}

.ai-suggestion-items li {
    padding: 0.25rem 0;
}

.ai-suggestion-item {
    padding: 0.35rem 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.15s;
}

.ai-suggestion-item:hover {
    background: var(--gray-100);
}

.ai-suggestion-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.ai-suggestion-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.ai-suggestion-item span {
    flex: 1;
}

.ai-model-select {
    margin: 1rem 0;
    text-align: left;
}

.ai-model-select label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ai-mode-select {
    margin: 1rem 0;
    text-align: left;
}

.ai-mode-select label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Context suggestion cards */
.context-card {
    padding: 0.75rem 1rem !important;
}

.context-suggestion-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.context-item-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.context-item-title {
    font-weight: 500;
}

.confident-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: #dcfce7;
    color: #166534;
    border-radius: 0.25rem;
}

.uncertain-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 0.25rem;
}

.context-select-wrapper {
    min-width: 140px;
}

.context-select {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
}

.context-actions {
    display: flex;
    gap: 0.25rem;
}

.context-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-outline {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
}

.btn-outline:hover {
    background: var(--gray-50);
}

.context-reason {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
    font-style: italic;
}

.ai-suggestion-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.ai-suggestions-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Empty State */
.empty-message {
    text-align: center;
    padding: 3rem;
    color: var(--gray-600);
}

/* ============================================================
   COMPOSE MESSAGE MODAL
   ============================================================ */

.compose-modal .compose-modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.compose-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 1rem 1rem 0 0;
}

.compose-modal-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.compose-modal-body {
    padding: 1.5rem;
}

.compose-task-context {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.compose-task-label {
    font-weight: 600;
    color: var(--primary-color);
}

#compose-task-title {
    font-weight: 500;
}

#compose-task-meta {
    color: var(--gray-600);
    font-size: 0.85rem;
}

.compose-field {
    margin-bottom: 1rem;
}

.compose-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.compose-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* AI Draft Section */
.compose-ai-section {
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.compose-ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    user-select: none;
}

.compose-ai-header:hover {
    background: linear-gradient(135deg, #f3e8ff, #ede9fe);
}

.compose-ai-toggle {
    font-size: 1.1rem;
    color: var(--gray-600);
}

.compose-ai-body {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.compose-ai-options {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.compose-ai-options select {
    flex: 1;
}

.btn-draft {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-draft:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-1px);
}

.btn-draft:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.compose-ai-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.compose-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.btn-send {
    padding: 0.65rem 1.5rem;
    font-size: 1rem;
}

/* ============================================================
   EMAIL BAR
   ============================================================ */

.btn-email-bar {
    background: linear-gradient(135deg, #60a5fa, #93c5fd);
    color: white;
    border: none;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-email-bar:hover {
    background: linear-gradient(135deg, #4f96eb, #82b8f0);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-email-bar.drag-over {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3);
}

/* ============================================================
   AI COACH MODAL
   ============================================================ */

.btn-coach {
    background: linear-gradient(135deg, #4ade80, #34d399);
    color: white;
    border: none;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-coach:hover {
    background: linear-gradient(135deg, #3ecf74, #2cc48d);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.coach-modal .coach-modal-content {
    max-width: 650px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.coach-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: 1rem 1rem 0 0;
}

.coach-modal-header h2 {
    font-size: 1.2rem;
    margin: 0;
}

.coach-modal-body {
    padding: 1.5rem;
}

.coach-intro p {
    color: var(--gray-600);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.coach-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.coach-loading {
    text-align: center;
    padding: 3rem;
}

.coach-loading p {
    color: var(--gray-600);
    margin-top: 1rem;
}

.coach-result {
    /* Styles for the feedback output */
}

.coach-feedback {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--gray-800);
}

.coach-feedback h2 {
    font-size: 1.15rem;
    margin: 1.5rem 0 0.5rem;
    color: var(--gray-900);
}

.coach-feedback h3 {
    font-size: 1.05rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--gray-900);
}

.coach-feedback h4 {
    font-size: 1rem;
    margin: 1rem 0 0.4rem;
    color: var(--gray-800);
}

.coach-feedback ul {
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

.coach-feedback li {
    margin-bottom: 0.4rem;
}

.coach-feedback strong {
    color: var(--gray-900);
}

.coach-feedback code {
    background: var(--gray-100);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}

.coach-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* ============================================================
   MOBILE RESPONSIVE FOR NEW FEATURES
   ============================================================ */

@media (max-width: 768px) {
    .compose-modal-content,
    .coach-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .compose-ai-options {
        flex-direction: column;
    }
    
    .compose-ai-options select,
    .btn-draft {
        width: 100%;
    }
    
    .item-actions .btn-email {
        font-size: 1rem;
    }
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-box {
    background: white;
    border-radius: 1rem;
    padding: 2.5rem;
    width: 360px;
    max-width: 90%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.3rem;
    padding: 0.75rem;
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

.login-error {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin: 0;
}

/* Logout button */
.btn-logout {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
    padding: 0.25rem;
    flex-shrink: 0;
}

.btn-logout:hover {
    opacity: 1;
}

/* ============================================================
   NEXT ACTIONS OVERVIEW (Context Columns)
   ============================================================ */

.btn-overview {
    white-space: nowrap;
    font-size: 0.85rem;
}

.btn-overview.active {
    background: var(--primary-color);
    color: white;
}

.context-overview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

.overview-column {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    overflow: hidden;
}

.overview-column-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 0.95rem;
}

.overview-emoji {
    font-size: 1.2rem;
}

.overview-label {
    flex: 1;
}

.overview-count {
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.overview-items {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 400px;
    overflow-y: auto;
}

.overview-item {
    padding: 0.6rem 0.75rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.overview-item:hover {
    background: #eff6ff;
    border-color: var(--primary-color);
}

.overview-item.overdue {
    border-left: 3px solid var(--danger-color);
}

.overview-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1.4;
}

.overview-item-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--gray-600);
    flex-wrap: wrap;
}

.overview-project {
    color: var(--gray-500);
}

.overview-due {
    color: var(--gray-500);
}

.overview-due.overdue {
    color: var(--danger-color);
    font-weight: 500;
}

@media (max-width: 768px) {
    .context-overview {
        grid-template-columns: 1fr;
    }
    
    .overview-items {
        max-height: 300px;
    }
}

/* ============================================================
   PROJECTS OVERVIEW MAP
   ============================================================ */

.view-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

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

.pov-node {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.pov-node:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.pov-node.has-children {
    border-left: 4px solid var(--primary-color);
}

.pov-node-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pov-node-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pov-node-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-800);
}

.pov-node-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.pov-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.pov-progress-fill {
    height: 100%;
    background: var(--success-color);
    border-radius: 3px;
    transition: width 0.3s;
}

.pov-stat {
    font-size: 0.75rem;
    color: var(--gray-500);
    white-space: nowrap;
}

.pov-next {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 0.25rem;
}

.pov-next.pov-warning {
    color: var(--warning-color);
}

.pov-children {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pov-children .pov-node {
    padding: 0.75rem;
    background: var(--gray-50);
    border-left: 3px solid var(--gray-300);
}

.pov-children .pov-node:hover {
    border-left-color: var(--primary-color);
}

/* Mobile: project overview */
@media (max-width: 768px) {
    .pov-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   PROCESS NEXT ACTION MODAL
   ============================================================ */

.action-modal .action-modal-content {
    max-width: 550px;
    width: 90%;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    overflow: hidden;
}

.action-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-bottom: 1px solid var(--gray-200);
}

.action-modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    flex: 1;
}

.action-context-select select {
    font-size: 0.85rem;
    padding: 0.4rem;
}

.action-modal-body {
    padding: 1.5rem;
}

.action-progress {
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.action-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.action-task-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.action-task-desc {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.action-task-meta {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.action-buttons .btn {
    flex: 1;
    max-width: 150px;
}

.btn-success {
    background: var(--success-color);
    color: white;
    border: none;
}

.btn-success:hover {
    background: #059669;
}

.btn-action-process {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-action-process:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
}

.action-empty {
    text-align: center;
    padding: 2rem;
}

.action-empty p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* ============================================================
   AI ASK ME ANYTHING
   ============================================================ */

.btn-ask {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: white;
    border: none;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ask:hover {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.ask-modal .ask-modal-content {
    max-width: 650px;
    width: 90%;
    max-height: 85vh;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
}

.ask-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-radius: 1rem 1rem 0 0;
}

.ask-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.ask-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.ask-chat {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    min-height: 300px;
    max-height: 55vh;
}

.ask-welcome {
    text-align: center;
    color: var(--gray-600);
    padding: 1rem 0;
}

.ask-welcome p {
    margin-bottom: 1rem;
}

.ask-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.ask-suggestion-chip {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 2rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.ask-suggestion-chip:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.ask-msg {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 90%;
}

.ask-user {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    border-radius: 0.75rem 0.75rem 0.25rem 0.75rem;
}

.ask-ai {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem 0.75rem 0.75rem 0.25rem;
}

.ask-ai ul { padding-left: 1.25rem; margin: 0.4rem 0; }
.ask-ai li { margin-bottom: 0.3rem; }
.ask-ai strong { color: var(--gray-900); }
.ask-ai code { background: var(--gray-200); padding: 0.1rem 0.3rem; border-radius: 0.2rem; font-size: 0.85rem; }

.ask-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.ask-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger-color);
}

.ask-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 1rem 1rem;
    align-items: center;
}

.ask-model-select select {
    font-size: 0.8rem;
    padding: 0.4rem;
    width: auto;
}

.ask-text-input {
    flex: 1;
}

.ask-input-row .btn {
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
}

/* ============================================================
   PROJECT NOTES & REFERENCES
   ============================================================ */

.project-notes-container {
    padding-top: 0.5rem;
}

.project-notes-textarea {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 250px;
    border: 1px solid var(--gray-200);
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 0.75rem;
    line-height: 1.7;
}

.project-notes-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.project-notes-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
}

.notes-saved-msg {
    color: var(--success-color);
    font-size: 0.85rem;
    font-weight: 500;
}

.project-references {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.project-references h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.project-ref-list {
    margin-bottom: 0.75rem;
}

.project-ref-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    background: var(--gray-50);
    border-radius: 0.375rem;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.project-ref-item .btn-icon {
    font-size: 0.8rem;
    padding: 0.2rem;
    opacity: 0.5;
}

.project-ref-item .btn-icon:hover {
    opacity: 1;
}

.project-ref-add {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.project-ref-add select {
    flex: 1;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .action-modal-content,
    .ask-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        max-width: 100%;
    }
    
    .ask-input-row {
        flex-wrap: wrap;
    }
    
    .ask-model-select {
        width: 100%;
    }
}

/* ============================================================
   FILE UPLOAD IN PROJECTS
   ============================================================ */

.project-files-section {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.project-files-section h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.file-drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.85rem;
    transition: all 0.2s;
    cursor: default;
    margin-bottom: 0.75rem;
}

.file-drop-zone p {
    margin: 0.25rem 0;
}

.file-drop-zone.drag-active {
    border-color: var(--primary-color);
    background: #eff6ff;
    color: var(--primary-color);
}

.file-browse-link {
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
    text-decoration: underline;
}

.file-hint {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.file-upload-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: var(--gray-600);
    font-size: 0.85rem;
}

.project-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.project-file-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
}

.project-file-card:hover {
    border-color: var(--primary-color);
}

.file-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.file-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    background: var(--gray-100);
    text-decoration: none;
}

.file-type-icon {
    font-size: 2rem;
}

.file-info {
    padding: 0.4rem 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-name {
    font-size: 0.78rem;
    color: var(--gray-700);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.file-name:hover {
    color: var(--primary-color);
}

.file-size {
    font-size: 0.7rem;
    color: var(--gray-400);
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.file-delete-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.15s;
}

.project-file-card:hover .file-delete-btn {
    opacity: 1;
}

/* ============================================================
   SETTINGS: PIN CHANGE & API KEY
   ============================================================ */

.pin-change-form {
    max-width: 350px;
}

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

.pin-change-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--gray-700);
}

.pin-change-msg {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.settings-desc {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.api-key-display {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    align-items: center;
}

.api-key-display input {
    flex: 1;
}

.api-key-status {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================================
   PANORAMA BOARD (Mind-map tree style)
   ============================================================ */

.panorama-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8fafc;
    z-index: 5000;
    display: flex;
    flex-direction: column;
}

.panorama-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    z-index: 10;
}

.panorama-toolbar h2 { font-size: 1.1rem; margin: 0; }
.panorama-toolbar-actions { display: flex; gap: 0.4rem; align-items: center; }
.panorama-zoom-level { font-size: 0.8rem; color: var(--gray-500); min-width: 40px; text-align: center; }
.panorama-close-btn { background: var(--danger-color) !important; color: white !important; }

.panorama-viewport {
    flex: 1;
    overflow: hidden;
    cursor: grab;
}

.panorama-canvas {
    transform-origin: 0 0;
    transition: transform 0.05s linear;
    min-width: max-content;
    min-height: max-content;
    padding: 2rem;
}

/* Layout: left sidebar, center tree, right sidebar */
.pan-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: max-content;
}

.pan-top-row {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.pan-bottom-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.pan-section-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--gray-300);
}

/* ---- CSS TREE (connector lines) ---- */
.tree-container {
    min-width: 400px;
    overflow: visible;
}

.tree, .tree ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.tree {
    display: flex;
    justify-content: center;
}

.tree ul {
    display: flex;
    justify-content: center;
    padding-top: 2rem;
    position: relative;
}

/* Vertical line from parent down to horizontal bar */
.tree ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 2rem;
    background: #94a3b8;
}

/* Each child li */
.tree ul > li {
    position: relative;
    padding: 0 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Horizontal connector bar across siblings */
.tree ul > li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #94a3b8;
}

/* First child: horizontal line only on right half */
.tree ul > li:first-child::before {
    left: 50%;
}

/* Last child: horizontal line only on left half */
.tree ul > li:last-child::before {
    right: 50%;
}

/* Only child: no horizontal line */
.tree ul > li:only-child::before {
    display: none;
}

/* Vertical drop line from horizontal bar to card */
.tree ul > li::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 2rem;
    background: #94a3b8;
    transform: translateX(-1px);
}

/* Only child: still needs vertical line from parent */
.tree ul > li:only-child::after {
    display: block;
}

/* The card itself needs top margin to make room for the connector */
.tree ul > li > .tree-card {
    margin-top: 2rem;
}

/* Tree Cards */
.tree-card {
    display: inline-block;
    position: relative;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.6rem;
    padding: 0.6rem 0.9rem;
    min-width: 160px;
    max-width: 220px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: left;
    transition: all 0.15s;
    font-size: 0.82rem;
}

.tree-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.tree-hub {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    min-width: 140px;
}

.tree-hub small {
    font-weight: 400;
    opacity: 0.7;
}

.tree-root {
    border-top-width: 3px;
}

.tree-card-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-900);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.tree-card-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.tree-bar-fill {
    height: 100%;
    background: var(--success-color);
    border-radius: 2px;
}

.tree-card-stats {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-bottom: 0.2rem;
}

.tree-card-next {
    font-size: 0.72rem;
    color: var(--primary-color);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-card-warn {
    font-size: 0.72rem;
    color: var(--warning-color);
}

/* ---- Side blocks ---- */
.pan-center {
    flex: 1;
    min-width: 0;
}

/* Bottom row cards (NA columns + mini blocks) */
.pan-miniblock, .pan-na-column {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.6rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    width: 220px;
    flex-shrink: 0;
}

.pan-miniblock-title, .pan-na-header {
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.pan-badge {
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 0.05rem 0.4rem;
    border-radius: 1rem;
    font-size: 0.68rem;
    font-weight: 500;
    margin-left: auto;
}

.pan-mini-item, .pan-na-item {
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    line-height: 1.4;
}

.pan-mini-item:last-child, .pan-na-item:last-child { border-bottom: none; }

.pan-mini-sub { color: var(--gray-400); font-size: 0.68rem; }

.pan-mini-more {
    padding: 0.25rem 0.75rem;
    font-size: 0.68rem;
    color: var(--gray-400);
    font-style: italic;
}

.pan-na-proj {
    display: block;
    font-size: 0.65rem;
    color: var(--gray-400);
}

/* Mobile */
@media (max-width: 768px) {
    .panorama-toolbar { flex-wrap: wrap; gap: 0.5rem; }
    .pan-layout { flex-direction: column; }
    .tree { overflow-x: auto; }
}

/* ============================================================
   ACTIVITY VIEW
   ============================================================ */

.activity-container {
    max-width: 800px;
}

.activity-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.activity-stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-day {
    margin-bottom: 0.5rem;
}

.activity-day-header {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-day-count {
    font-weight: 400;
    color: var(--gray-400);
    font-size: 0.75rem;
}

.activity-entry {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.85rem;
}

.activity-entry:last-child {
    border-bottom: none;
}

.activity-icon {
    flex-shrink: 0;
    font-size: 0.9rem;
}

.activity-desc {
    flex: 1;
    color: var(--gray-700);
}

.activity-time {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--gray-400);
}

@media (max-width: 768px) {
    .activity-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   AI ASSIST MODE
   ============================================================ */

.btn-assist {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-assist:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.assist-modal .assist-modal-content {
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.assist-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-radius: 1rem 1rem 0 0;
}

.assist-modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.assist-modal-body {
    padding: 1.5rem;
}

.assist-intro p {
    color: var(--gray-600);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.assist-workspace-note {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.assist-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.assist-loading {
    text-align: center;
    padding: 3rem;
}

.assist-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.assist-results-header h3 {
    margin: 0;
}

.assist-model-exec {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.assist-model-exec select {
    font-size: 0.8rem;
    padding: 0.3rem;
}

.assist-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.assist-card {
    border: 1px solid var(--gray-200);
    border-radius: 0.6rem;
    padding: 1rem;
    transition: all 0.2s;
}

.assist-card:hover {
    border-color: var(--primary-color);
}

.assist-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

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

.assist-type-badge {
    background: var(--gray-100);
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.assist-task-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.assist-card-desc {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.3rem;
    line-height: 1.5;
}

.assist-card-value {
    font-size: 0.78rem;
    color: var(--gray-400);
    font-style: italic;
    margin-bottom: 0.5rem;
}

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

.assist-card-result {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.assist-output {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--gray-800);
}

.assist-output h2, .assist-output h3, .assist-output h4 {
    margin: 0.75rem 0 0.35rem;
    font-size: 0.95rem;
}

.assist-output ul { padding-left: 1.25rem; margin: 0.4rem 0; }
.assist-output li { margin-bottom: 0.3rem; }
.assist-output strong { color: var(--gray-900); }

.assist-output-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--gray-200);
}

.assist-loading-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

/* Assist context input */
.assist-context-input {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--gray-200);
}

.assist-context-input textarea {
    font-family: inherit;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    resize: vertical;
    min-height: 70px;
}

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

/* ============================================================
   CALENDAR PICKER MODAL
   ============================================================ */

.cal-modal .cal-modal-content {
    max-width: 400px;
    width: 90%;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.cal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: 1rem 1rem 0 0;
}

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

.cal-modal-body {
    padding: 1.25rem;
}

.cal-task-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-800);
    padding: 0.6rem 0.75rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
}

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

.cal-modal-body label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--gray-700);
}

.cal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* ============================================================
   MARKDOWN TABLES
   ============================================================ */

.md-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.8rem;
    margin: 0.75rem 0;
    overflow-x: auto;
    display: block;
}

.md-table th, .md-table td {
    border: 1px solid var(--gray-200);
    padding: 0.4rem 0.6rem;
    text-align: left;
}

.md-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
}

.md-table tr:nth-child(even) {
    background: var(--gray-50);
}

.md-table tr:hover {
    background: #eff6ff;
}

.assist-output hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 1rem 0;
}

.assist-output ol {
    padding-left: 1.5rem;
    margin: 0.4rem 0;
}

.assist-output ol li {
    margin-bottom: 0.3rem;
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ============================================================
   GLOBAL SEARCH
   ============================================================ */

.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 1rem;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    background: var(--gray-50);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-input::placeholder {
    color: var(--gray-400);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.35rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.6rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    max-height: 420px;
    overflow-y: auto;
    z-index: 100;
}

.search-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    padding: 0.5rem 0.75rem 0.25rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background 0.1s;
}

.search-result-item:hover {
    background: var(--gray-50);
}

.search-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.search-result-text {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-title mark {
    background: #fef08a;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.search-result-meta {
    display: block;
    font-size: 0.72rem;
    color: var(--gray-400);
}

.search-empty {
    padding: 1rem;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .search-container {
        max-width: none;
        margin: 0.5rem 0 0;
        order: 10;
        width: 100%;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
}

/* ============================================================
   AI PROJECT PLANNER
   ============================================================ */

.btn-planner {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    border: none;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-planner:hover {
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.planner-modal .planner-modal-content {
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.planner-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-radius: 1rem 1rem 0 0;
}

.planner-modal-header h2 { margin: 0; font-size: 1.2rem; }

.planner-modal-body { padding: 1.5rem; }

.planner-modal-body p {
    color: var(--gray-600);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.planner-options {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
}

.planner-options select { max-width: 200px; }

.planner-loading { text-align: center; padding: 3rem; }
.planner-loading p { color: var(--gray-500); }

/* Preview */
.planner-preview-header { margin-bottom: 1rem; }
.planner-preview-header h3 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.planner-desc { color: var(--gray-600); font-size: 0.9rem; margin: 0; }

.planner-tasks { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }

.planner-task {
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    transition: all 0.15s;
}

.planner-task:hover { border-color: var(--primary-color); }

.planner-task.ai-task {
    border-left: 3px solid #7c3aed;
    background: #faf5ff;
}

.planner-task-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.planner-task-check { flex-shrink: 0; }

.planner-task-title {
    flex: 1;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.planner-ai-badge {
    font-size: 0.68rem;
    background: #ede9fe;
    color: #7c3aed;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    font-weight: 600;
}

.planner-human-badge {
    font-size: 0.68rem;
    background: var(--gray-100);
    color: var(--gray-500);
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    white-space: nowrap;
}

.planner-task-desc {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin: 0.25rem 0 0 1.5rem;
}

.planner-ai-desc {
    font-size: 0.75rem;
    color: #7c3aed;
    margin: 0.2rem 0 0 1.5rem;
    font-style: italic;
}

.planner-task-meta {
    display: flex;
    gap: 0.75rem;
    margin: 0.25rem 0 0 1.5rem;
    font-size: 0.72rem;
    color: var(--gray-400);
}

.planner-subproject {
    margin: 0.75rem 0;
    border: 1px solid var(--gray-200);
    border-radius: 0.6rem;
    padding: 0.5rem;
    background: var(--gray-50);
}

.planner-subproject-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.35rem 0.25rem;
    margin-bottom: 0.35rem;
}

.planner-task-count {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-left: auto;
}

.planner-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.planner-done-msg {
    text-align: center;
    padding: 2rem;
}

.planner-done-msg p {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ============================================================
   PROJECT TABS UI (Chrome-style)
   ============================================================ */

.project-tabs-container {
    margin-bottom: 0;
}

.project-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding: 0 0.25rem;
    padding-top: 0.5rem;
    background: var(--gray-100);
    scrollbar-width: thin;
}

.ptab {
    padding: 0.55rem 1rem 0.6rem;
    border: 1px solid var(--gray-200);
    border-bottom: none;
    background: var(--gray-100);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    white-space: nowrap;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
}

.ptab:hover {
    color: var(--gray-700);
    background: var(--gray-50);
}

.ptab.active {
    color: var(--gray-900);
    background: white;
    border-color: var(--gray-200);
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.04);
}

/* Active tab connects to content below */
.ptab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: white;
}

.ptab-count {
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 0.05rem 0.4rem;
    border-radius: 1rem;
    font-size: 0.68rem;
    font-weight: 500;
}

.ptab.active .ptab-count {
    background: #dbeafe;
    color: var(--primary-color);
}

/* Sub-tabs container */
.project-subtabs {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    border-top: 1px solid var(--gray-200);
}

.ptab-sub-row {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding-left: 0.5rem;
}

.ptab-sub-row-deep {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    padding-left: 1.5rem;
}

.ptab-sub {
    padding: 0.45rem 0.85rem;
    border: none;
    background: none;
    font-size: 0.8rem;
    color: var(--gray-500);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    position: relative;
}

.ptab-sub:hover {
    color: var(--gray-700);
    background: var(--gray-50);
}

.ptab-sub.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.ptab-sub-row-deep .ptab-sub.active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}

/* Tab content area */
.project-tab-content {
    padding: 1rem 0.5rem;
    background: white;
    min-height: 200px;
}

.ptab-content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.ptab-content-title h3 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}

.ptab-desc {
    margin: 0;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.ptab-content-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.ptab-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.ptab-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    max-width: 300px;
}

.ptab-progress-fill {
    height: 100%;
    background: var(--success-color);
    border-radius: 3px;
    transition: width 0.3s;
}

.ptab-section {
    margin-bottom: 1.25rem;
}

.ptab-section h4 {
    font-size: 0.9rem;
    color: var(--gray-700);
    margin: 0 0 0.5rem;
}

.ptab-warning {
    color: var(--warning-color);
    font-size: 0.85rem;
    margin: 0;
}

.ptab-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    margin-bottom: 0.35rem;
    cursor: pointer;
    transition: all 0.15s;
}

.ptab-item:hover {
    border-color: var(--primary-color);
    background: #f8faff;
}

.ptab-item.overdue {
    border-left: 3px solid var(--danger-color);
}

.ptab-item.completed {
    opacity: 0.5;
}

.ptab-item.completed .ptab-item-title {
    text-decoration: line-through;
}

.ptab-item-status {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ptab-item-title {
    flex: 1;
    font-size: 0.9rem;
    color: var(--gray-800);
    font-weight: 500;
}

.ptab-item-tags {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

.ptab-completed {
    border-top: 1px solid var(--gray-200);
    padding-top: 0.75rem;
}

.ptab-completed h4 {
    cursor: pointer;
    user-select: none;
}

.ptab-completed .ptab-completed-list {
    display: none;
}

.ptab-completed.open .ptab-completed-list {
    display: block;
}

@media (max-width: 768px) {
    .ptab-content-header {
        flex-direction: column;
    }
    
    .ptab-content-actions {
        flex-wrap: wrap;
    }
}

/* Tab drag-over indicator */
.ptab.drag-over, .ptab-sub.drag-over {
    background: #dbeafe !important;
    border-color: var(--primary-color) !important;
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.nav-item.drag-over {
    background: #dbeafe !important;
    border-radius: 0.5rem;
}

/* Tab drag-over state */
.ptab.drag-over, .ptab-sub.drag-over {
    background: #dbeafe !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Nav item drag-over for projects */
.nav-item.drag-over {
    background: #dbeafe !important;
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

/* ============================================================
   PARKED PROJECTS (in Waiting/Someday/Reference views)
   ============================================================ */

.parked-projects {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--gray-200);
}

.parked-projects h4 {
    font-size: 0.95rem;
    color: var(--gray-700);
    margin: 0 0 0.75rem;
}

.parked-project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--primary-color);
    border-radius: 0.5rem;
    margin-bottom: 0.4rem;
    cursor: grab;
    transition: all 0.15s;
}

.parked-project-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.parked-project-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.parked-project-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.parked-project-meta {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.parked-project-actions {
    display: flex;
    gap: 0.35rem;
}

/* Overview drag-over */
.pov-node.drag-over {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    background: #eff6ff !important;
}

/* Inline waiting-for edit */
.waiting-for-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.waiting-for-input {
    border: 1px solid var(--gray-200);
    border-radius: 0.3rem;
    padding: 0.15rem 0.4rem;
    font-size: 0.8rem;
    width: 180px;
    background: var(--gray-50);
    transition: all 0.15s;
}

.waiting-for-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.waiting-for-input::placeholder {
    color: var(--gray-400);
    font-style: italic;
}

/* ============================================================
   COMPLETION CELEBRATION
   ============================================================ */

.celebrate-particle {
    position: fixed;
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 9999;
    animation: particle-burst 0.8s ease-out forwards;
}

@keyframes particle-burst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) scale(0.3) rotate(360deg);
    }
}

.celebrate-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9998;
    animation: flash-fade 0.5s ease-out forwards;
}

@keyframes flash-fade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Item age tags */
.tag-age-fresh { background: #d1fae5; color: #065f46; }
.tag-age-medium { background: #fef9c3; color: #92400e; }
.tag-age-old { background: #fecaca; color: #991b1b; font-weight: 600; }

/* User Management */
.user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.4rem;
    margin-bottom: 0.35rem;
}

.user-info { display: flex; flex-direction: column; gap: 0.1rem; }
.user-name { font-weight: 600; font-size: 0.9rem; }
.user-meta { font-size: 0.75rem; color: var(--gray-400); }

/* Format toolbar */
.format-toolbar {
    display: flex;
    gap: 0.2rem;
    margin-bottom: 0.3rem;
}

.fmt-btn {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 0.25rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.fmt-btn:hover {
    background: var(--gray-200);
}

/* Task files */
.task-files-list { margin-bottom: 0.5rem; }

.task-file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.3rem;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.task-file-link {
    flex: 1;
    color: var(--primary-color);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-file-size { color: var(--gray-400); font-size: 0.7rem; }

.btn-remove-file {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
}

.btn-remove-file:hover { color: var(--danger-color); }

.empty-hint { color: var(--gray-400); font-size: 0.8rem; margin: 0.3rem 0; }

.task-file-upload { margin-bottom: 0.5rem; }

/* Delegated indicator */
.tag-delegated { background: #dbeafe; color: #1e40af; font-weight: 600; }

/* ============================================================
   CALENDAR VIEW
   ============================================================ */

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.cal-view-toggle {
    display: flex;
    gap: 0;
    margin-left: auto;
}

.cal-view-toggle .btn {
    border-radius: 0;
}

.cal-view-toggle .btn:first-child {
    border-radius: 0.4rem 0 0 0.4rem;
}

.cal-view-toggle .btn:last-child {
    border-radius: 0 0.4rem 0.4rem 0;
}

.cal-mode.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Month View */
.cal-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--gray-200);
    border-radius: 0.5rem 0.5rem 0 0;
    overflow: hidden;
}

.cal-header-cell {
    background: var(--gray-100);
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.cal-body {
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    overflow: hidden;
}

.cal-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--gray-200);
}

.cal-cell {
    background: white;
    min-height: 90px;
    padding: 0.3rem;
    cursor: default;
}

.cal-cell-other {
    background: var(--gray-50);
}

.cal-cell-other .cal-day-num {
    color: var(--gray-300);
}

.cal-cell-today {
    background: #eff6ff;
}

.cal-cell-today .cal-day-num {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-cell-weekend {
    background: #fafafa;
}

.cal-cell-today.cal-cell-weekend {
    background: #eff6ff;
}

.cal-day-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 0.2rem;
}

.cal-day-items {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cal-item {
    font-size: 0.7rem;
    padding: 0.15rem 0.3rem;
    border-radius: 0.2rem;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.cal-item:hover {
    opacity: 0.8;
}

.cal-item-next { background: #dbeafe; color: #1e40af; }
.cal-item-waiting { background: #fef3c7; color: #92400e; }
.cal-item-done { background: #d1fae5; color: #065f46; text-decoration: line-through; }
.cal-item-inbox { background: #e0e7ff; color: #3730a3; }
.cal-item-default { background: var(--gray-100); color: var(--gray-600); }

.cal-item-more {
    font-size: 0.65rem;
    color: var(--gray-400);
    padding: 0.1rem 0.3rem;
}

/* Week View */
.cal-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.cal-week-day {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    min-height: 200px;
    overflow: hidden;
}

.cal-week-today {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.cal-week-header {
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    text-align: center;
}

.cal-week-today .cal-week-header {
    background: var(--primary-color);
    color: white;
}

.cal-week-items {
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.cal-week-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.3rem;
    padding: 0.4rem;
    cursor: pointer;
    transition: all 0.15s;
}

.cal-week-item:hover {
    background: var(--gray-100);
    border-color: var(--primary-color);
}

.cal-week-item.cal-item-next { border-left: 3px solid #3b82f6; }
.cal-week-item.cal-item-waiting { border-left: 3px solid #f59e0b; }
.cal-week-item.cal-item-done { border-left: 3px solid #10b981; opacity: 0.6; }
.cal-week-item.cal-item-inbox { border-left: 3px solid #6366f1; }

.cal-week-item-title {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.cal-week-item-meta {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.cal-week-project, .cal-week-ctx {
    font-size: 0.65rem;
    color: var(--gray-400);
}

.cal-week-empty {
    text-align: center;
    color: var(--gray-300);
    padding: 1rem;
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .cal-week-grid {
        grid-template-columns: 1fr;
    }
    .cal-week-day { min-height: auto; }
}

/* ============================================================
   DOCUMENTS / ERGEBNISSE
   ============================================================ */

.docs-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 0;
    height: calc(100vh - 120px);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    overflow: hidden;
}

.docs-sidebar {
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
}

.docs-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    background: white;
    position: sticky;
    top: 0;
    z-index: 1;
}

.docs-sidebar-header h4 { margin: 0; font-size: 0.9rem; }

.docs-folder-tree { padding: 0.25rem 0; }

.docs-folder-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    font-size: 0.85rem;
}

.docs-folder-item:hover {
    background: var(--gray-100);
}

.docs-folder-item.active {
    background: #dbeafe;
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.docs-folder-icon { font-size: 1rem; }
.docs-folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.docs-folder-actions {
    display: none;
    gap: 0.1rem;
}

.docs-folder-item:hover .docs-folder-actions { display: flex; }

.docs-folder-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
    color: var(--gray-400);
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
}

.docs-folder-actions button:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.docs-empty-hint {
    color: var(--gray-400);
    font-size: 0.8rem;
    padding: 1rem;
    text-align: center;
}

/* Content area */
.docs-content {
    padding: 1rem;
    overflow-y: auto;
    background: white;
}

.docs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.docs-crumb {
    color: var(--primary-color);
    cursor: pointer;
}

.docs-crumb:hover { text-decoration: underline; }

.docs-crumb-current {
    color: var(--gray-700);
    font-weight: 600;
    cursor: default;
}

.docs-crumb-current:hover { text-decoration: none; }
.docs-crumb-sep { color: var(--gray-300); }

/* Subfolder cards */
.docs-subfolder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.docs-subfolder-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.docs-subfolder-card:hover {
    background: #eff6ff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.docs-subfolder-icon { font-size: 2rem; }
.docs-subfolder-name { font-size: 0.8rem; font-weight: 500; word-break: break-word; }

/* Files header */
.docs-files-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.docs-files-header h4 { margin: 0; font-size: 0.9rem; }

/* File cards */
.docs-file-grid {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.docs-file-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.4rem;
    transition: all 0.15s;
}

.docs-file-card:hover {
    background: white;
    border-color: var(--primary-color);
}

.docs-file-icon { font-size: 1.5rem; flex-shrink: 0; }

.docs-file-info { flex: 1; overflow: hidden; }

.docs-file-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docs-file-name:hover { text-decoration: underline; }

.docs-file-meta {
    font-size: 0.7rem;
    color: var(--gray-400);
}

.docs-file-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 0.2rem;
}

.docs-file-card:hover .docs-file-delete { opacity: 1; }

.docs-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--gray-400);
    text-align: center;
}

.docs-empty p { margin: 0.5rem 0 0; }

@media (max-width: 768px) {
    .docs-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .docs-sidebar {
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }
}

/* ============================================================
   QUICK NOTES PANEL
   ============================================================ */

.btn-notes-header {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    border-radius: 0.4rem;
    padding: 0.4rem 0.6rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-notes-header:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.notes-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 620px;
    max-width: 100vw;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 9000;
    display: flex;
    flex-direction: column;
}

.notes-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.notes-panel-header h3 { margin: 0; font-size: 1rem; }

.notes-panel-body {
    display: grid;
    grid-template-columns: 180px 1fr;
    flex: 1;
    overflow: hidden;
}

.notes-list-section {
    border-right: 1px solid var(--gray-200);
    padding: 0.5rem;
    overflow-y: auto;
    background: var(--gray-50);
}

.notes-editor-section {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.note-list-item {
    padding: 0.5rem;
    border-radius: 0.3rem;
    cursor: pointer;
    margin-bottom: 0.2rem;
    transition: all 0.15s;
}

.note-list-item:hover { background: var(--gray-100); }

.note-list-item.active {
    background: #dbeafe;
    border-left: 3px solid var(--primary-color);
}

.note-list-title {
    font-size: 0.8rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-list-date {
    font-size: 0.65rem;
    color: var(--gray-400);
}

.notes-link-row {
    margin-bottom: 0.5rem;
}

.notes-textarea {
    flex: 1;
    resize: none;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    min-height: 200px;
}

.notes-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-200);
}

.note-save-status {
    font-size: 0.75rem;
    color: var(--gray-400);
}

@media (max-width: 768px) {
    .notes-panel { width: 100vw; }
    .notes-panel-body { grid-template-columns: 1fr; }
    .notes-list-section { max-height: 150px; }
}

/* Voice Recording Button */
.quick-capture {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-voice {
    background: linear-gradient(135deg, #34d399, #60a5fa);
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-voice:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 10px rgba(52, 211, 153, 0.4);
}

.btn-voice.recording {
    background: linear-gradient(135deg, #f87171, #fb923c);
    animation: voice-pulse 1s infinite;
}

@keyframes voice-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(248, 113, 113, 0); }
}

.voice-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    color: #065f46;
    margin-top: 0.5rem;
}

.voice-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.voice-status-dot.listening {
    background: #ef4444;
    animation: voice-dot-pulse 1s infinite;
}

.voice-status-dot.heard {
    background: #10b981;
    animation: voice-dot-pulse 0.6s infinite;
}

.voice-status-dot.saving {
    background: #f59e0b;
    animation: voice-dot-spin 0.8s linear infinite;
}

@keyframes voice-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

@keyframes voice-dot-spin {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.voice-result {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    animation: voice-result-fade 0.3s ease;
}

@keyframes voice-result-fade {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Document Download Button */
.docs-file-download {
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 0.2rem;
}

.docs-file-card:hover .docs-file-download { opacity: 1; }

/* ============================================================
   LANDING PAGE — Clearify
   ============================================================ */

.landing-page {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, #ecfdf5 0%, #f0fdf4 30%, #e0f2fe 60%, #ecfdf5 100%);
    z-index: 9999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Floating leaves */
.landing-leaves { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.leaf {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.15;
    animation: leaf-float linear infinite;
}

.leaf-1 { left: 10%; top: -5%; font-size: 2rem; animation-duration: 18s; animation-delay: 0s; }
.leaf-2 { left: 30%; top: -5%; font-size: 1.2rem; animation-duration: 22s; animation-delay: 3s; }
.leaf-3 { left: 60%; top: -5%; font-size: 1.8rem; animation-duration: 20s; animation-delay: 6s; }
.leaf-4 { left: 80%; top: -5%; font-size: 1rem; animation-duration: 25s; animation-delay: 2s; }
.leaf-5 { left: 45%; top: -5%; font-size: 1.5rem; animation-duration: 19s; animation-delay: 8s; }

@keyframes leaf-float {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
    10% { opacity: 0.15; }
    90% { opacity: 0.15; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Nav */
.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2.5rem;
    position: relative;
    z-index: 10;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.landing-logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: #064e3b;
    letter-spacing: -0.5px;
}

.landing-login-btn {
    padding: 0.5rem 1.5rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.landing-login-btn:hover {
    background: #059669;
    color: white;
    border-color: #059669;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* Hero */
.landing-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    position: relative;
    z-index: 10;
    margin-top: -3rem;
}

.landing-title {
    font-size: 4rem;
    font-weight: 800;
    color: #064e3b;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 1.25rem;
}

.landing-accent {
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-style: italic;
}

.landing-subtitle {
    font-size: 1.15rem;
    color: #6b7280;
    line-height: 1.7;
    max-width: 420px;
    margin-bottom: 2.5rem;
}

.landing-features {
    display: flex;
    gap: 2rem;
}

.landing-feature {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #374151;
    font-weight: 500;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 1px solid rgba(5, 150, 105, 0.15);
}

.landing-feature-icon { font-size: 1.1rem; }

/* Login Modal */
.login-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modal-fade-in 0.2s ease;
}

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

.login-modal {
    background: white;
    border-radius: 1.25rem;
    padding: 2.5rem;
    width: 380px;
    max-width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    text-align: center;
    position: relative;
    animation: modal-slide-up 0.3s ease;
}

@keyframes modal-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.login-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

.login-modal-close:hover { color: #374151; }

.login-modal-brand {
    margin-bottom: 1.5rem;
}

.login-modal-brand h2 {
    font-size: 1.3rem;
    color: #111827;
    margin: 0.75rem 0 0.25rem;
    font-weight: 700;
}

.login-modal-brand p {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0;
}

.login-modal-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.6rem;
    font-size: 0.95rem;
    text-align: center;
    transition: border-color 0.2s;
    outline: none;
}

.login-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.login-submit-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    border: none;
    border-radius: 0.6rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.35);
}

.login-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .landing-title { font-size: 2.5rem; letter-spacing: -1px; }
    .landing-subtitle { font-size: 1rem; }
    .landing-features { flex-direction: column; gap: 0.75rem; }
    .landing-nav { padding: 1rem 1.25rem; }
}
