/* Medd Tasks — مهام مد */
@font-face { font-family: "Harir"; src: url("fonts/Harir-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Harir"; src: url("fonts/Harir-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --maroon: #7C2629; --maroon-d: #5E1C1F; --maroon-l: #F3E4E2;
  --green: #1C4220; --cream: #FEFCF3; --beige: #E6DABF; --beige-l: #F3ECDC;
  --brown: #3F2021; --ink: #2B1D1D; --muted: #7A6A62; --line: #EADFCB; --line-2: #F1E9DA;
  --card: #FFFFFF; --hover: #FBF6EA;
  --s-not_started: #A9A39A; --s-working: #F2A93B; --s-stuck: #D9534F; --s-approval: #8E5BB5; --s-done: #2E8B57; --s-on_hold: #C9B48A;
  --p-low: #8FB3D9; --p-medium: #5C7FB0; --p-high: #E07A1F; --p-urgent: #B3261E;
  --radius: 14px; --radius-s: 9px;
  --shadow: 0 1px 2px rgba(63,32,33,.06), 0 4px 16px rgba(63,32,33,.06);
  --shadow-l: 0 12px 40px rgba(63,32,33,.18);
  --font-ar: "Harir", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-en: "Inter", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-head-en: "Playfair Display", Georgia, serif;
  --top: 58px; --side: 264px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--cream); color: var(--ink); font-family: var(--font-ar); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
html[lang="en"] body { font-family: var(--font-en); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
input, select, textarea { outline: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mark { display: inline-block; background: currentColor; -webkit-mask: url("assets/mark-white.png") center/contain no-repeat; mask: url("assets/mark-white.png") center/contain no-repeat; aspect-ratio: 114/160; }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; font-weight: 600; transition: background .15s, transform .05s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--maroon); color: #fff; box-shadow: 0 2px 6px rgba(124,38,41,.25); }
.btn-primary:hover { background: var(--maroon-d); }
.btn-ghost { color: var(--brown); }
.btn-ghost:hover { background: var(--beige-l); }
.btn-line { border: 1px solid var(--line); background: #fff; color: var(--brown); }
.btn-line:hover { background: var(--hover); }
.btn-danger { color: #B3261E; }
.btn-danger:hover { background: #FBE9E7; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--beige-l); color: var(--brown); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--maroon); box-shadow: 0 0 0 3px rgba(124,38,41,.12); }
svg { flex-shrink: 0; }
.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-s { width: 15px; height: 15px; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ---------- Login ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { background: radial-gradient(120% 90% at 85% 10%, #93393C 0%, var(--maroon) 45%, #4D1517 100%); color: var(--cream); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .mark { width: 120px; color: var(--cream); }
.login-art h1 { font-size: 44px; line-height: 1.15; margin: 0 0 12px; font-weight: 700; }
html[lang="en"] .login-art h1 { font-family: var(--font-head-en); }
.login-art p { opacity: .82; max-width: 380px; margin: 0; font-size: 16px; }
.login-art .big { position: absolute; inset-inline-end: -60px; bottom: -40px; width: 340px; color: rgba(254,252,243,.06); }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { margin: 0 0 4px; font-size: 26px; }
.login-card .sub { color: var(--muted); margin: 0 0 28px; }
.login-card .btn-primary { width: 100%; height: 44px; justify-content: center; font-size: 15px; }
.login-err { color: #B3261E; font-size: 13px; min-height: 20px; margin-bottom: 8px; }
.demo-pick { margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--line); }
.demo-pick .lbl { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.demo-users { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-user { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-size: 13px; }
[dir="rtl"] .demo-user { padding: 4px 4px 4px 12px; }
.demo-user:hover { border-color: var(--maroon); background: var(--maroon-l); }
.login-lang { position: absolute; top: 18px; inset-inline-end: 18px; }

/* ---------- Shell ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top); background: var(--maroon); color: var(--cream); display: flex; align-items: center; gap: 12px; padding: 0 16px; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand .mark { width: 22px; color: var(--cream); }
.brand small { font-weight: 400; opacity: .7; font-size: 12px; }
.topbar .grow { flex: 1; }
.topbar .icon-btn { color: rgba(254,252,243,.85); }
.topbar .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.lang-btn { height: 30px; min-width: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(254,252,243,.35); color: var(--cream); font-weight: 700; font-size: 13px; }
.lang-btn:hover { background: rgba(255,255,255,.12); }
.me-btn { display: flex; align-items: center; gap: 8px; padding: 3px; border-radius: 99px; color: var(--cream); }
.me-btn:hover { background: rgba(255,255,255,.12); }
.me-btn .av { box-shadow: 0 0 0 2px rgba(254,252,243,.6); }
.demo-banner { white-space: nowrap; padding: 0 12px; position: fixed; top: var(--top); inset-inline: 0; height: 30px; background: var(--beige); color: var(--brown); font-size: 12.5px; display: flex; align-items: center; justify-content: center; gap: 10px; z-index: 39; }
.demo-banner .txt { overflow: hidden; text-overflow: ellipsis; }
.demo-banner button { text-decoration: underline; font-weight: 600; }
body.has-banner { --top-total: calc(var(--top) + 30px); }
body:not(.has-banner) { --top-total: var(--top); }
.menu-toggle { display: none; }

.sidebar { position: fixed; top: var(--top-total); bottom: 0; inset-inline-start: 0; width: var(--side); background: #FBF7EC; border-inline-end: 1px solid var(--line); overflow-y: auto; padding: 14px 10px 24px; z-index: 30; }
.side-sec { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; padding: 14px 10px 6px; display: flex; align-items: center; justify-content: space-between; }
html[lang="en"] .side-sec { text-transform: uppercase; }
.side-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--brown); text-align: start; font-weight: 500; }
.side-item:hover { background: var(--beige-l); }
.side-item.active { background: #fff; box-shadow: var(--shadow); color: var(--maroon); font-weight: 700; }
.side-item .dot { width: 10px; height: 10px; border-radius: 3px; }
.side-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .count { font-size: 11.5px; color: var(--muted); background: var(--beige-l); border-radius: 99px; padding: 0 7px; min-width: 22px; text-align: center; font-weight: 600; }
.side-item.active .count { background: var(--maroon-l); color: var(--maroon); }
.side-item .lock { color: var(--muted); }
.side-dept { font-size: 12px; color: var(--muted); padding: 10px 10px 2px; }
.side-soon { opacity: .55; cursor: default; }
.side-soon:hover { background: none; }
.soon-tag { font-size: 10.5px; background: var(--beige); color: var(--brown); padding: 1px 7px; border-radius: 99px; font-weight: 600; }

.main { margin-inline-start: var(--side); padding: calc(var(--top-total) + 22px) 28px 60px; min-height: 100%; }
.scrim { display: none; }

/* ---------- Board header ---------- */
.board-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.board-title { flex: 1; min-width: 240px; }
.board-title h1 { margin: 0; font-size: 28px; line-height: 1.2; display: flex; align-items: center; gap: 10px; }
html[lang="en"] .board-title h1 { font-family: var(--font-head-en); }
.board-title .meta { color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.pill-private { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; background: var(--beige-l); color: var(--brown); padding: 2px 9px; border-radius: 99px; font-weight: 600; }
.board-actions { display: flex; gap: 8px; align-items: center; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs { display: inline-flex; background: var(--beige-l); padding: 3px; border-radius: 11px; gap: 2px; }
.tab { height: 32px; padding: 0 14px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.tab.active { background: #fff; color: var(--maroon); box-shadow: var(--shadow); }
.tab.soon { cursor: default; opacity: .6; }
.search { position: relative; }
.search input { height: 34px; border: 1px solid var(--line); border-radius: 9px; padding-inline: 34px 12px; background: #fff; width: 210px; }
.search input:focus { border-color: var(--maroon); }
.search .ic { position: absolute; inset-inline-start: 10px; top: 8px; color: var(--muted); }
.chip-btn { height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; gap: 6px; color: var(--brown); font-weight: 500; }
.chip-btn:hover { background: var(--hover); }
.chip-btn.on { border-color: var(--maroon); background: var(--maroon-l); color: var(--maroon); font-weight: 600; }
.toolbar .grow { flex: 1; }

/* ---------- Avatars ---------- */
.av { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11.5px; font-weight: 700; flex-shrink: 0; letter-spacing: -.02em; }
.av-s { width: 24px; height: 24px; font-size: 10px; }
.av-l { width: 36px; height: 36px; font-size: 13px; }
.avs { display: inline-flex; align-items: center; }
.avs .av { box-shadow: 0 0 0 2px #fff; }
.avs .av + .av { margin-inline-start: -6px; }
.av-more { background: var(--beige); color: var(--brown); }
.av-empty { width: 24px; height: 24px; border-radius: 50%; border: 1.5px dashed #CDBFA6; display: inline-grid; place-items: center; color: #B9AA90; }

/* ---------- Table (board) ---------- */
.group { margin-bottom: 30px; --pc: var(--maroon); }
.group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.group-head .chev { color: var(--pc); transition: transform .2s; }
.group.collapsed .group-head .chev { transform: rotate(90deg); }
[dir="rtl"] .group.collapsed .group-head .chev { transform: rotate(-90deg); }
.group-name { font-size: 17px; font-weight: 700; color: var(--pc); border-radius: 6px; padding: 1px 4px; }
.group-name[contenteditable="true"] { outline: 2px solid var(--pc); background: #fff; }
.group-count { color: var(--muted); font-size: 12.5px; }
.proj-status { font-size: 11.5px; padding: 1px 8px; border-radius: 99px; font-weight: 600; }
.proj-status.on_hold { background: #F4EBD6; color: #8A6D2E; }
.proj-status.done { background: #E3F1E8; color: var(--s-done); }
.group-head .icon-btn { opacity: 0; transition: opacity .15s; }
.group-head:hover .icon-btn, .group-head .icon-btn:focus { opacity: 1; }

.tbl { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; overflow-y: visible; }
.tbl-inner { min-width: 900px; }
.row { display: grid; grid-template-columns: 6px minmax(280px, 1fr) 120px 150px 120px 190px 140px; align-items: stretch; border-bottom: 1px solid var(--line-2); min-height: 42px; }
.row > div { display: flex; align-items: center; min-width: 0; }
.row > .c { justify-content: center; border-inline-start: 1px solid var(--line-2); padding: 4px 6px; }
.row.head { min-height: 36px; font-size: 12.5px; color: var(--muted); font-weight: 600; background: #FDFBF5; }
.row.head > .c, .row.head > .t { justify-content: center; }
.row.head > .t { justify-content: flex-start; padding-inline-start: 16px; }
.strip { background: var(--pc); }
.row.head .strip { border-start-start-radius: var(--radius); }
.row.task:hover { background: var(--hover); }
.row.task.sub { background: #FCFAF4; }
.row.task.sub:hover { background: var(--hover); }
.row.task.sub .strip { opacity: .45; }
.t { padding-inline: 10px 8px; gap: 6px; position: sticky; inset-inline-start: 0; }
.t .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text; padding: 4px 6px; border-radius: 6px; border: 1px solid transparent; }
.t .title:hover { border-color: var(--line); }
.t input.title-edit { flex: 1; height: 30px; border: 1px solid var(--maroon); border-radius: 6px; padding: 0 6px; background: #fff; }
.m-meta { display: none; }
.t .sub-ind { width: 22px; flex-shrink: 0; }
.row.sub .t { padding-inline-start: 30px; }
.sub-toggle { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); padding: 2px 6px; border-radius: 6px; background: var(--beige-l); }
.sub-toggle:hover { color: var(--brown); background: var(--beige); }
.sub-toggle .chev { transition: transform .2s; }
.sub-toggle.open .chev { transform: rotate(90deg); }
[dir="rtl"] .sub-toggle.open .chev { transform: rotate(-90deg); }
.open-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); padding: 3px 8px; border-radius: 6px; opacity: 0; }
.row.task:hover .open-btn { opacity: 1; }
.open-btn:hover { background: #fff; color: var(--maroon); box-shadow: var(--shadow); }
.check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #CDBFA6; display: inline-grid; place-items: center; background: #fff; flex-shrink: 0; }
.check.on { background: var(--s-done); border-color: var(--s-done); color: #fff; }

.cell-btn { width: 100%; height: 100%; min-height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.cell-btn:hover { background: rgba(63,32,33,.04); }
.status { width: 100%; height: 34px; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px; border-radius: 6px; transition: filter .15s, transform .15s; position: relative; overflow: hidden; }
.status:hover { filter: brightness(1.06); }
.status.s-not_started { background: var(--s-not_started); } .status.s-working { background: var(--s-working); }
.status.s-stuck { background: var(--s-stuck); } .status.s-approval { background: var(--s-approval); }
.status.s-done { background: var(--s-done); } .status.s-on_hold { background: var(--s-on_hold); color: #4A3B1E; }
.status.flash { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.prio { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; padding: 4px 10px; border-radius: 99px; }
.prio .bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.prio .bars i { width: 3px; border-radius: 1px; background: currentColor; opacity: .25; }
.prio .bars i:nth-child(1) { height: 5px; } .prio .bars i:nth-child(2) { height: 8px; } .prio .bars i:nth-child(3) { height: 12px; }
.prio.p-low { color: #4E7BAA; background: #EAF1F9; } .prio.p-low .bars i:nth-child(1) { opacity: 1; }
.prio.p-medium { color: #3E5F8F; background: #E6ECF5; } .prio.p-medium .bars i:nth-child(-n+2) { opacity: 1; }
.prio.p-high { color: #B65E10; background: #FCEEDF; } .prio.p-high .bars i { opacity: 1; }
.prio.p-urgent { color: #fff; background: var(--p-urgent); } .prio.p-urgent .bars i { opacity: 1; }

.tl { position: relative; width: 100%; max-width: 172px; height: 26px; border-radius: 99px; background: #5A4A45; overflow: hidden; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; }
.tl .fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--pc); }
.tl .lbl { position: relative; padding: 0 10px; white-space: nowrap; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.tl.late { background: #8E3B37; }
.tl.late .fill { background: var(--s-stuck); }
.tl.done .fill { background: var(--s-done); }
.tl.empty { background: transparent; border: 1.5px dashed #DCCFB6; color: #B9AA90; font-weight: 500; }
.tl.empty .lbl { text-shadow: none; }
.row.task:hover .tl.empty { border-color: var(--pc); color: var(--pc); }
.due { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.due.late { color: #B3261E; }
.due.today { color: #B65E10; }
.due.ok { color: var(--muted); font-weight: 500; }
.due.done { color: var(--s-done); }
.slip { margin-inline-start: 5px; font-size: 10.5px; background: #FBE9E7; color: #B3261E; border-radius: 99px; padding: 0 6px; font-weight: 700; direction: ltr; }

.row.add { min-height: 40px; }
.row.add .t input { flex: 1; height: 30px; border: 1px solid transparent; border-radius: 6px; padding: 0 8px; background: transparent; }
.row.add .t input:hover { border-color: var(--line); }
.row.add .t input:focus { border-color: var(--pc); background: #fff; }
.row.add .strip { opacity: .35; }
.row.foot { min-height: 40px; border-bottom: 0; }
.row.foot .strip { border-end-start-radius: var(--radius); opacity: 0; }
.battery { width: 100%; max-width: 128px; height: 22px; border-radius: 5px; overflow: hidden; display: flex; background: #EFE7D7; }
.battery i { height: 100%; transition: width .3s; }
.foot-range { font-size: 11.5px; color: var(--muted); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: start; }
.kcol { background: #F7F1E4; border-radius: var(--radius); padding: 10px; min-height: 200px; transition: background .15s, box-shadow .15s; }
.kcol.drop { background: var(--maroon-l); box-shadow: inset 0 0 0 2px var(--maroon); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; font-weight: 700; }
.kcol-head .sw { width: 12px; height: 12px; border-radius: 4px; }
.kcol-head .n { color: var(--muted); font-weight: 600; font-size: 12.5px; background: #fff; border-radius: 99px; padding: 0 8px; }
.kcard { background: #fff; border-radius: 11px; padding: 11px 12px 10px; box-shadow: var(--shadow); margin-bottom: 9px; cursor: grab; border-inline-start: 4px solid var(--pc); transition: transform .12s, box-shadow .12s; }
.kcard:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(63,32,33,.08), 0 10px 24px rgba(63,32,33,.1); }
.kcard.dragging { opacity: .45; }
.kcard .proj { font-size: 11.5px; color: var(--pc); font-weight: 700; margin-bottom: 3px; }
.kcard .ttl { font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
.kcard .ft { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.kcard .ft .l { display: flex; align-items: center; gap: 6px; }
.kcard .prio { padding: 2px 8px; font-size: 11.5px; }
.kcard .subs { font-size: 11.5px; color: var(--muted); display: inline-flex; gap: 3px; align-items: center; }

/* ---------- Popover ---------- */
.pop { position: fixed; z-index: 80; background: #fff; border-radius: 12px; box-shadow: var(--shadow-l); padding: 8px; min-width: 190px; animation: popin .14s ease; border: 1px solid var(--line-2); }
@keyframes popin { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.pop-status { display: grid; gap: 5px; width: 200px; }
.pop-status button { height: 34px; border-radius: 7px; color: #fff; font-weight: 600; font-size: 13px; transition: transform .1s; }
.pop-status button:hover { transform: scale(1.03); }
.pop-list button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; text-align: start; }
.pop-list button:hover { background: var(--hover); }
.pop-list .sel { margin-inline-start: auto; color: var(--maroon); }
.pop-list .sep { height: 1px; background: var(--line-2); margin: 5px 2px; }
.pop-title { font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 4px 8px 6px; }
.pop-dates { display: grid; gap: 10px; padding: 6px; width: 240px; }
.pop-dates label { font-size: 12px; color: var(--muted); font-weight: 600; display: grid; gap: 4px; }
.pop-dates .row2 { display: flex; gap: 8px; justify-content: space-between; }
.owners-pop { width: 270px; max-height: 360px; overflow-y: auto; }
.owners-pop .dept { font-size: 11px; color: var(--muted); font-weight: 700; padding: 8px 9px 2px; }
.swatches { display: grid; grid-template-columns: repeat(6, 28px); gap: 8px; padding: 6px; }
.swatches button { width: 28px; height: 28px; border-radius: 8px; }
.swatches button.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brown); }

/* ---------- Drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(43,29,29,.22); z-index: 60; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(640px, 100%); background: var(--cream); z-index: 61; box-shadow: var(--shadow-l); display: flex; flex-direction: column; animation: slidein .25s cubic-bezier(.2,.8,.2,1); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
[dir="rtl"] .drawer { animation-name: slidein-rtl; }
@keyframes slidein-rtl { from { transform: translateX(-40px); opacity: 0; } }
.dr-head { padding: 16px 20px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.dr-crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.dr-crumbs .pdot { width: 9px; height: 9px; border-radius: 3px; }
.dr-crumbs .grow { flex: 1; }
.dr-title { width: 100%; font-size: 22px; font-weight: 700; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; margin-inline-start: -8px; background: transparent; }
.dr-title:hover { border-color: var(--line); }
.dr-title:focus { border-color: var(--maroon); background: #fff; }
.dr-tabs { display: flex; gap: 4px; margin-top: 10px; }
.dr-tab { padding: 7px 12px; border-radius: 8px 8px 0 0; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; display: inline-flex; gap: 6px; align-items: center; }
.dr-tab.active { color: var(--maroon); border-bottom-color: var(--maroon); }
.dr-body { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }
.props { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; align-items: center; background: #fff; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 18px; }
.props .k { color: var(--muted); font-size: 13px; display: flex; gap: 7px; align-items: center; }
.props .v { min-height: 38px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.props .v .status { width: 160px; }
.props .v .dates { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.props .v input[type="date"] { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: #fff; }
.props .v select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: #fff; max-width: 100%; }
.baseline { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.owner-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--beige-l); padding: 2px 10px 2px 3px; border-radius: 99px; font-size: 13px; }
[dir="rtl"] .owner-chip { padding: 2px 3px 2px 10px; }
.sec-title { font-weight: 700; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.sec-title .n { color: var(--muted); font-weight: 500; font-size: 13px; }
.subs-list { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sub-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line-2); }
.sub-item:last-child { border-bottom: 0; }
.sub-item .st { flex: 1; cursor: pointer; }
.sub-item .st.done { text-decoration: line-through; color: var(--muted); }
.sub-item .status { width: 96px; height: 26px; font-size: 11.5px; }
.sub-add { display: flex; gap: 8px; padding: 8px 10px; }
.sub-add input { flex: 1; height: 34px; border: 1px dashed var(--line); border-radius: 8px; padding: 0 10px; background: transparent; }
.sub-add input:focus { border-style: solid; border-color: var(--maroon); background: #fff; }
.empty-soon { text-align: center; padding: 34px 20px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-soon .mark { width: 34px; color: var(--beige); margin-bottom: 10px; }
.empty-soon h3 { margin: 0 0 6px; }
.empty-soon p { margin: 0; color: var(--muted); max-width: 380px; margin-inline: auto; }
.empty-soon ul { text-align: start; display: inline-block; color: var(--brown); margin: 14px 0 0; padding-inline-start: 18px; }
.hist { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 0; }
.hist-item { display: flex; gap: 10px; padding: 9px 16px; align-items: flex-start; font-size: 13px; }
.hist-item .w { flex: 1; }
.hist-item .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.hist-item .mini { display: inline-block; padding: 0 7px; border-radius: 5px; color: #fff; font-size: 11.5px; font-weight: 600; }

/* ---------- Modal ---------- */
.modal-scrim { position: fixed; inset: 0; background: rgba(43,29,29,.35); z-index: 90; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { width: min(480px, 100%); background: var(--cream); border-radius: 18px; box-shadow: var(--shadow-l); overflow: hidden; animation: popin .18s ease; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal-head { padding: 18px 22px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px 22px 6px; overflow-y: auto; }
.modal-foot { padding: 14px 22px 18px; display: flex; gap: 8px; justify-content: flex-end; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.switch .tr { width: 38px; height: 22px; border-radius: 99px; background: #D6CAB2; position: relative; transition: background .2s; flex-shrink: 0; }
.switch .tr::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; }
.switch.on .tr { background: var(--maroon); }
.switch.on .tr::after { inset-inline-start: 19px; }
.mem-check { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.mem-check label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.mem-check label:hover { background: var(--hover); }

/* ---------- Members page ---------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.mem-table { width: 100%; border-collapse: collapse; }
.mem-table th { text-align: start; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #FDFBF5; }
.mem-table td { padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.mem-table tr:last-child td { border-bottom: 0; }
.mem-table select { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; background: #fff; }
.who { display: flex; align-items: center; gap: 10px; }
.who small { display: block; color: var(--muted); }
.role-tag { font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--beige-l); font-weight: 600; }
.role-tag.admin { background: var(--maroon-l); color: var(--maroon); }

/* ---------- Empty & toast ---------- */
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty .mark { width: 44px; color: var(--beige); margin-bottom: 14px; }
.empty h3 { color: var(--brown); margin: 0 0 6px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--brown); color: var(--cream); padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow-l); z-index: 120; font-weight: 500; animation: toast .25s ease; display: flex; gap: 12px; align-items: center; }
.toast button { color: var(--beige); font-weight: 700; text-decoration: underline; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } }
.loading { display: grid; place-items: center; height: 100vh; color: var(--maroon); }
.loading .mark { width: 44px; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 32px 24px; min-height: 230px; }
  .login-art h1 { font-size: 30px; }
  .login-art .big { width: 200px; }
  .menu-toggle { display: inline-grid; }
  .brand small { display: none; }
  .sidebar { transform: translateX(-105%); transition: transform .25s; box-shadow: var(--shadow-l); }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  body.side-open .sidebar { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(43,29,29,.25); z-index: 29; }
  .main { margin-inline-start: 0; padding: calc(var(--top-total) + 16px) 14px 60px; }
  .board-title h1 { font-size: 23px; }
  .search input { width: 150px; }
  .t { background: inherit; z-index: 1; }
  .row.task .t { background: #fff; }
  .row.task.sub .t { background: #FCFAF4; }
  .row { grid-template-columns: 6px 230px 104px 130px 110px 170px 108px; }
  .open-btn { opacity: 1; }
  .open-btn span { display: none; }
  .props { grid-template-columns: 1fr; gap: 2px; }
  .props .k { margin-top: 8px; }
  .mem-table .hide-m { display: none; }
}
@media (max-width: 700px) {
  .tbl-inner { min-width: 0; }
  .row { grid-template-columns: 6px 1fr 112px; }
  .row > :nth-child(3), .row > :nth-child(5), .row > :nth-child(6), .row > :nth-child(7) { display: none !important; }
  .row.task { min-height: 58px; }
  .row.task .t { flex-wrap: wrap; row-gap: 2px; padding-block: 6px; position: static; }
  .row.task .t .title { flex: 1 1 calc(100% - 80px); white-space: normal; line-height: 1.35; }
  .m-meta { display: flex; align-items: center; gap: 8px; flex-basis: 100%; padding-inline-start: 6px; min-height: 22px; }
  .row.sub .m-meta { padding-inline-start: 34px; }
  .m-meta .due { font-size: 11.5px; }
  .open-btn { display: none; }
  .row.head > .t { position: static; }
  .row.foot > :nth-child(4) { display: flex !important; }
  .board-actions .btn-primary { height: 34px; padding: 0 12px; }
  .toolbar { gap: 6px; }
  .toolbar .grow { display: none; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 0 8px; }
  .tab.soon { display: none; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .chip-btn { flex: 1; justify-content: center; font-size: 12.5px; padding: 0 6px; white-space: nowrap; overflow: hidden; }
  .chip-btn > svg { display: none; }
  .kanban { grid-auto-columns: 82%; scroll-snap-type: x mandatory; }
  .kcol { scroll-snap-align: start; }
  .demo-banner { font-size: 11.5px; }
}
