:root {
  --ink: #20242a;
  --muted: #6b7280;
  --line: #e6e8eb;
  --line-strong: #d9dde1;
  --paper: #ffffff;
  --canvas: #f5f6f7;
  --sidebar: #171a1f;
  --purple: #6d5bd0;
  --purple-soft: #eeeafd;
  --green: #2f9d7e;
  --green-soft: #e7f5f0;
  --red: #d4545d;
  --red-soft: #fdebed;
  --amber: #c88529;
  --amber-soft: #fdf2df;
  --blue: #3686ff;
  --radius: 14px;
  --shadow: 0 10px 35px rgba(32,36,42,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; direction: rtl; background: var(--canvas); color: var(--ink); font-family: "Arial", "Noto Sans Hebrew", sans-serif; }
body { font-size: 14px; text-align: right; }
button, input, select, textarea { font: inherit; }
input, select, textarea { direction: rtl; text-align: right; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1fr) 250px; grid-template-areas: "workspace sidebar"; direction: ltr; }
.sidebar { grid-area: sidebar; direction: rtl; position: sticky; top: 0; height: 100vh; z-index: 20; display: flex; flex-direction: column; padding: 24px 16px 18px; color: #c8cbd0; background: var(--sidebar); }
.brand { direction: ltr; display: flex; align-items: center; gap: 10px; padding: 1px 8px 26px; color: #fff; font-weight: 800; font-size: 20px; letter-spacing: -.5px; }
.brand > span:last-child span { color: #8a78f2; }
.brand-mark { width: 29px; height: 29px; display: flex; align-items: end; gap: 3px; padding: 5px; border-radius: 8px; background: linear-gradient(145deg,#806de2,#5645b7); transform: rotate(180deg); }
.brand-mark i { width: 4px; border-radius: 4px; background: #fff; opacity: .92; }
.brand-mark i:nth-child(1) { height: 7px; }.brand-mark i:nth-child(2) { height: 13px; }.brand-mark i:nth-child(3) { height: 19px; }
.main-nav { display: grid; gap: 5px; }
.nav-item { width: 100%; min-height: 44px; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 9px; border: 0; padding: 0 12px; border-radius: 9px; background: transparent; color: #aeb2b9; text-align: right; transition: .16s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: #2a2935; box-shadow: inset -3px 0 #806ee2; }
.nav-icon { direction: ltr; font-size: 18px; text-align: center; color: #8f96a1; }
.nav-item.active .nav-icon { color: #a796ff; }
.nav-item b { min-width: 22px; height: 20px; display: grid; place-items: center; padding: 0 5px; border-radius: 10px; background: #30343b; color: #9da3ad; font-size: 11px; }
.nav-item b.attention:not(:empty) { background: #54363d; color: #ffadb5; }
.nav-section-label { margin: 25px 13px 9px; color: #6d737d; font-size: 11px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; }
.sidebar-spacer { flex: 1; }
.sidebar-tip { display: flex; align-items: flex-start; gap: 9px; padding: 11px; border: 1px solid #2d3137; border-radius: 10px; background: #1d2025; }
.sidebar-tip div { display: grid; gap: 3px; }
.sidebar-tip strong { color: #dadde1; font-size: 12px; }.sidebar-tip small { color: #7f8690; line-height: 1.4; font-size: 11px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 17px 5px 0; margin-top: 13px; border-top: 1px solid #2b2f35; }
.sidebar-user div { min-width: 0; display: grid; gap: 3px; }.sidebar-user strong { color: #e7e8eb; font-size: 12px; }.sidebar-user small { color: #747b85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.workspace { grid-area: workspace; direction: rtl; min-width: 0; }
.topbar { height: 72px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.global-search { width: min(460px,50vw); height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #f9fafb; color: #8b9199; }
.global-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.global-search kbd { padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; background: white; color: #a0a5ac; font-size: 11px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { width: 38px; height: 38px; position: relative; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: #606770; font-size: 19px; }
.icon-button:hover { background: #f5f3fc; color: var(--purple); }
.notification-button i { width: 7px; height: 7px; position: absolute; top: 7px; right: 8px; border: 1px solid #fff; border-radius: 50%; background: var(--red); }
.primary-button, .ghost-button, .soft-button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 9px; padding: 0 15px; font-weight: 700; }
.primary-button { background: var(--purple); color: #fff; box-shadow: 0 5px 14px rgba(109,91,208,.22); }.primary-button:hover { background: #5e4cc3; }
.primary-button:disabled { opacity: .6; cursor: wait; }
.ghost-button { border: 1px solid var(--line-strong); background: #fff; color: #555c65; }
.soft-button { background: var(--purple-soft); color: #5e4cc3; }
.soft-button.small, .ghost-button.small { min-height: 31px; padding: 0 10px; font-size: 12px; }
.mobile-menu { display: none; }

.view-container { max-width: 1600px; min-height: calc(100vh - 72px); margin: 0 auto; padding: 31px 34px 45px; }
.loading-state { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.spinner { width: 30px; height: 30px; border: 3px solid #e3e0f6; border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { margin: 0 0 7px; font-size: 27px; letter-spacing: -.6px; }
.page-heading p { margin: 0; color: var(--muted); line-height: 1.5; }
.heading-actions { display: flex; gap: 8px; }
.eyebrow { display: inline-block; margin-bottom: 5px; color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; margin-bottom: 26px; }
.metric-card { position: relative; overflow: hidden; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.metric-card::after { content: ""; width: 62px; height: 62px; position: absolute; right: -22px; top: -19px; border-radius: 50%; background: var(--metric-soft,var(--purple-soft)); opacity: .8; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: var(--metric-soft,var(--purple-soft)); color: var(--metric-color,var(--purple)); font-size: 15px; }
.metric-value { margin-top: 14px; font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.metric-detail { margin-top: 4px; color: var(--muted); font-size: 11px; }.metric-detail strong { color: var(--metric-color,var(--purple)); }
.section { margin-top: 26px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 17px; }.section-heading a,.link-button { border: 0; background: none; color: var(--purple); font-size: 12px; font-weight: 700; text-decoration: none; }
.project-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.project-card { padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); transition: .18s ease; cursor: pointer; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d9d3f3; }
.project-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-title-wrap { min-width: 0; display: flex; align-items: center; gap: 11px; }
.project-glyph { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--glyph-soft); color: var(--glyph-color); font-weight: 800; }
.project-card h3 { margin: 0 0 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; }.project-card .meta { color: var(--muted); font-size: 11px; }
.project-card.child-project { border-right: 3px solid #d9d3f3; }
.parent-project-label { display:inline-flex; margin-top:13px; padding:4px 8px; border-radius:7px; background:#f4f2fc; color:#6657b8; font-size:9px; font-weight:700; }
.health-dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }.health-dot.risk { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }.health-dot.watch { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.project-stats { display: flex; justify-content: space-between; margin: 21px 0 7px; color: var(--muted); font-size: 11px; }.project-stats strong { color: var(--ink); font-size: 12px; }
.progress-track { height: 7px; overflow: hidden; border-radius: 5px; background: #eceef1; }.progress-track i { height: 100%; display: block; border-radius: inherit; background: var(--purple); transition: width .3s ease; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 13px; border-top: 1px solid #f0f1f2; color: var(--muted); font-size: 11px; }
.project-card-actions { display:flex; gap:6px; margin-top:12px; }
.avatars { display: flex; direction: rtl; padding-right: 7px; }.avatar { width: 26px; height: 26px; display: grid; place-items: center; margin-right: -7px; border: 2px solid #fff; border-radius: 50%; color: #fff; font-size: 9px; font-weight: 800; }.avatar.large { width: 36px; height: 36px; margin: 0; font-size: 12px; }
.dashboard-lower { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(280px,.7fr); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 17px 19px; border-bottom: 1px solid var(--line); }.panel-heading h2,.panel-heading h3 { margin: 0; font-size: 15px; }
.data-table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: right; }.data-table th { padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fafafb; color: #8a9098; font-size: 11px; font-weight: 800; white-space: nowrap; }.data-table td { padding: 13px 16px; border-bottom: 1px solid #eef0f2; vertical-align: middle; }.data-table tr:last-child td { border-bottom: 0; }.data-table tbody tr:hover { background: #fbfbfd; }
.task-title { display: flex; align-items: center; gap: 9px; min-width: 190px; }.task-check { width: 17px; height: 17px; flex: 0 0 auto; display: grid; place-items: center; border: 1.5px solid #cdd1d6; border-radius: 5px; background: #fff; color: white; font-size: 11px; }.task-check.done { border-color: var(--green); background: var(--green); }.task-title strong { display: block; font-size: 12px; }.task-title small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }.subtask-indent { margin-right: 24px; }
.status-pill,.priority-pill,.category-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 12px; padding: 4px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }.status-pill::before { content:""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }.status-todo,.status-not_started,.status-inbox { color: #777f89; background: #f0f1f3; }.status-in_progress { color: #3477d0; background: #eaf2ff; }.status-done,.status-completed { color: #278468; background: var(--green-soft); }.status-blocked,.status-overdue { color: #c24450; background: var(--red-soft); }.priority-critical { color: #c24450; background: var(--red-soft); }.priority-high { color: #b46d11; background: var(--amber-soft); }.priority-medium { color: #5e4cc3; background: var(--purple-soft); }.priority-low { color: #68717b; background: #f0f1f3; }
.overdue-text { color: var(--red) !important; font-weight: 700; }
.date-cell { white-space: nowrap; color: #5f6670; font-size: 11px; }.date-cell small { display: block; margin-top: 2px; color: #a1a6ad; }
.inline-select { max-width: 118px; border: 1px solid transparent; border-radius: 7px; padding: 5px 6px; background: #f5f6f8; color: #4e555e; font-size: 11px; outline: none; }
.activity-list { padding: 7px 18px 15px; }.activity-item { position: relative; display: grid; grid-template-columns: 27px 1fr; gap: 9px; padding: 11px 0; }.activity-item:not(:last-child)::after { content:""; position:absolute; top:38px; bottom:-8px; right:13px; width:1px; background:#e8eaed; }.activity-dot { width: 27px; height: 27px; z-index:1; display:grid; place-items:center; border-radius:50%; background:var(--purple-soft); color:var(--purple); font-size:11px; }.activity-item p { margin:0; color:#575e66; line-height:1.45; font-size:11px; }.activity-item time { display:block; margin-top:3px; color:#a1a6ad; font-size:9px; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }.toolbar select,.toolbar input { height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; background:#fff; color:#555c65; outline:none; font-size:11px; }.toolbar input { min-width: 220px; }.toolbar .spacer { flex:1; }.result-count { color:var(--muted); font-size:11px; }
.portfolio-table .progress-cell { min-width:140px; }.progress-inline { display:grid; grid-template-columns:1fr 32px; align-items:center; gap:8px; font-size:11px; font-weight:700; }
.project-tree-title { padding-right:calc(var(--project-depth, 0) * 24px); }
.project-tree-title::before { content:""; width:calc(var(--project-depth, 0) * 12px); height:1px; flex:0 0 auto; background:#d8dbe0; }
.calendar-shell { border:1px solid var(--line); border-radius:var(--radius); background:#fff; overflow:hidden; }.calendar-toolbar { display:flex; align-items:center; justify-content:space-between; padding:14px 17px; border-bottom:1px solid var(--line); }.calendar-toolbar h2 { margin:0; font-size:16px; }.calendar-actions { display:flex; gap:6px; }.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(100px,1fr)); }.calendar-weekday { padding:9px; border-left:1px solid var(--line); border-bottom:1px solid var(--line); background:#fafafb; color:#888f98; text-align:center; font-size:11px; font-weight:800; }.calendar-day { min-height:117px; padding:8px; border-left:1px solid var(--line); border-bottom:1px solid var(--line); background:#fff; }.calendar-day:nth-child(7n) { border-left:0; }.calendar-day.outside { background:#fafafa; color:#b7bbc0; }.calendar-day.today { box-shadow:inset 0 0 0 2px #8b79e8; }.day-number { width:23px; height:23px; display:grid; place-items:center; margin-bottom:5px; border-radius:50%; font-size:11px; font-weight:700; }.today .day-number { background:var(--purple); color:#fff; }.calendar-event { display:block; width:100%; overflow:hidden; margin:3px 0; padding:4px 6px; border:0; border-radius:5px; background:var(--purple-soft); color:#5848b0; text-align:right; text-overflow:ellipsis; white-space:nowrap; font-size:9px; }.calendar-event.milestone { background:var(--amber-soft); color:#a76c1f; }.calendar-event.project { background:var(--green-soft); color:#277a62; }.calendar-event.overdue { box-shadow:inset -3px 0 var(--red); }
.milestone-groups { display:grid; gap:18px; }.milestone-group h2 { margin:0 0 10px; font-size:16px; }.milestone-row { display:grid; grid-template-columns:46px minmax(190px,1.2fr) minmax(150px,.9fr) minmax(130px,.8fr) 110px; align-items:center; gap:13px; min-height:84px; padding:13px 17px; border:1px solid var(--line); border-bottom:0; background:#fff; }.milestone-row:first-of-type { border-radius:var(--radius) var(--radius) 0 0; }.milestone-row:last-child { border-bottom:1px solid var(--line); border-radius:0 0 var(--radius) var(--radius); }.milestone-symbol { width:35px; height:35px; display:grid; place-items:center; border-radius:50%; background:var(--amber-soft); color:var(--amber); font-weight:800; }.milestone-main h3 { margin:0 0 6px; font-size:13px; }.milestone-main small { color:var(--muted); }.dependency-list { display:flex; flex-wrap:wrap; gap:4px; }.dependency-chip { padding:4px 7px; border-radius:6px; background:#f1f2f4; color:#67707a; font-size:9px; }.dependency-chip.blocker { color:#bd4651; background:var(--red-soft); }
.team-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:15px; }.team-card { padding:19px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; }.team-card-head { display:flex; align-items:center; gap:10px; }.team-card h3 { margin:0 0 4px; font-size:14px; }.team-card small { color:var(--muted); font-size:11px; }.team-numbers { display:grid; grid-template-columns:repeat(3,1fr); margin-top:17px; padding-top:14px; border-top:1px solid var(--line); }.team-numbers div { text-align:center; }.team-numbers div:not(:last-child) { border-left:1px solid var(--line); }.team-numbers b { display:block; font-size:17px; }.team-numbers span { color:var(--muted); font-size:9px; }
.integration-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }.integration-card { display:grid; grid-template-columns:44px 1fr auto; align-items:center; gap:13px; padding:19px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; }.integration-logo { width:42px; height:42px; display:grid; place-items:center; border-radius:12px; background:var(--logo-bg); color:#fff; font-size:18px; font-weight:800; }.integration-card h3 { margin:0 0 5px; font-size:14px; }.integration-card p { margin:0; color:var(--muted); line-height:1.45; font-size:11px; }.connection-state { color:var(--muted); font-size:11px; }.connection-state::before { content:""; width:7px; height:7px; display:inline-block; margin-left:5px; border-radius:50%; background:#abb0b7; }.connection-state.active::before { background:var(--green); }
.empty-state { padding:55px 20px; text-align:center; color:var(--muted); }.empty-state .empty-icon { width:48px; height:48px; display:grid; place-items:center; margin:0 auto 13px; border-radius:14px; background:var(--purple-soft); color:var(--purple); font-size:22px; }.empty-state h3 { margin:0 0 6px; color:var(--ink); }.empty-state p { max-width:420px; margin:0 auto 16px; line-height:1.6; }
.duplicate-card { display:grid; grid-template-columns:1fr 42px 1fr auto; align-items:center; gap:14px; padding:16px; border:1px solid var(--line); border-radius:12px; background:#fff; }.duplicate-side { padding:12px; border-radius:9px; background:#f8f9fa; }.duplicate-side strong { display:block; margin-bottom:5px; font-size:12px; }.duplicate-side small { color:var(--muted); }.duplicate-score { width:42px; height:42px; display:grid; place-items:center; border-radius:50%; background:var(--amber-soft); color:var(--amber); font-size:11px; font-weight:800; }.duplicate-actions { display:flex; gap:6px; }

.modal-backdrop { position:fixed; inset:0; z-index:100; display:grid; place-items:center; padding:20px; background:rgba(20,23,27,.58); backdrop-filter:blur(3px); }.modal { width:min(670px,100%); max-height:92vh; overflow:auto; border-radius:17px; background:#fff; box-shadow:0 25px 80px rgba(0,0,0,.25); }.modal-header { display:flex; align-items:flex-start; justify-content:space-between; padding:22px 24px 17px; border-bottom:1px solid var(--line); }.modal-header h2 { margin:0; font-size:20px; }.modal form { display:grid; grid-template-columns:1fr 1fr; gap:15px; padding:21px 24px 24px; }.field { display:grid; gap:7px; }.field-wide { grid-column:1/-1; }.field > span { color:#5e646c; font-size:11px; font-weight:700; }.field input,.field select,.field textarea { width:100%; border:1px solid var(--line-strong); border-radius:8px; padding:10px 11px; outline:none; color:var(--ink); background:#fff; }.field input:focus,.field select:focus,.field textarea:focus { border-color:#9384e6; box-shadow:0 0 0 3px #f0edff; }.field textarea { resize:vertical; }.assignee-picker { display:flex; flex-wrap:wrap; gap:7px; }.assignee-option input { position:absolute; opacity:0; }.assignee-option span { display:inline-flex; align-items:center; gap:6px; padding:6px 9px; border:1px solid var(--line); border-radius:20px; color:#626972; cursor:pointer; font-size:11px; }.assignee-option input:checked + span { border-color:#9c8ce9; background:var(--purple-soft); color:#5948b6; }.assignee-option i { width:17px; height:17px; display:grid; place-items:center; border-radius:50%; color:#fff; font-style:normal; font-size:7px; }.modal-footer { grid-column:1/-1; display:flex; justify-content:flex-end; gap:8px; padding-top:7px; }
.toast { position:fixed; z-index:200; bottom:24px; right:24px; min-width:240px; max-width:400px; padding:13px 16px; border-radius:10px; background:#22262c; color:#fff; box-shadow:var(--shadow); font-size:12px; text-align:right; }.toast.error { background:#a83843; }
.notification-panel { width:340px; max-height:430px; overflow:auto; position:fixed; z-index:60; top:65px; left:92px; border:1px solid var(--line); border-radius:13px; background:#fff; box-shadow:var(--shadow); }.notification-panel h3 { margin:0; padding:15px 17px; border-bottom:1px solid var(--line); font-size:14px; }.notification-item { padding:12px 17px; border-bottom:1px solid #eff0f2; }.notification-item strong { display:block; margin-bottom:4px; font-size:11px; }.notification-item small { color:var(--muted); font-size:9px; }

@media (max-width:1100px) {
  .project-grid,.team-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-lower { grid-template-columns:1fr; }
  .milestone-row { grid-template-columns:42px 1.2fr 1fr 100px; }.milestone-row > :nth-child(4) { display:none; }
}
@media (max-width:780px) {
  .app-shell { display:block; }.sidebar { position:fixed; right:0; left:auto; transform:translateX(105%); width:250px; transition:.2s ease; box-shadow:-15px 0 40px rgba(0,0,0,.2); }.sidebar.open { transform:translateX(0); }
  .mobile-menu { display:grid; }.topbar { padding:0 15px; gap:8px; }.global-search { flex:1; width:auto; }.global-search kbd { display:none; }.top-actions .primary-button { width:39px; padding:0; font-size:0; }.top-actions .primary-button span { font-size:18px; }
  .view-container { padding:23px 15px 35px; }.page-heading { align-items:flex-start; flex-direction:column; }.metric-grid,.project-grid,.team-grid,.integration-grid { grid-template-columns:1fr; }
  .calendar-grid { overflow-x:auto; grid-template-columns:repeat(7,105px); }.calendar-shell { overflow-x:auto; }.calendar-day { min-height:100px; }
  .milestone-row { grid-template-columns:38px 1fr 90px; }.milestone-row > :nth-child(3),.milestone-row > :nth-child(4) { display:none; }
  .duplicate-card { grid-template-columns:1fr; }.duplicate-score { display:none; }.modal form { grid-template-columns:1fr; }.field-wide { grid-column:auto; }.modal-footer { grid-column:auto; }
  .notification-panel { left:15px; right:15px; width:auto; }
}
@media (max-width:480px) { .metric-grid { grid-template-columns:1fr 1fr; gap:9px; }.metric-card { padding:14px; }.metric-value { font-size:24px; }.page-heading h1 { font-size:23px; } }

/* --------------------------------------------------------------------------
   Accessibility, focus and new components (v3.1)
   -------------------------------------------------------------------------- */

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.modal-open { overflow: hidden; }

/* Every interactive control keeps a visible focus ring: several of them reset
   the UA outline and previously left keyboard users with no indicator. */
:focus-visible { outline: 2px solid #5948b6; outline-offset: 2px; border-radius: 6px; }
.global-search:focus-within { border-color: #9384e6; box-shadow: 0 0 0 3px #f0edff; }
.global-search input:focus-visible { outline: none; }
.toolbar input:focus-visible, .toolbar select:focus-visible, .inline-select:focus-visible,
#user-switcher:focus-visible, .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: 2px solid #5948b6; outline-offset: 1px;
}
.nav-item:focus-visible { outline: 2px solid #a796ff; outline-offset: -2px; }

#user-switcher { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: #9aa1ac; }
#user-switcher:hover { background: rgba(255,255,255,.08); }

.link-title { max-width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: inherit; text-align: right; }
.link-title:hover { color: var(--purple); text-decoration: underline; }
.blocked-hint { color: var(--amber); font-weight: 700; }
.has-note { color: var(--purple); }
.row-actions { display: flex; align-items: center; gap: 6px; }
.icon-button.small { width: 30px; height: 30px; font-size: 13px; }

.notice { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 11px 14px; border: 1px solid #e5ddc2; border-radius: 10px; background: #fdf8e7; color: #6f5b23; font-size: 12px; line-height: 1.5; }
.form-hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.prose { padding: 20px; line-height: 1.8; color: var(--muted); }
.prose strong { color: var(--ink); }
.modal.narrow { width: min(430px, 100%); }

.task-meta { padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px 14px; margin-top: 8px; color: #4f565f; font-size: 11px; }
.meta-grid .wide { grid-column: 1/-1; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.meta-grid b { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }

.members-editor { display: grid; gap: 9px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.members-list { display: grid; gap: 7px; }
.member-row { display: grid; grid-template-columns: 28px minmax(0,1fr) auto auto; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.member-row div { min-width: 0; display: grid; }
.member-row strong { font-size: 12px; }
.member-row small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-add { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding-top: 3px; }
.member-add select { height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: #fff; color: #555c65; font-size: 12px; }

.milestone-row { grid-template-columns: 46px minmax(180px,1.1fr) minmax(140px,.85fr) minmax(120px,.75fr) minmax(150px,auto); }
.milestone-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.team-projects { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }

.duplicate-tag { display: inline-block; margin-bottom: 5px; padding: 2px 7px; border-radius: 20px; background: var(--green-soft); color: #256b57; font-size: 11px; font-weight: 700; }
.duplicate-tag.warn { background: var(--amber-soft); color: #8a5c14; }
.duplicate-side.keep { border-color: #cfe8de; }
.duplicate-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.calendar-more { width: 100%; margin-top: 2px; padding: 2px 4px; border: 0; border-radius: 5px; background: transparent; color: var(--purple); font-size: 11px; font-weight: 700; text-align: right; }
.calendar-more:hover { background: var(--purple-soft); }
.notification-panel .panel-heading { padding: 13px 15px; }

@media (max-width: 1100px) {
  .milestone-row { grid-template-columns: 42px 1.1fr 1fr minmax(150px,auto); }
}
@media (max-width: 780px) {
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 19; display: block; border: 0; padding: 0; background: rgba(20,23,27,.45); }
  .milestone-row { grid-template-columns: 38px 1fr minmax(130px,auto); }
  .meta-grid { grid-template-columns: 1fr; }
  .member-row { grid-template-columns: 28px minmax(0,1fr); grid-template-areas: "avatar name" "role remove"; }
  .notice { font-size: 12px; }
}
@media (min-width: 781px) { .sidebar-backdrop { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

.calendar-note { display: block; padding: 2px 4px; color: var(--muted); font-size: 11px; }

/* The mobile drawer used to sit off-canvas via transform: translateX(105%).
   A fixed element parked outside the viewport still expands the document's
   scrollable width, so the whole app opened horizontally scrolled on a phone
   (375px viewport, 668px document). Taking it out of flow when closed removes
   the overflow at the source; the fade keeps the drawer from snapping open. */
@media (max-width: 780px) {
  .sidebar { display: none; position: fixed; top: 0; right: 0; left: auto; width: 250px; height: 100vh; transform: none; box-shadow: -15px 0 40px rgba(0,0,0,.2); }
  .sidebar.open { display: flex; animation: drawer-fade .18s ease-out; }
}
@keyframes drawer-fade { from { opacity: 0; } to { opacity: 1; } }

/* A grid item defaults to min-width:auto, so the intrinsic width of a wide
   table stretched the dashboard track and pushed the whole page sideways on
   mobile. The wrapper already scrolls on its own — the track must be allowed
   to shrink below the table's width. */
.panel, .dashboard-lower > *, .section > * { min-width: 0; }
.data-table-wrap { max-width: 100%; }
@media (max-width: 780px) { .dashboard-lower { grid-template-columns: minmax(0, 1fr); } }

/* In RTL, Blink lets content that overflows to the inline-start side of a
   scroll container leak into the document's scrollable width: the 899px task
   table scrolled correctly inside its 343px wrapper, yet still made the page
   869px wide on a 375px phone. Paint containment keeps the overflow inside. */
.data-table-wrap, .calendar-shell, .calendar-grid { contain: paint; }

/* Notification centre: an inbox, not a list of things that never happened. */
.notification-button i { min-width: 16px; height: 16px; top: 4px; right: 4px; display: grid; place-items: center; padding: 0 3px; border-radius: 9px; color: #fff; font-size: 10px; font-style: normal; font-weight: 800; line-height: 1; }
.notification-panel { display: flex; flex-direction: column; max-height: 70vh; }
.notification-body { flex: 1; overflow-y: auto; padding: 6px 0; }
.notification-section { padding: 4px 0; }
.notification-section h4 { margin: 0; padding: 9px 15px 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .4px; }
.notification-item { width: 100%; display: grid; gap: 3px; padding: 9px 15px; border: 0; border-inline-start: 3px solid transparent; background: transparent; text-align: right; }
.notification-item:hover { background: #f7f6fd; }
.notification-item strong { font-size: 12px; }
.notification-item small { color: var(--muted); font-size: 11px; }
.notification-item.inbox { border-inline-start-color: var(--green); }
.notification-item.inbox.unread { background: #f4f2fe; border-inline-start-color: var(--purple); }
.notification-item.inbox.unread strong::after { content: "●"; margin-inline-start: 5px; color: var(--purple); font-size: 9px; vertical-align: middle; }
.notification-item.scheduled { border-inline-start-color: var(--line-strong); }
.notification-item.failed { border-inline-start-color: var(--red); }
.notification-error { color: var(--red) !important; }
.notification-empty { margin: 0; padding: 3px 15px 9px; color: var(--muted); font-size: 11px; }
.notification-foot { padding: 9px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.channel-picker .assignee-option.disabled span { border-style: dashed; color: #9aa1ac; cursor: not-allowed; }
.channel-status { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.prose code { padding: 1px 5px; border-radius: 5px; background: #f1f0f8; color: #5948b6; font-size: 11px; }
.prose p { margin: 0 0 9px; }

/* Sign-in screen */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0%, #26232f, #171a1f 60%); }
.auth-card { width: min(400px, 100%); display: grid; gap: 14px; padding: 30px 28px; border-radius: 18px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.auth-card .brand { justify-content: center; padding: 0 0 4px; color: var(--ink); }
.auth-card .brand > span:last-child span { color: var(--purple); }
.auth-card h1 { margin: 0; font-size: 21px; text-align: center; }
.auth-card #auth-subtitle { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.auth-form { display: grid; gap: 13px; }
.auth-form .primary-button { width: 100%; }
.auth-divider { display: block; margin: 4px 0; color: var(--muted); font-size: 11px; text-align: center; }
.auth-provider { width: 100%; }
.auth-error { margin: 0; padding: 9px 11px; border: 1px solid #f3c9cd; border-radius: 9px; background: var(--red-soft); color: #97323b; font-size: 12px; }
.sidebar-user form { display: contents; }
.sidebar-signout { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #9aa1ac; font-size: 14px; }
.sidebar-signout:hover { background: rgba(255,255,255,.09); color: #fff; }
.temp-password { display: grid; gap: 5px; margin-top: 10px; padding: 11px 13px; border: 1px dashed #cbbdf5; border-radius: 10px; background: var(--purple-soft); }
.temp-password code { direction: ltr; display: block; padding: 6px 8px; border-radius: 7px; background: #fff; color: #4b3aa8; font-size: 14px; font-weight: 800; letter-spacing: .5px; text-align: center; }
