/* Shared surfaces keep every view consistent in both themes. */
:root{color-scheme:light;--accent:#6545de;--accent-hover:#5032bf;--focus:#7554e8;--radius:16px;--shadow:0 3px 16px #20223205}
:root[data-theme="dark"]{color-scheme:dark;--bg:#10141f;--surface:#191f2d;--surface-2:#212938;--text:#edf0f7;--muted:#a7b1c5;--line:#333d50;--primary:#b5a2ff;--primary-dark:#9b82fa;--purple-soft:#30294a;--yellow-soft:#383222;--green-soft:#203a31;--coral-soft:#42282f;--danger:#ff929c;--success:#6ad6a0;--accent:#7653df;--accent-hover:#6544ce;--focus:#c5b5ff;--shadow:0 3px 18px #00000014}
body{line-height:1.5}button,input,textarea,select{font-family:inherit}input,textarea,select{color:var(--text)}input::placeholder,textarea::placeholder{color:var(--muted)}
a:focus-visible,button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.topbar{background:var(--surface);gap:16px}.global-search{min-width:0}.search{max-width:100%}.top-actions{flex-shrink:0}.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:38px;padding:7px 11px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);color:var(--text);font-size:.75rem;font-weight:600;white-space:nowrap}.theme-toggle:hover{border-color:var(--primary)}[data-theme-icon]{font-size:1.1rem;line-height:1}.guest-theme{position:absolute;right:20px;top:18px;z-index:10}
.sidebar{background:#1c1930}.brand{padding-bottom:30px;flex-shrink:0}.main-nav{gap:6px;overflow-y:auto;min-height:0}.nav-item{min-height:43px;flex-shrink:0}.nav-item.active{background:#6545de;box-shadow:none}.sidebar-profile{padding-bottom:4px;flex-shrink:0}.primary-button{background:var(--accent);box-shadow:none;color:#fff}.primary-button:hover{background:var(--accent-hover)}.secondary-button{border:1px solid transparent;align-items:center;justify-content:center;gap:6px}.secondary-button:hover{border-color:var(--primary)}.heading-actions,.hero-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.heading-actions .secondary-button,.hero-actions .secondary-button{margin-top:0}.hero-actions{position:relative;z-index:1}.project-hero::after{pointer-events:none}.page-heading{gap:18px}.project-card h3 a:hover,.text-link:hover{color:var(--primary);text-decoration:underline;text-underline-offset:4px}.text-link{font-size:.8rem;color:var(--primary);font-weight:700;white-space:nowrap}
.home-heading{align-items:center;margin-bottom:26px}.home-heading h1{font-size:2rem;letter-spacing:-.04em;margin-top:5px}.home-heading p:not(.eyebrow){font-size:.88rem}.home-heading .heading-actions a{font-size:.8rem}.home-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:30px}.home-metric{display:flex;align-items:center;gap:13px;padding:17px;border:1px solid var(--line);border-radius:13px;background:var(--surface);transition:border-color .15s,transform .15s}.home-metric:hover{border-color:var(--primary);transform:translateY(-2px)}.metric-symbol{display:grid;place-items:center;width:39px;height:39px;flex-shrink:0;border-radius:11px;background:var(--purple-soft);color:var(--primary);font-size:1.2rem}.home-metric.yellow .metric-symbol{background:var(--yellow-soft);color:#a77800}.home-metric.green .metric-symbol{background:var(--green-soft);color:var(--success)}.home-metric.coral .metric-symbol{background:var(--coral-soft);color:var(--danger)}.home-metric>span:nth-child(2){display:flex;flex-direction:column}.home-metric strong{font-size:1.6rem;line-height:1.1;letter-spacing:-.04em}.home-metric>span:nth-child(2)>span{font-size:.73rem;color:var(--muted);margin-top:4px}.metric-arrow{margin-left:auto;color:var(--muted)}
.home-work-grid{display:grid;grid-template-columns:minmax(0,1fr) 285px;gap:25px;align-items:start;margin-bottom:28px}.home-section-heading{display:flex;justify-content:space-between;align-items:center;margin:0 0 15px;gap:12px}.home-section-heading h2{font-size:1.14rem;margin:0 0 3px;letter-spacing:-.02em}.home-section-heading p{font-size:.76rem;margin:0;color:var(--muted)}.home-project-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.home-project-card{min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:20px;box-shadow:var(--shadow)}.home-project-card:hover{border-color:color-mix(in srgb,var(--project) 50%,var(--line))}.home-project-card h3{font-size:1.02rem;line-height:1.4;margin:16px 0 4px;overflow-wrap:anywhere}.home-project-card h3 a:hover{color:var(--primary);text-decoration:underline}.home-project-card>p{font-size:.76rem;margin:0 0 21px;color:var(--muted)}.home-project-card .progress-copy{font-size:.72rem;gap:8px}.home-project-card .progress{margin-bottom:9px}.home-project-date{font-size:.69rem;color:var(--muted)}.home-project-actions{display:flex;gap:10px;align-items:center;justify-content:space-between;margin-top:17px;padding-top:15px;border-top:1px solid var(--line);flex-wrap:wrap}.home-project-actions .secondary-button{font-size:.72rem;padding:9px 11px;margin:0}.board-link{display:inline-flex;gap:5px;align-items:center;color:var(--primary);font-size:.75rem;font-weight:700;padding:8px 0}.board-link:hover{text-decoration:underline;text-underline-offset:4px}
.home-guide{padding-top:0}.kanban-launch{display:block;padding:25px;border:1px solid #63509b;border-radius:17px;color:#fff;background:linear-gradient(145deg,#302455,#473074);box-shadow:0 8px 22px #34214f10}.kanban-launch:hover{border-color:#bda3ff;box-shadow:0 8px 25px #34214f25}.kanban-launch .eyebrow{font-size:.58rem;color:#d2c1ff;letter-spacing:.1em}.kanban-launch h2{font-size:1.55rem;line-height:1.2;letter-spacing:-.035em;margin:13px 0}.kanban-launch p{font-size:.77rem;line-height:1.7;color:#ded5ed;margin:0}.kanban-mini{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:23px 0}.kanban-mini>div{background:#ffffff0c;border:1px solid #ffffff16;border-radius:7px;min-height:104px;padding:8px 6px}.kanban-mini span{font-size:.47rem;color:#e1d9f3;display:block;margin-bottom:10px}.kanban-mini i{display:block;height:15px;background:#ffffff21;border-left:2px solid #b5a0f1;border-radius:3px;margin-bottom:6px}.kanban-mini>div:nth-child(2) i{border-left-color:#f0c564}.kanban-mini>div:nth-child(3) i{border-left-color:#74d6b2}.launch-cta{display:flex;align-items:center;justify-content:space-between;font-size:.8rem;border-top:1px solid #ffffff29;padding-top:16px}.home-shortcuts{display:grid;gap:10px;margin-top:14px}.home-shortcuts>a{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px}.home-shortcuts>a:hover{border-color:var(--primary)}.home-shortcuts>a>span{font-size:1.05rem;color:var(--primary);background:var(--purple-soft);border-radius:9px;width:33px;height:33px;display:grid;place-items:center}.home-shortcuts strong,.home-shortcuts small{display:block}.home-shortcuts strong{font-size:.8rem}.home-shortcuts small{font-size:.68rem;color:var(--muted)}.home-shortcuts b{margin-left:auto;color:var(--muted);font-weight:400}
.home-bottom-grid{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:22px;align-items:start}.home-task-panel{min-width:0}.home-task-list{padding:0 20px 10px}.home-task{display:flex;gap:12px;align-items:center;border-top:1px solid var(--line);padding:16px 4px}.home-task:hover{background:var(--surface-2)}.home-task:hover .home-task-copy strong{color:var(--primary)}.home-task-dot{width:8px;height:8px;flex-shrink:0;background:var(--dot);border-radius:50%}.home-task-copy{flex:1;min-width:0}.home-task-copy strong{font-size:.8rem;display:block;overflow-wrap:anywhere}.home-task-copy small{font-size:.67rem;color:var(--muted);display:block;margin-top:3px}.home-task time{font-size:.66rem;text-align:right;max-width:90px}.task-open{color:var(--primary)}.home-activity .activity-item p{font-size:.74rem}.home-activity .activity-item time{font-size:.65rem}.home-bottom-grid .panel-heading{gap:12px}.home-bottom-grid .panel-heading p{line-height:1.5}.home-bottom-grid .panel-heading a{white-space:nowrap}
/* Existing views: explicit semantic surfaces instead of light-only fills. */
:root[data-theme="dark"] :is(.login-card,.kanban-card,.scrum-group,.scrum-task,.sprint-task-list>a,.gallery-item,.upload-card,.upload-actions,.upload-selection>span,.notification-popover,.notification-item button,.search-results,.user-kpis article,.calendar-day,.pagination a,.crop-dialog,.confirm-dialog,.day-dialog){background:var(--surface);color:var(--text);border-color:var(--line)}
:root[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea){background-color:var(--surface-2);color:var(--text);border-color:var(--line)}
:root[data-theme="dark"] :is(.guest-body,.calendar-day.outside-month,.calendar-weekdays,.user-table-head,.scrum-backlog,.kanban-column,.task-row:hover,.user-row:hover,.task-row-action.is-done,.notification-item button:hover,.search-results>a:hover,.search-results>a:focus,.gallery-thumb,.progress,.project-status,.role-badge,.avatar.more,.avatar.unassigned,.kanban-column>header b,.kanban-card-tags>span:not(.priority),.project-tabs span){background:var(--surface-2);color:var(--muted)}
:root[data-theme="dark"] :is(.sprint-card,.project-hero,.scrum-access-bar,.sprint-kanban-banner,.drop-upload,.drop-upload:hover,.gallery-file,.upload-file-icon,.upload-preview,.file-drop,.member-option:has(input:checked)){background:linear-gradient(135deg,var(--surface),var(--purple-soft));border-color:var(--line)}
:root[data-theme="dark"] :is(.project-icon,.hero-icon){background:color-mix(in srgb,var(--project) 20%,var(--surface));color:color-mix(in srgb,var(--project) 55%,#fff)}
:root[data-theme="dark"] :is(.status-todo,.sprint-status,.kanban-column>header span){background:var(--surface-2);color:var(--muted)}
:root[data-theme="dark"] :is(.status-in_progress,.role-admin,.notification-item.unread button,.column-purple>header span){background:var(--purple-soft);color:var(--primary)}
:root[data-theme="dark"] :is(.status-done,.status-project-active,.status-project-completed,.sprint-active,.notice.success,.role-member,.column-green>header span){background:var(--green-soft);color:var(--success);border-color:var(--line)}
:root[data-theme="dark"] :is(.status-review,.status-project-paused,.phase-badge,.column-yellow>header span){background:var(--yellow-soft);color:#f2d178}
:root[data-theme="dark"] :is(.priority-high,.priority-urgent,.danger-button,.project-danger-zone,.notice.error,.alert,.upload-delete button){background:var(--coral-soft);color:var(--danger);border-color:var(--line)}
:root[data-theme="dark"] .priority-medium,:root[data-theme="dark"] .home-metric.yellow .metric-symbol{color:#f2d178}
:root[data-theme="dark"] .priority-low{color:#7ed3dc}
:root[data-theme="dark"] .role-manager{background:#223850;color:#93c8ff}
:root[data-theme="dark"] :is(.note-card,.calendar-event.event-task_start,.calendar-event.event-project_start){background:var(--surface-2);color:var(--text)}
:root[data-theme="dark"] :is(.calendar-event,.agenda-event-icon,.dialog-event>span){background:color-mix(in srgb,var(--event) 18%,var(--surface));color:var(--text)}
:root[data-theme="dark"] :is(td,.kanban-card footer,.quick-check,.check-button){border-color:var(--line)}
:root[data-theme="dark"] :is(.quick-check,.check-button){background:var(--surface-2)}
:root[data-theme="dark"] :is(.quick-check.done,.completed .check-button){background:var(--success);color:#10141f}
:root[data-theme="dark"] .pagination a.active{background:var(--accent);color:#fff}
:root[data-theme="dark"] .icon-button:hover{background:var(--surface-2)}
:root[data-theme="dark"] .task-time-pill{color:var(--primary)}
:root[data-theme="dark"] .kpi-card{background:var(--surface)}
:root[data-theme="dark"] .kpi-icon{background:var(--surface-2)}
.kanban-column{border-top:3px solid #969dac}.column-purple{border-top-color:#9478ec}.column-yellow{border-top-color:#d6ac43}.column-green{border-top-color:#55b884}.kanban-card:hover{border-color:var(--primary)}.kanban-card h3{font-size:.86rem}.kanban-column>header h2{font-size:.82rem}
@media(min-width:1600px){.home-work-grid{grid-template-columns:minmax(0,1fr) 320px}}
@media(max-width:1200px){.home-work-grid{grid-template-columns:minmax(0,1fr) 245px;gap:18px}.home-project-card{padding:16px}.home-bottom-grid{grid-template-columns:1fr}.home-metric{padding:14px;gap:10px}.metric-arrow{display:none}.home-project-actions{align-items:stretch;flex-direction:column}.board-link{justify-content:center}.kanban-launch{padding:20px}.home-heading .heading-actions{justify-content:flex-end}}
@media(max-width:1000px){.home-work-grid{grid-template-columns:1fr}.home-guide{display:grid;grid-template-columns:1fr 1fr;gap:16px}.home-shortcuts{margin-top:0;align-content:start}.kanban-mini{display:none}.kanban-launch h2 br{display:none}.kanban-launch h2{font-size:1.2rem}.launch-cta{margin-top:15px}.home-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.home-project-actions{flex-direction:row;align-items:center}.top-actions [data-theme-label]{display:none}}
@media(max-width:820px){.sidebar-collapsed .main-area{margin-left:0}.home-heading h1{font-size:1.7rem}.home-heading{align-items:flex-start}.home-heading .heading-actions{max-width:190px}.topbar{gap:10px}.global-search{flex:1}.search{width:100%}.theme-toggle{width:36px;padding:6px}.guest-theme .theme-toggle{width:auto}.guest-theme [data-theme-label]{display:inline}.notification-popover{position:fixed;top:65px;right:12px;width:min(350px,calc(100vw - 24px))}}
@media(max-width:560px){.home-heading{flex-direction:column;gap:16px}.home-heading .heading-actions{max-width:none;width:100%;justify-content:flex-start}.home-heading .heading-actions a{flex:1;padding:11px}.home-project-grid{grid-template-columns:1fr}.home-work-grid{margin-bottom:20px}.home-metrics{gap:10px;margin-bottom:24px}.home-metric{padding:13px 10px;gap:9px}.metric-symbol{width:30px;height:30px;font-size:1rem}.home-metric strong{font-size:1.3rem}.home-metric>span:nth-child(2)>span{font-size:.65rem}.home-guide{grid-template-columns:1fr}.home-shortcuts{grid-template-columns:1fr 1fr;gap:10px}.home-shortcuts>a{padding:12px;gap:8px}.home-shortcuts>a>span,.home-shortcuts b{display:none}.home-task{flex-wrap:wrap;gap:8px}.home-task-copy{flex-basis:calc(100% - 24px)}.home-task>.status{margin-left:16px}.home-task time{max-width:none;margin-left:auto}.home-task-list{padding:0 15px 10px}.home-bottom-grid .panel-heading{align-items:flex-start}.home-bottom-grid .panel-heading p{max-width:220px}.home-project-actions{gap:8px}.home-project-actions .secondary-button{flex:1}.top-actions{gap:3px}.top-actions>.avatar{display:none}.page-heading,.project-hero{flex-wrap:wrap}.hero-actions{margin-top:12px}.task-heading-actions{flex-wrap:wrap}.home-section-heading h2{font-size:1.05rem}}
