/* ============================================================
   Progress Board - 风格：高级灰 + #108cda 蓝
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
    --primary: #108cda;
    --primary-light: #4da8e6;
    --primary-subtle: rgba(16, 140, 218, 0.08);
    --primary-glow: rgba(16, 140, 218, 0.15);
    
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --bg-sidebar: #f8f9fb;
    --bg-hover: #f2f4f8;
    --bg-active: #e8edf4;
    
    --text-primary: #1a2332;
    --text-secondary: #5a6a7a;
    --text-muted: #8e9aab;
    --text-on-primary: #ffffff;
    
    --border: #e4e8ee;
    --border-light: #eef1f5;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
    --shadow-bar: 0 2px 8px rgba(16, 140, 218, 0.20);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 999px;
    
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    --sidebar-w: 220px;
    --topbar-h: 56px;
}

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

/* ---- App Layout ---- */
#app {
    display: flex;
    height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    color: var(--primary);
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.quarter-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 8px 10px;
}

.quarter-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quarter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: relative;
}

.quarter-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.quarter-item.active {
    background: var(--primary-subtle);
    color: var(--primary);
    font-weight: 500;
}

.quarter-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.quarter-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
}

.quarter-item.active .quarter-dot {
    background: var(--primary);
}

.quarter-item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quarter-item-pct {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-add-quarter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 12px 16px;
    padding: 8px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-add-quarter:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}

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

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-h);
    padding: 0 32px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
}

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

.bc-item {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.bc-item.bc-active {
    color: var(--text-primary);
    font-weight: 500;
}

.bc-sep {
    color: var(--border);
    font-size: 0.85rem;
}

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

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ---- Progress Section ---- */
.progress-section {
    padding: 20px 32px 0;
    flex-shrink: 0;
}

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

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-percent {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

/* ---- Quarter Bar ---- */
.quarter-bar-wrapper {
    display: flex;
    gap: 0;
    height: 140px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.bar-segment {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 14px 10px 12px;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-slow);
    border-right: 1px solid var(--border-light);
    min-width: 0;
    overflow: hidden;
}

.bar-segment:last-child {
    border-right: none;
}

.bar-segment:hover {
    background: var(--bg-hover);
}

.bar-segment.active {
    background: var(--primary-subtle);
}

.bar-segment.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.segment-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.segment-month {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.segment-bar-track {
    width: 100%;
    max-width: 120px;
    height: 6px;
    background: var(--bg-body);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}

.segment-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.segment-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.segment-pct {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 2px;
}

.segment-worktitle {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
    margin-top: 6px;
    text-align: center;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.segment-arrow {
    margin-top: 4px;
    color: var(--text-muted);
    opacity: 0;
    transform: translateY(-4px);
    transition: all var(--transition);
}

.bar-segment:hover .segment-arrow {
    opacity: 0.5;
    transform: translateY(0);
}

.bar-segment.active .segment-arrow {
    opacity: 1;
    transform: translateY(0);
    color: var(--primary);
}

/* ---- Month Detail Panel ---- */
.month-detail {
    flex: 1;
    padding: 16px 32px 24px;
    overflow-y: auto;
    animation: slideDown 0.35s ease;
}

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

.month-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.month-detail-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.month-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-add-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-add-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}

.month-meta-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.month-mini-bar {
    width: 80px;
    height: 4px;
    background: var(--bg-body);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.month-mini-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    transition: width 0.6s ease;
}

.meta-num {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

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

.item-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.item-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.item-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--primary-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}

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

.item-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-bar {
    flex: 1;
    max-width: 120px;
    height: 4px;
    background: var(--bg-body);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.item-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    transition: width 0.6s ease;
}

.item-pct {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 32px;
}

.item-chevron {
    color: var(--text-muted);
    transition: transform var(--transition);
    flex-shrink: 0;
}

.item-card:hover .item-chevron {
    transform: translateX(2px);
    color: var(--primary);
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-sm {
    max-width: 400px;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.btn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* Sub Items in Modal */
.sub-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

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

.sub-checkbox {
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.sub-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.sub-checkbox label {
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.sub-checkbox label:hover {
    border-color: var(--primary);
}

.sub-checkbox input:checked + label {
    background: var(--primary);
    border-color: var(--primary);
}

.sub-checkbox input:checked + label::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    animation: checkPop 0.2s ease;
}

@keyframes checkPop {
    0% { transform: rotate(45deg) scale(0); }
    50% { transform: rotate(45deg) scale(1.2); }
    100% { transform: rotate(45deg) scale(1); }
}

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

.sub-title {
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: color var(--transition);
}

.sub-title.done {
    color: var(--text-muted);
    text-decoration: line-through;
}

.sub-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sub-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: var(--radius-full);
}

.sub-badge.done {
    background: #e8f8ee;
    color: #0d9e4e;
}

.sub-badge.pending {
    background: #fff3e6;
    color: #cc7a2a;
}

.sub-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sub-notes {
    margin-top: 6px;
    padding: 8px 12px;
    background: #f8f9fc;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    position: relative;
}

.sub-notes-edit {
    width: 100%;
    min-height: 60px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color var(--transition);
    background: var(--bg-card);
    color: var(--text-primary);
    line-height: 1.5;
}

.sub-notes-edit:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.sub-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-delete-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition);
}

.sub-item:hover .btn-delete-sub {
    opacity: 0.5;
}

.btn-delete-sub:hover {
    opacity: 1 !important;
    background: #fee;
    color: #e44;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 16px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition);
}

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

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

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

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

.btn-primary:hover {
    background: #0f7ac4;
    box-shadow: var(--shadow-bar);
}

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

.btn-secondary:hover {
    background: var(--active-bg);
    color: var(--text-primary);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.78rem;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 5px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- Sidebar Overlay (mobile) ---- */
.item-edit-btn, .item-del-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition);
    padding: 0;
}
.item-card:hover .item-edit-btn,
.item-card:hover .item-del-btn {
    opacity: 0.5;
}
.item-edit-btn:hover {
    opacity: 1 !important;
    background: var(--primary-subtle);
    color: var(--primary);
}
.item-del-btn:hover {
    opacity: 1 !important;
    background: #fee;
    color: #e44;
}
.item-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.item-due {
    font-size: 0.72rem;
    margin-top: 3px;
    font-weight: 500;
}
.item-due.due-overdue { color: #e44; }
.item-due.due-urgent { color: #e88a0a; }
.item-due.due-normal { color: var(--text-muted); }
.item-notes-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.sub-title {
    display: flex;
    align-items: center;
    gap: 4px;
}
.sub-title-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition);
    padding: 0;
    flex-shrink: 0;
}
.sub-item:hover .sub-title-edit {
    opacity: 0.5;
}
.sub-title-edit:hover {
    opacity: 1 !important;
    background: var(--primary-subtle);
    color: var(--primary);
}

.quarter-del-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition);
    flex-shrink: 0;
    padding: 0;
}

.quarter-item:hover .quarter-del-btn {
    opacity: 0.4;
}

.quarter-del-btn:hover {
    opacity: 1 !important;
    background: #fee;
    color: #e44 !important;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 99;
}

.sidebar-close {
    display: none;
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

/* ---- Month Notes ---- */
.month-edit-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition);
    z-index: 2;
}

.bar-segment:hover .month-edit-btn {
    opacity: 0.6;
}

.month-edit-btn:hover {
    opacity: 1 !important;
    background: var(--primary-subtle);
    color: var(--primary);
}

/* ---- Month Notes ---- */
.month-notes {
    margin: 4px 0 0;
    padding: 6px 10px;
    background: #f8f9fc;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    border-left: 3px solid var(--border);
}

.month-notes-edit {
    width: 100%;
    min-height: 50px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color var(--transition);
    background: var(--bg-card);
    color: var(--text-primary);
    line-height: 1.5;
}

.month-notes-edit:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Read-only hidden elements */
.edit-hidden {
    display: none !important;
}

/* ---- Toast ---- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 16px;
    background: #1a2332;
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
    max-width: 320px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 8px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ---- Responsive ---- */
.btn-menu {
    display: none !important;
}

@media (max-width: 768px) {
    .btn-menu {
        display: flex !important;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 100;
        transition: left var(--transition-slow);
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar.open ~ .sidebar-overlay {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .top-bar {
        padding: 0 12px;
        height: 48px;
    }
    
    .progress-section {
        padding: 12px 12px 0;
    }
    
    .quarter-bar-wrapper {
        flex-direction: column;
        height: auto;
        gap: 0;
    }
    
    .bar-segment {
        flex-direction: row;
        padding: 10px 12px;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .bar-segment:last-child {
        border-bottom: none;
    }
    
    .bar-segment.active::after {
        left: 0;
        right: auto;
        top: 0;
        bottom: 0;
        width: 3px;
        height: auto;
        border-radius: 0 3px 3px 0;
    }
    
    .segment-month {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
    
    .segment-bar-track {
        flex: 1;
        max-width: 100px;
        height: 6px;
        margin-bottom: 0;
    }
    
    .segment-pct {
        font-size: 0.8rem;
        min-width: 36px;
    }
    
    .segment-worktitle {
        font-size: 0.78rem;
        margin-top: 4px;
        width: 100%;
    }
    
    .month-notes {
        width: 100%;
        order: 6;
        font-size: 0.72rem;
        padding: 4px 8px;
    }
    
    .segment-arrow {
        margin-left: auto;
    }
    
    .month-detail {
        padding: 12px 12px 16px;
    }
    
    .month-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .month-meta-progress {
        width: 100%;
    }
    
    .modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 14px 16px;
    }
    
    .modal-body {
        padding: 14px 16px;
    }
    
    .section-title {
        font-size: 0.9rem;
    }
    
    .progress-percent {
        font-size: 1.1rem;
    }
    
    .item-card {
        padding: 10px 12px;
    }
    
    .item-icon {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .item-title {
        font-size: 0.82rem;
    }
    
    .sub-item {
        padding: 10px 0;
    }
}