/* CSS Variables */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --header-bg: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
    --hover-bg: #f1f5f9;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Category colors */
    --category-personal: #ec4899;
    --category-work: #3b82f6;
    --category-ideas: #8b5cf6;
    --category-learning: #10b981;
    --category-action: #f59e0b;
    --category-archive: #6b7280;
    --category-private: #9333ea;
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --sidebar-bg: #1e293b;
    --header-bg: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --input-bg: #1e293b;
    --hover-bg: #334155;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .badge-category {
    background: transparent;
    color: #c7d2fe;
}

[data-theme="dark"] .badge-status {
    background: transparent;
    color: #94a3b8;
}

[data-theme="dark"] .linked-requirements {
    background: #334155;
}

[data-theme="dark"] .linked-tag {
    background: #1e293b;
    border-color: #475569;
}

[data-theme="dark"] .form-actions {
    background: #1e293b;
}

/* Dark mode for private note cards */
[data-theme="dark"] .requirement-card.private-note {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(147, 51, 234, 0.1) 100%);
    border-color: #a855f7;
}

[data-theme="dark"] .badge-category-private {
    color: #c084fc;
    border-color: #c084fc;
}

/* Dark mode for file info display */
[data-theme="dark"] .file-info-display {
    background: #334155;
    border-left-color: #818cf8;
}

[data-theme="dark"] .file-info-display.no-file {
    border-left-color: #64748b;
}

/* Dark mode for inline edit */
[data-theme="dark"] .inline-edit-advanced {
    background: #334155;
    border-color: #475569;
}

[data-theme="dark"] .inline-edit-advanced-content {
    background: #1e293b;
    border-color: #475569;
}

[data-theme="dark"] .inline-quill-container {
    border-color: #475569;
}

[data-theme="dark"] .inline-quill-container .ql-toolbar {
    background: #334155;
    border-color: #475569;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--hover-bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--border-color) 0%, var(--text-secondary) 100%);
    border-radius: 10px;
    border: 2px solid var(--hover-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--text-secondary) 0%, var(--primary-color) 100%);
}

/* Selection */
::selection {
    background: var(--primary-light);
    color: var(--primary-hover);
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: var(--header-bg);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-header h1 {
    font-size: 1.875rem;
    font-weight: 600;
}

.project-name-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    padding: 0.625rem 0;
    border-radius: 0;
    border: none;
    transition: all var(--transition-normal);
}

.project-name-container:hover {
    background: transparent;
    border-color: transparent;
}

.project-name-container .icon {
    font-size: 1.5rem;
}

#projectName {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    width: 300px;
    padding: 0.25rem;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

#projectName:hover {
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

#projectName:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
}

#projectName::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Sidebar Toggle */
.sidebar-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.close-sidebar-btn {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.close-sidebar-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Theme Toggle */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

[data-theme="dark"] .theme-toggle .icon-light {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-dark {
    display: flex;
}

.theme-toggle .icon-dark {
    display: none;
}

.theme-toggle .icon-light {
    display: flex;
}

/* Privacy Toggle */
.privacy-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.privacy-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.privacy-toggle svg {
    width: 20px;
    height: 20px;
}

/* Privacy Overlay */
.privacy-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    z-index: 9999;
    cursor: not-allowed;
}

.privacy-overlay.active {
    display: block;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-text-short {
    display: none;
}

.btn-primary {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #94a3b8;
    box-shadow: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: none;
    color: #cbd5e1;
    border-color: #cbd5e1;
}

.btn-primary:active {
    transform: translateY(0);
}

/* Light mode - brighter header buttons */
:root:not([data-theme="dark"]) .header-actions .btn-primary,
html:not([data-theme="dark"]) .header-actions .btn-primary {
    color: #ffffff;
    border-color: #ffffff;
}

:root:not([data-theme="dark"]) .header-actions .btn-primary:hover,
html:not([data-theme="dark"]) .header-actions .btn-primary:hover {
    color: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* Light mode - brighter secondary buttons */
:root:not([data-theme="dark"]) .header-actions .btn-secondary,
html:not([data-theme="dark"]) .header-actions .btn-secondary {
    color: #ffffff;
    border-color: #ffffff;
}

:root:not([data-theme="dark"]) .header-actions .btn-secondary:hover,
html:not([data-theme="dark"]) .header-actions .btn-secondary:hover {
    color: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* Light mode - brighter success buttons */
:root:not([data-theme="dark"]) .header-actions .btn-success,
html:not([data-theme="dark"]) .header-actions .btn-success {
    color: #ffffff;
    border-color: #ffffff;
}

:root:not([data-theme="dark"]) .header-actions .btn-success:hover,
html:not([data-theme="dark"]) .header-actions .btn-success:hover {
    color: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* Light mode - card action buttons (View, Edit) - exact same as Delete */
:root:not([data-theme="dark"]) .card-actions .btn-secondary,
html:not([data-theme="dark"]) .card-actions .btn-secondary,
:root:not([data-theme="dark"]) .card-actions .btn-primary,
html:not([data-theme="dark"]) .card-actions .btn-primary {
    color: #94a3b8;
    border-color: #94a3b8;
}

:root:not([data-theme="dark"]) .card-actions .btn-secondary:hover,
html:not([data-theme="dark"]) .card-actions .btn-secondary:hover,
:root:not([data-theme="dark"]) .card-actions .btn-primary:hover,
html:not([data-theme="dark"]) .card-actions .btn-primary:hover {
    color: #cbd5e1;
    border-color: #cbd5e1;
    background: transparent;
}

.btn-secondary {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #94a3b8;
}

.btn-secondary:hover {
    background: transparent;
    border-color: #cbd5e1;
    color: #cbd5e1;
    transform: translateY(-2px);
}

/* Icon buttons (Save, Print) */
.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Save button flash animation */
.btn-icon.saving-flash,
.btn.saving-flash {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.6), 0 0 40px rgba(34, 197, 94, 0.3) !important;
    animation: save-flash 0.6s ease-out;
    border-color: #22c55e !important;
}

.btn-icon.saving-flash svg,
.btn.saving-flash svg {
    stroke: white !important;
}

@keyframes save-flash {
    0% {
        background: linear-gradient(135deg, #4ade80, #22c55e);
        box-shadow: 0 0 30px rgba(34, 197, 94, 0.8), 0 0 60px rgba(34, 197, 94, 0.5);
        transform: scale(1.1);
    }
    50% {
        background: linear-gradient(135deg, #22c55e, #16a34a);
        box-shadow: 0 0 25px rgba(34, 197, 94, 0.7), 0 0 50px rgba(34, 197, 94, 0.4);
    }
    100% {
        background: transparent;
        box-shadow: none;
        transform: scale(1);
    }
}

.btn-success {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #94a3b8;
    box-shadow: none;
}

.btn-success:hover {
    background: transparent;
    border-color: #cbd5e1;
    color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: none;
}

.btn-text {
    background: transparent;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
}

.btn-text:hover {
    background: var(--primary-light);
}

.btn-danger {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #94a3b8;
    box-shadow: none;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: none;
    color: #cbd5e1;
    border-color: #cbd5e1;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    gap: 0;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.03);
}

.filter-section h3,
.stats-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 700;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.filter-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.filter-group select:hover {
    border-color: var(--primary-color);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.filter-group select option {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Stats Carousel */
.stats-carousel {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--hover-bg) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.stats-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--hover-bg);
    padding: 0.25rem;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.stats-tabs::-webkit-scrollbar {
    height: 2px;
}

.stats-tabs::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.2);
    border-radius: 2px;
}

.stats-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.stats-tab {
    flex: 0 0 auto;
    padding: 0.625rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-tab:hover {
    color: var(--text-primary);
    background: var(--card-bg);
}

.stats-tab.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.stats-panels {
    position: relative;
}

.stats-panel {
    display: none;
    padding: 1rem;
}

.stats-panel.active {
    display: block;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
}

.stat-value.stat-rating-5 {
    color: #f59e0b;
}

.stat-value.stat-rating-4 {
    color: #eab308;
}

.stat-value.stat-rating-3 {
    color: #84cc16;
}

.stat-value.stat-rating-2 {
    color: #22c55e;
}

.stat-value.stat-rating-1 {
    color: #6b7280;
}

.category-stats {
    display: flex;
    flex-direction: column;
}

/* Sidebar Actions */
.sidebar-actions {
    margin-top: auto;
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-mobile-actions {
    display: none;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-mobile-actions h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.sidebar-mobile-actions .btn {
    margin-bottom: 0.5rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Requirements List */
.requirements-list {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* File Info Display */
.file-info-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--hover-bg);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--primary-color);
}

.file-info-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    flex: 1;
    min-width: 0;
}

.file-info-name {
    font-weight: 600;
    color: var(--text-primary);
}

.file-info-path {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    opacity: 0.8;
    word-break: break-all;
}

.file-info-modified {
    font-style: italic;
    white-space: nowrap;
}

.file-info-modified::before {
    content: '•';
    margin-right: 0.5rem;
    opacity: 0.5;
}

.file-info-encryption {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    flex-shrink: 0;
    margin-left: 1rem;
}

.file-info-encryption.encrypted {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.file-info-encryption.not-encrypted {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

[data-theme="dark"] .file-info-encryption.encrypted {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

[data-theme="dark"] .file-info-encryption.not-encrypted {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.file-info-display:empty,
.file-info-display.no-file .file-info-path,
.file-info-display.no-file .file-info-modified {
    display: none;
}

.file-info-display.no-file {
    border-left-color: var(--text-secondary);
    opacity: 0.7;
}

.list-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-input:hover {
    border-color: var(--primary-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), var(--shadow-md);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.sort-controls select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

.sort-controls select option {
    background: var(--card-bg);
    color: var(--text-primary);
}

/* Requirements Container */
.requirements-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Requirement Card */
.requirement-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 0.875rem 1rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* Collapsible card body - hidden by default */
.requirement-card .card-body {
    display: none;
    margin-top: 0.75rem;
}

.requirement-card.expanded .card-body {
    display: block;
}

/* Expand indicator */
.expand-indicator {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform var(--transition-fast);
    margin-left: 0.75rem;
}

.requirement-card.expanded .expand-indicator {
    transform: rotate(180deg);
}

.requirement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--category-ideas));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.requirement-card:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: transparent;
    transform: translateY(-2px);
}

.requirement-card:hover::before {
    opacity: 1;
}

/* Private note card styling */
.requirement-card.private-note {
    border: 1px dashed var(--category-private);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(147, 51, 234, 0.05) 100%);
}

.requirement-card.private-note::before {
    background: linear-gradient(90deg, var(--category-private), #a855f7);
}

.private-indicator {
    font-size: 1rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.requirement-card.expanded .card-header {
    margin-bottom: 0;
}

.card-header-left {
    flex: 1;
    min-width: 0;
}

.card-header-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.card-id {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0.125rem 0;
    color: var(--text-primary);
}

.card-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-lg);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-category {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
}

/* Category-specific colors - all use same gray */
.badge-category-personal {
    background: transparent;
    color: var(--text-secondary);
}

.badge-category-work {
    background: transparent;
    color: var(--text-secondary);
}

.badge-category-ideas {
    background: transparent;
    color: var(--text-secondary);
}

.badge-category-learning {
    background: transparent;
    color: var(--text-secondary);
}

.badge-category-action {
    background: transparent;
    color: var(--text-secondary);
}

.badge-category-archive {
    background: transparent;
    color: var(--text-secondary);
    font-style: italic;
}

.badge-category-private {
    background: transparent;
    color: #9333ea;
    font-style: italic;
    border: 1px dashed #9333ea;
}

/* Rating badge */
.badge-rating {
    background: transparent;
    color: var(--text-secondary);
    letter-spacing: 2px;
    font-size: 0.8125rem;
    border: 1px solid var(--text-secondary);
}

.badge-status {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
}

.badge-status-completed {
    background: transparent;
    color: var(--text-secondary);
}

.badge-status-in-progress {
    background: transparent;
    color: var(--text-secondary);
}

.badge-status-not-started {
    background: transparent;
    color: var(--text-secondary);
}

.badge-status-deferred {
    background: transparent;
    color: var(--text-secondary);
}

.badge-status-cancelled {
    background: transparent;
    color: var(--text-secondary);
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Remove line clamping when expanded - show full content */
.requirement-card.expanded .card-description {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
}

/* Card summary - always visible with date */
.card-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.375rem;
    margin-top: 0.375rem;
    border-top: 1px solid var(--border-color);
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Hide card summary when expanded (footer shows date instead) */
.requirement-card.expanded .card-summary {
    display: none;
}

/* Card footer inside body - shows date and buttons when expanded */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.meta-info {
    display: flex;
    gap: 1.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.meta-item .icon {
    font-size: 1rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-actions .btn {
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
}

.card-actions .btn-secondary {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
}

/* ========== INLINE EDIT MODE ========== */
/* To revert: remove these styles and change JS back to openModal */

.requirement-card.inline-editing {
    cursor: default;
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.requirement-card.inline-editing:hover {
    transform: none;
}

/* Hide title and badges when in edit mode - only show note ID */
.requirement-card.inline-editing .card-title,
.requirement-card.inline-editing .card-badges,
.requirement-card.inline-editing .expand-indicator {
    display: none;
}

.requirement-card.inline-editing .card-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.requirement-card.inline-editing .card-id {
    font-size: 0.875rem;
    font-weight: 600;
}

.inline-edit-form {
    padding: 0.5rem 0;
}

.inline-edit-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.inline-edit-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
}

.inline-edit-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inline-edit-title {
    flex: 3;
}

.inline-edit-rating {
    flex: 1;
    min-width: 140px;
}

/* Meta row with category, status, due date, progress */
.inline-meta-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.inline-edit-category {
    flex: 1;
    min-width: 120px;
}

.inline-edit-status {
    flex: 1;
    min-width: 120px;
}

.inline-edit-due {
    flex: 1;
    min-width: 140px;
}

.inline-edit-progress {
    flex: 1.5;
    min-width: 180px;
}

.inline-meta-row .progress-input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-meta-row .progress-slider {
    flex: 1;
    min-width: 60px;
}

.inline-meta-row .progress-number {
    width: 50px;
}

.inline-edit-group input[type="text"],
.inline-edit-group input[type="date"],
.inline-edit-group select,
.inline-edit-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.inline-edit-group input:focus,
.inline-edit-group select:focus,
.inline-edit-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.inline-edit-group #inlineTitle {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Inline star rating */
#inlineStarRating {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 0;
}

#inlineStarRating .star {
    font-size: 1.5rem;
    color: var(--border-color);
    cursor: pointer;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

#inlineStarRating .star.active,
#inlineStarRating .star.hover {
    color: #f59e0b;
}

#inlineStarRating .star:hover {
    transform: scale(1.1);
}

/* Inline Quill editor */
.inline-quill-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    min-height: 150px;
}

.inline-quill-container .ql-toolbar {
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: var(--hover-bg);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.inline-quill-container .ql-container {
    border: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    font-size: 1.0625rem;
}

.inline-quill-container .ql-editor {
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 1.0625rem;
    line-height: 1.7;
}

/* Advanced options accordion */
.inline-edit-advanced {
    margin: 1rem 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--hover-bg);
}

.inline-edit-advanced summary {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-edit-advanced summary::before {
    content: '▶';
    font-size: 0.625rem;
    transition: transform var(--transition-fast);
}

.inline-edit-advanced[open] summary::before {
    transform: rotate(90deg);
}

.inline-edit-advanced summary::-webkit-details-marker {
    display: none;
}

.inline-edit-advanced-content {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.inline-edit-advanced-content > .inline-edit-group,
.inline-edit-advanced-content > .inline-edit-row {
    margin-bottom: 0;
}

.inline-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

/* Inline edit actions */
.inline-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.inline-edit-actions .btn {
    padding: 0.625rem 1.25rem;
}

/* Mobile responsive for inline edit */
@media (max-width: 768px) {
    .inline-edit-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .inline-edit-title,
    .inline-edit-rating {
        flex: none;
    }
    
    .inline-meta-row {
        flex-direction: column;
    }
    
    .inline-edit-category,
    .inline-edit-status,
    .inline-edit-due,
    .inline-edit-progress {
        flex: none;
        width: 100%;
        min-width: auto;
    }
    
    .inline-quill-container .ql-editor {
        min-height: 100px;
    }
}

/* ========== END INLINE EDIT MODE ========== */

.card-actions .btn-secondary:hover {
    background: transparent;
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Linked Requirements */
.linked-requirements {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--hover-bg) 0%, transparent 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.linked-requirements h4 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.linked-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.linked-tag {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--primary-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.linked-tag:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Star Rating Input */
.star-rating-input {
    display: flex;
    gap: 0.375rem;
    padding: 0.5rem 0;
}

.star-rating-input .star {
    font-size: 1.75rem;
    color: #e2e8f0;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.star-rating-input .star:hover,
.star-rating-input .star.hover {
    color: #fbbf24;
    transform: scale(1.2) rotate(-5deg);
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

.star-rating-input .star.active {
    color: #f59e0b;
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* Progress Input Container - Modern Design */
.progress-input-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    background: transparent;
    border-radius: 0;
    border: none;
}

.progress-input-container:hover,
.progress-input-container:focus-within {
    border-color: transparent;
    box-shadow: none;
}

.progress-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 999px;
    outline: none;
    position: relative;
    cursor: pointer;
}

.progress-slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, 
        var(--primary-color) 0%, 
        var(--primary-color) var(--progress, 0%), 
        var(--border-color) var(--progress, 0%));
}

.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: -6px;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.5);
}

.progress-slider::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: var(--border-color);
}

.progress-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.progress-number {
    width: 55px !important;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem !important;
    border-radius: var(--radius-sm) !important;
    background: var(--hover-bg) !important;
    border: 1px solid var(--border-color) !important;
}

.progress-percent {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Progress Bar Display */
.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0;
    padding: 0.75rem 0;
    background: transparent;
    border-radius: var(--radius-md);
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: var(--border-color);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
    border-radius: 999px;
}

.progress-fill.progress-low {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.progress-fill.progress-medium {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.progress-fill.progress-high {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.progress-fill.progress-complete {
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.progress-percentage {
    font-size: 0.9375rem;
    font-weight: 700;
    min-width: 50px;
    text-align: right;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* View Modal Progress */
.view-modal-progress {
    margin: 0;
    padding: 0.5rem 0;
    background: transparent;
}

/* Due Date Display */
.due-date-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--hover-bg) 0%, transparent 100%);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.due-date-display .icon {
    font-size: 1.125rem;
}

.due-date-display.overdue {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
    color: #dc2626;
    font-weight: 600;
}

.due-date-display.due-soon {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
    color: #d97706;
    font-weight: 500;
}

.overdue-badge,
.due-soon-badge {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
}

.overdue-badge {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.due-soon-badge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.overdue-text {
    color: #dc2626;
    font-weight: 600;
}

.due-soon-text {
    color: #d97706;
    font-weight: 500;
}

[data-theme="dark"] .due-date-display {
    background: linear-gradient(135deg, var(--border-color) 0%, transparent 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .due-date-display.overdue {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2) 0%, rgba(220, 38, 38, 0.1) 100%);
    border-color: rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

[data-theme="dark"] .due-date-display.due-soon {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.2) 0%, rgba(217, 119, 6, 0.1) 100%);
    border-color: rgba(217, 119, 6, 0.3);
    color: #fcd34d;
}

[data-theme="dark"] .overdue-badge {
    background: rgba(153, 27, 27, 0.3);
    color: #fca5a5;
}

[data-theme="dark"] .due-soon-badge {
    background: rgba(146, 64, 14, 0.3);
    color: #fcd34d;
}

[data-theme="dark"] .overdue-text {
    color: #fca5a5;
}

[data-theme="dark"] .due-soon-text {
    color: #fcd34d;
}

[data-theme="dark"] .progress-input-container {
    background: transparent;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal.active .modal-content {
    animation: slideUp 0.3s ease-out;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), var(--shadow-glow);
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--hover-bg) 0%, transparent 100%);
}

.modal-header h2 {
    font-size: 1.375rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-btn {
    background: var(--hover-bg);
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

/* Form */
#requirementForm,
.view-content {
    padding: 2rem;
}

.form-row {
    margin-bottom: 1.75rem;
}

.form-row.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-row.title-rating-row {
    grid-template-columns: 1fr auto;
    align-items: end;
}

.form-row.title-rating-row .title-group {
    flex: 1;
}

.form-row.title-rating-row .rating-group {
    min-width: 160px;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--primary-color);
}

.form-group select option {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 0.5rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-group small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    display: block;
}

.multi-select {
    min-height: 100px;
}

/* Quill Editor Styles */
.quill-editor-container {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.quill-editor-container .ql-toolbar {
    background: var(--hover-bg);
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem;
}

.quill-editor-container .ql-toolbar .ql-stroke {
    stroke: var(--text-secondary);
}

.quill-editor-container .ql-toolbar .ql-fill {
    fill: var(--text-secondary);
}

.quill-editor-container .ql-toolbar .ql-picker {
    color: var(--text-secondary);
}

.quill-editor-container .ql-toolbar .ql-picker-options {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.quill-editor-container .ql-toolbar button:hover .ql-stroke,
.quill-editor-container .ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--primary-color);
}

.quill-editor-container .ql-toolbar button:hover .ql-fill,
.quill-editor-container .ql-toolbar button.ql-active .ql-fill {
    fill: var(--primary-color);
}

.quill-editor-container .ql-toolbar .ql-picker-label:hover,
.quill-editor-container .ql-toolbar .ql-picker-label.ql-active {
    color: var(--primary-color);
}

.quill-editor-container .ql-container {
    border: none;
    font-family: inherit;
    font-size: 1rem;
}

.quill-editor-container .ql-editor {
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    color: var(--text-primary);
    padding: 1rem;
}

.quill-editor-container .ql-editor.ql-blank::before {
    color: var(--text-secondary);
    opacity: 0.7;
    font-style: normal;
}

.quill-editor-container .ql-editor a {
    color: var(--primary-color);
}

.quill-editor-container .ql-editor blockquote {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-secondary);
}

.quill-editor-container .ql-editor pre {
    background: var(--hover-bg);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
}

.quill-editor-container .ql-editor code {
    background: var(--hover-bg);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
}

/* Quill Snow theme overrides for dark mode */
[data-theme="dark"] .quill-editor-container .ql-toolbar .ql-picker-options {
    background: var(--card-bg);
}

[data-theme="dark"] .quill-editor-container .ql-snow .ql-tooltip {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .quill-editor-container .ql-snow .ql-tooltip input[type="text"] {
    background: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--hover-bg) 0%, var(--card-bg) 100%);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* View Modal Content */
.view-content .detail-row {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.view-content .detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.view-content .detail-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.view-content .detail-value {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
}

/* Rich text content styling for view modal, cards, and print */
.rich-text-content {
    line-height: 1.6;
}

.rich-text-content p {
    margin: 0 0 0.5em 0;
}

.rich-text-content p:last-child {
    margin-bottom: 0;
}

.rich-text-content strong {
    font-weight: 700;
}

.rich-text-content em {
    font-style: italic;
}

.rich-text-content u {
    text-decoration: underline;
}

.rich-text-content s {
    text-decoration: line-through;
}

.rich-text-content h1, .rich-text-content h2, .rich-text-content h3 {
    margin: 0.5em 0 0.25em 0;
    font-weight: 600;
}

.rich-text-content h1 {
    font-size: 1.5em;
}

.rich-text-content h2 {
    font-size: 1.25em;
}

.rich-text-content h3 {
    font-size: 1.1em;
}

.rich-text-content ul, .rich-text-content ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.rich-text-content li {
    margin-bottom: 0.25em;
}

.rich-text-content blockquote {
    border-left: 3px solid var(--primary-color);
    margin: 0.5em 0;
    padding-left: 1em;
    color: var(--text-secondary);
    font-style: italic;
}

.rich-text-content pre {
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 0.75em;
    margin: 0.5em 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.rich-text-content code {
    background: var(--bg-tertiary);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.rich-text-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.rich-text-content a:hover {
    opacity: 0.8;
}

/* Image styles for rich text content */
.rich-text-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 0.5em 0;
    display: block;
}

.quill-editor-container .ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 0.5em 0;
    cursor: pointer;
}

/* Table styles for rich text content */
.rich-text-content table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    margin: 0.5em 0;
}

.rich-text-content td,
.rich-text-content th {
    border: 1px solid var(--border-color);
    padding: 0.5em 0.75em;
    text-align: left;
    vertical-align: top;
}

.rich-text-content th {
    background: var(--hover-bg);
    font-weight: 600;
}

.rich-text-content tr:nth-child(even) td {
    background: var(--hover-bg);
}

[data-theme="dark"] .rich-text-content td,
[data-theme="dark"] .rich-text-content th {
    border-color: var(--border-color);
}

/* Card description truncation for rich text */
.card-description.rich-text-content {
    max-height: 4.5em;
    overflow: hidden;
}

.card-description.rich-text-content > *:not(table):not(thead):not(tbody):not(tr):not(td):not(th) {
    margin: 0 !important;
}

.card-description.rich-text-content table,
.card-description.rich-text-content thead,
.card-description.rich-text-content tbody,
.card-description.rich-text-content tr,
.card-description.rich-text-content td,
.card-description.rich-text-content th {
    display: none; /* Hide tables in truncated card view */
}

.card-description.rich-text-content p {
    display: inline;
}

.card-description.rich-text-content br {
    content: ' ';
}

/* Show tables properly in expanded card view */
.requirement-card.expanded .card-description.rich-text-content {
    max-height: none;
    overflow: visible;
}

.requirement-card.expanded .card-description.rich-text-content table {
    display: table !important;
}

.requirement-card.expanded .card-description.rich-text-content thead {
    display: table-header-group !important;
}

.requirement-card.expanded .card-description.rich-text-content tbody {
    display: table-row-group !important;
}

.requirement-card.expanded .card-description.rich-text-content tr {
    display: table-row !important;
}

.requirement-card.expanded .card-description.rich-text-content td,
.requirement-card.expanded .card-description.rich-text-content th {
    display: table-cell !important;
}

.requirement-card.expanded .card-description.rich-text-content > * {
    margin: 0.5em 0;
}

.requirement-card.expanded .card-description.rich-text-content p {
    display: block;
}

.view-content .detail-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Help Modal Content */
.help-content {
    max-height: 60vh;
    overflow-y: auto;
}

.help-section {
    margin-bottom: 1.5rem;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.help-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.help-section li:last-child {
    border-bottom: none;
}

.help-section li::before {
    content: "•";
    position: absolute;
    left: 0.5rem;
    color: var(--primary-color);
}

.help-section li strong {
    color: var(--text-primary);
}

.help-section code {
    background: var(--border-color);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Help Footer (inside modal) */
.help-footer {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--header-bg);
    border-radius: var(--radius-lg);
    text-align: center;
}

.help-footer .footer-credit {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #e2e8f0;
}

.help-footer .footer-contact {
    display: flex;
    justify-content: center;
}

.help-footer .contact-card h4 {
    color: #e2e8f0;
}

.help-footer .contact-card p {
    color: #cbd5e1;
}

.help-footer .contact-email {
    color: #94a3b8;
}

.help-footer .contact-email:hover {
    color: #e2e8f0;
}

/* Link Notes Modal */
.modal-sm {
    max-width: 500px;
}

.link-notes-content {
    max-height: 50vh;
    overflow-y: auto;
}

.link-notes-search {
    margin-bottom: 1rem;
}

.link-notes-search .search-input {
    width: 100%;
}

.link-notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.link-note-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: var(--hover-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.link-note-item:hover {
    background: var(--border-color);
}

.link-note-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.link-note-id {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.link-note-title {
    font-size: 0.875rem;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-notes-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Linked Notes Display in Form */
.linked-notes-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.linked-notes-preview {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    background: var(--hover-bg);
    border-radius: var(--radius-sm);
    min-height: 2rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.linked-notes-preview.has-links {
    color: var(--text-primary);
}

.linked-preview-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Category Management Modal */
.category-content {
    max-height: 60vh;
    overflow-y: auto;
}

.category-add-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--hover-bg);
    border-radius: var(--radius-sm);
    gap: 1rem;
}

.category-item .category-name {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.category-item .category-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.category-item .default-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--border-color);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-style: italic;
}

.filter-group .btn-text.btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0;
    margin-top: 0.25rem;
}

[data-theme="dark"] .form-actions {
    background: #1e293b;
}

/* Due Soon Banner */
.due-soon-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease-out;
}

.due-soon-banner.has-overdue {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #ef4444;
}

.due-soon-banner.has-overdue .due-soon-icon {
    color: #ef4444;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.due-soon-icon {
    font-size: 1.5rem;
    color: #f59e0b;
}

.due-soon-content {
    flex: 1;
    font-size: 0.875rem;
    color: #78350f;
}

.due-soon-banner.has-overdue .due-soon-content {
    color: #7f1d1d;
}

.due-soon-content strong {
    display: block;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
}

.btn-warning:hover {
    background: #d97706;
}

[data-theme="dark"] .due-soon-banner {
    background: linear-gradient(135deg, #422006 0%, #78350f 100%);
    border-color: #f59e0b;
}

[data-theme="dark"] .due-soon-banner .due-soon-content {
    color: #fef3c7;
}

[data-theme="dark"] .due-soon-banner.has-overdue {
    background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
    border-color: #ef4444;
}

[data-theme="dark"] .due-soon-banner.has-overdue .due-soon-content {
    color: #fee2e2;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-secondary);
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--hover-bg) 100%);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border-color);
}

.empty-state .icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    filter: grayscale(0.3);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
}

.empty-state p {
    font-size: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

/* Hero Empty State */
.hero-state {
    border: none;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(180deg, var(--card-bg) 0%, var(--hover-bg) 50%, var(--card-bg) 100%);
    position: relative;
    overflow: hidden;
}

.hero-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.hero-content {
    max-width: 600px;
    margin: 0 auto 3rem;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    letter-spacing: 0.025em;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.gradient-text {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 4.5rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.hero-cta .cta-icon {
    font-size: 1.25rem;
}

.hero-hint {
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.hero-hint kbd {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.75rem;
    margin: 0 0.125rem;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto 2.5rem;
}

.feature-card {
    padding: 1.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.feature-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.feature-card h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.feature-card p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
    max-width: none;
}

.hero-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    max-width: 600px;
    margin: 0 auto;
}

.hero-footer .divider {
    opacity: 0.3;
}

@media (max-width: 900px) {
    .hero-features {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-features {
        grid-template-columns: 1fr;
    }
    
    .hero-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .hero-footer .divider {
        display: none;
    }
}

/* Custom Dialog Modal */
.custom-dialog-modal .custom-dialog-content {
    max-width: 420px;
}

.custom-dialog-body {
    padding: 1.5rem 2rem;
}

.custom-dialog-body p {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    white-space: pre-line;
}

.dialog-input-container {
    margin-top: 1rem;
}

.dialog-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.dialog-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dialog-input[type="password"] {
    letter-spacing: 0.1em;
}

.custom-dialog-actions {
    padding: 1rem 2rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--hover-bg);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Alert-only dialog (no cancel button) */
.custom-dialog-modal.alert-mode #dialogCancelBtn {
    display: none;
}

/* Footer */
.app-footer {
    background: var(--header-bg);
    color: #94a3b8;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer-credit {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.footer-contact {
    display: flex;
    justify-content: center;
}

.contact-card {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.6) 0%, rgba(30, 41, 59, 0.8) 50%, rgba(51, 65, 85, 0.6) 100%);
    padding: 1.25rem 2rem;
    border-radius: var(--radius-lg);
    max-width: 400px;
    color: #cbd5e1;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.contact-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

.contact-card p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.75rem;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.contact-email:hover {
    color: #e2e8f0;
}

.email-icon {
    font-size: 1rem;
}

/* Text Links */
.text-link {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
}

.text-link:hover {
    text-decoration: underline;
}

[data-theme="dark"] .text-link {
    color: #818cf8;
}

/* Responsive */
@media (max-width: 1024px) {
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }
    
    .close-sidebar-btn {
        display: block;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 100;
        background: var(--sidebar-bg);
        border-right: 1px solid var(--border-color);
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 1rem;
        padding-top: 3rem;
        gap: 1rem;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .stats-carousel {
        display: block !important;
    }
    
    .app-header {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    
    .header-left {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .header-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: flex-end;
        flex: 1;
    }
    
    .header-actions .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    #projectName {
        width: 150px;
        font-size: 1rem;
    }
    
    .project-name-container {
        padding: 0.25rem 0.5rem;
    }
    
    .list-header {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }
    
    .search-input {
        flex: 1;
        min-width: 0;
    }
    
    .sort-controls {
        flex-shrink: 0;
    }
    
    .sort-controls label {
        display: none;
    }
    
    .sort-controls select {
        width: auto;
    }
    
    .form-row.two-columns {
        grid-template-columns: 1fr;
    }
    
    .requirements-list {
        padding: 1rem;
    }
    
    .requirement-card {
        padding: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .card-header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .card-badges {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0.5rem;
    }
    
    .btn-text-full {
        display: none;
    }
    
    .btn-text-short {
        display: inline;
    }
    
    .header-left {
        width: auto;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .header-actions .btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Hide these buttons on mobile - they're in sidebar */
    #importBtn,
    #exportBtn,
    #printBtn,
    #newProjectBtn {
        display: none;
    }
    
    .sidebar-mobile-actions {
        display: block;
    }
    
    .theme-toggle {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .sidebar-toggle {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    
    #projectName {
        width: 100px;
        font-size: 0.85rem;
    }
    
    .project-name-container {
        padding: 0.25rem 0.4rem;
    }
    
    .project-name-container .icon {
        font-size: 1rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .contact-card {
        padding: 1rem;
    }
}

/* Attachment Styles */
.attachment-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
    max-width: 200px;
}

.attachment-item .attachment-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.attachment-item .attachment-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.attachment-item .attachment-size {
    color: var(--text-secondary);
    font-size: 0.7rem;
    flex-shrink: 0;
}

.attachment-item .attachment-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.attachment-item .attachment-remove:hover {
    opacity: 1;
}

.attachment-item .attachment-download {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.attachment-item .attachment-download:hover {
    opacity: 1;
}

/* Card summary attachment display */
.card-attachments {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.card-attachment-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.2s;
}

.card-attachment-tag:hover {
    background: rgba(99, 102, 241, 0.2);
}

/* View Modal Attachments */
.view-attachments-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.view-attachment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.view-attachment-item:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.view-att-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.view-att-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.view-att-size {
    color: var(--text-secondary);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.label-hint {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.75rem;
}
