:root {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f1f2f4; --surface-3: #dcdfe4; --text: #172b4d; --text-2: #44546f; --text-3: #626f86;
  --primary: #0c66e4; --primary-hover: #0055cc; --danger: #c9372c; --success: #1f845a; --warning: #e56910; --warning-text: #9c4400; --border: #dfe1e6;
  --radius: 8px; --shadow: 0 1px 1px rgba(9,30,66,.25), 0 0 1px rgba(9,30,66,.31); --shadow-lg: 0 8px 12px rgba(9,30,66,.15), 0 0 1px rgba(9,30,66,.31);
  --list-bg: #f1f2f4; --header-h: 48px; --board-header-h: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
#app { height: 100%; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
.hidden { display: none !important; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.flex { display: flex; align-items: center; gap: 8px; } .grow { flex: 1; } .wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 3px; background: var(--surface-2); color: var(--text); font-weight: 500; line-height: 20px; white-space: nowrap; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn.primary { background: var(--primary); color: #fff; } .btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: var(--danger); color: #fff; } .btn.danger:hover { background: #ae2a19; }
.btn.subtle { background: transparent; } .btn.subtle:hover { background: rgba(9,30,66,.08); }
.btn.sm { padding: 4px 8px; font-size: 13px; }
.btn.block { width: 100%; justify-content: flex-start; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.icon { padding: 6px; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Inputs */
.input, textarea.input { width: 100%; padding: 8px 12px; border: 2px solid var(--border); border-radius: 3px; background: var(--surface); line-height: 20px; outline: none; }
.input:focus { border-color: var(--primary); }
textarea.input { resize: vertical; min-height: 60px; }
label.field { display: block; margin: 10px 0 4px; font-size: 12px; font-weight: 700; color: var(--text-2); }
select.input { appearance: auto; padding: 6px 8px; }
.checkbox { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }

/* Top nav */
.topnav { height: var(--header-h); display: flex; align-items: center; gap: 6px; padding: 0 8px; background: #fff; border-bottom: 1px solid var(--border); flex-shrink: 0; position: relative; z-index: 20; }
.topnav .logo { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 17px; color: var(--text); padding: 6px 8px; border-radius: 3px; }
.topnav .logo:hover { background: var(--surface-2); text-decoration: none; }
.topnav .logo svg { width: 22px; height: 22px; }
.topnav .search { position: relative; width: 320px; max-width: 40vw; margin-left: auto; }
.topnav .search input { width: 100%; padding: 6px 12px 6px 34px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); }
.topnav .search input:focus { background: #fff; outline: 2px solid var(--primary); }
.topnav .search svg { position: absolute; left: 10px; top: 8px; width: 16px; height: 16px; color: var(--text-3); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0; cursor: default; letter-spacing: .3px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; } .avatar.lg { width: 40px; height: 40px; font-size: 15px; }
.avatar-stack { display: flex; } .avatar-stack .avatar { margin-left: -6px; border: 2px solid #fff; } .avatar-stack .avatar:first-child { margin-left: 0; }
.badge-dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* Pages */
.page { flex: 1; overflow: auto; }
.container { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.home { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
.home .side .nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; color: var(--text); font-weight: 500; cursor: pointer; }
.home .side .nav-item:hover, .home .side .nav-item.active { background: #e9f2ff; color: var(--primary); text-decoration: none; }
.home .side h4 { padding: 16px 12px 6px; font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; }
.ws-icon { width: 24px; height: 24px; border-radius: 4px; background: linear-gradient(135deg,#0052cc,#6554c0); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; flex-shrink:0; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; font-size: 16px; }
.section-title:first-child { margin-top: 0; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.board-tile { position: relative; height: 96px; border-radius: 6px; padding: 10px; color: #fff; font-weight: 700; display: flex; flex-direction: column; overflow: hidden; cursor: pointer; background-size: cover; background-position: center; }
.board-tile::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.2), rgba(0,0,0,.45)); transition: background .15s; }
.board-tile { text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.board-tile:hover::before { background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.55)); }
.board-tile > * { position: relative; }
.board-tile .star { position: absolute; right: 8px; bottom: 8px; opacity: 0; transition: opacity .15s, transform .15s; }
.board-tile:hover .star, .board-tile .star.on { opacity: 1; }
.board-tile .star:hover { transform: scale(1.2); }
.board-tile.create { background: var(--surface-2); color: var(--text-2); align-items: center; justify-content: center; font-weight: 500; border: 0; }
.board-tile.create::before { display: none; } .board-tile.create:hover { background: var(--surface-3); }
.board-tile .meta { margin-top: auto; font-size: 11px; font-weight: 500; opacity: .9; }
.empty { padding: 48px; text-align: center; color: var(--text-3); }

/* Auth */
.auth { min-height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #0052cc 0%, #6554c0 100%); padding: 24px; }
.auth-card { width: 400px; max-width: 100%; background: #fff; border-radius: 8px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--text-3); margin-bottom: 20px; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 16px; padding: 10px; }
.auth-card .error { color: var(--danger); background: #ffeceb; padding: 8px 12px; border-radius: 4px; margin-top: 12px; }
.auth-card .switch-link { text-align: center; margin-top: 16px; }

/* Board */
.board-page { flex: 1; display: flex; flex-direction: column; min-height: 0; background-size: cover; background-position: center; background-color: #0079bf; position: relative; }
.board-header { height: var(--board-header-h); display: flex; align-items: center; gap: 4px; padding: 8px 12px; background: rgba(0,0,0,.35); backdrop-filter: blur(6px); color: #fff; flex-shrink: 0; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.board-header::-webkit-scrollbar { display: none; }
.board-header .btn { color: #fff; background: transparent; } .board-header .btn:hover { background: rgba(255,255,255,.2); }
.board-header .btn.active { background: #fff; color: var(--text); }
.board-header .title { font-size: 18px; font-weight: 700; padding: 4px 10px; border-radius: 3px; cursor: pointer; max-width: 40vw; flex-shrink: 0; min-width: 0; }
.board-header .btn { flex-shrink: 0; }
.board-header .title:hover { background: rgba(255,255,255,.2); }
.board-header input.title-edit { font-size: 18px; font-weight: 700; padding: 4px 10px; border: 0; border-radius: 3px; background: #fff; color: var(--text); min-width: 100px; }
.board-header .sep { width: 1px; height: 20px; background: rgba(255,255,255,.3); margin: 0 6px; }
.board-header .views { display: flex; gap: 2px; background: rgba(0,0,0,.2); border-radius: 4px; padding: 2px; }
.board-header .views .btn { padding: 4px 10px; font-size: 13px; }
.board-header .presence { display: flex; }
.board-canvas { flex: 1; overflow-x: auto; overflow-y: hidden; display: flex; align-items: flex-start; gap: 12px; padding: 12px; min-height: 0; user-select: none; }
.board-canvas.view-other { overflow: auto; display: block; user-select: text; }
.list { width: 272px; flex-shrink: 0; background: var(--list-bg); border-radius: 12px; display: flex; flex-direction: column; max-height: 100%; box-shadow: var(--shadow); }
.list.collapsed { width: 40px; }
.list.collapsed .list-body, .list.collapsed .list-footer, .list.collapsed .list-header .name { display: none; }
.list.collapsed .list-header { flex-direction: column; height: auto; padding: 8px 0; }
.list.collapsed .vname { writing-mode: vertical-rl; transform: rotate(180deg); padding: 8px 0; font-weight: 600; cursor: pointer; }
.list-header { display: flex; align-items: center; gap: 4px; padding: 8px 8px 0 12px; }
.list-header .name { flex: 1; font-weight: 600; padding: 4px 0; cursor: pointer; word-break: break-word; }
.list-header input { flex: 1; font-weight: 600; padding: 4px 8px; border-radius: 3px; border: 2px solid var(--primary); outline: none; background: #fff; min-width: 0; }
.list-header .count { font-size: 12px; color: var(--text-3); padding: 2px 6px; border-radius: 10px; background: rgba(0,0,0,.05); }
.list-header .count.over { background: #ffeceb; color: var(--danger); font-weight: 700; }
.list.limit-reached { background: #ffeceb; }
.list-color { height: 6px; border-radius: 12px 12px 0 0; margin-bottom: -4px; }
.list-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 8px; scrollbar-width: thin; }
.list-footer { padding: 6px 8px 8px; }
.list-footer .btn { width: 100%; justify-content: flex-start; color: var(--text-2); }
.list-footer .btn:hover { background: rgba(9,30,66,.08); color: var(--text); }
.add-list { width: 272px; flex-shrink: 0; background: rgba(255,255,255,.25); border-radius: 12px; }
.add-list > .btn { width: 100%; justify-content: flex-start; color: #fff; padding: 10px 12px; font-weight: 600; background: rgba(0,0,0,.28); text-shadow: 0 1px 1px rgba(0,0,0,.3); }
.add-list > .btn:hover { background: rgba(0,0,0,.4); }
.add-list form, .composer { background: var(--list-bg); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.composer { background: transparent; padding: 0; }
.composer textarea { width: 100%; padding: 8px 12px; border: 0; border-radius: 8px; box-shadow: var(--shadow); resize: none; outline: none; background: #fff; min-height: 56px; }
.composer-actions { display: flex; align-items: center; gap: 4px; }

/* Cards */
.card { background: #fff; border-radius: 8px; box-shadow: var(--shadow); cursor: pointer; position: relative; overflow: hidden; border: 2px solid transparent; }
.card:hover { border-color: var(--primary); }
.card.dragging { opacity: .4; }
.card.complete-cover { }
.card-cover { height: 36px; background-size: cover; background-position: center; }
.card-cover.full { height: auto; min-height: 56px; }
.card-cover.image { height: 120px; }
.card.cover-full { color: #fff; }
.card.cover-full .card-body { position: relative; }
.card-body { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.card-label { height: 8px; min-width: 40px; border-radius: 4px; font-size: 12px; line-height: 16px; padding: 0; overflow: hidden; color: transparent; transition: all .15s; font-weight: 600; }
.labels-expanded .card-label { height: 16px; padding: 0 8px; color: inherit; }
.card-title { font-size: 14px; line-height: 20px; word-break: break-word; }
.card-title.complete { text-decoration: line-through; color: var(--text-3); }
.card-badges { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; color: var(--text-2); }
.card-badges .badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 4px; border-radius: 3px; }
.card-badges .badge svg { width: 14px; height: 14px; }
.badge.due.overdue { background: #ffeceb; color: var(--danger); } .badge.due.soon { background: #fff7d6; color: #6b4f00; } .badge.due.done { background: #dcfff1; color: var(--success); }
.badge.checklist.done { background: var(--success); color: #fff; }
.card-members { display: flex; justify-content: flex-end; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.card-fields { display: flex; flex-wrap: wrap; gap: 4px; }
.card-fields .cf { font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 3px; color: var(--text-2); }
.card-fields .cf b { color: var(--text); }
.card .edit-btn { position: absolute; top: 4px; right: 4px; background: #fff; border-radius: 3px; padding: 4px; display: none; box-shadow: var(--shadow); }
.card:hover .edit-btn { display: flex; }
.card .edit-btn svg { width: 14px; height: 14px; }
.card.aged-1 { opacity: .85; } .card.aged-2 { opacity: .7; } .card.aged-3 { opacity: .55; }
.card-number { color: var(--text-3); font-size: 12px; }

/* DnD */
.drag-ghost { position: fixed; pointer-events: none; z-index: 1000; transform: rotate(3deg); width: 256px; box-shadow: var(--shadow-lg); }
.drag-ghost.list-ghost { width: 272px; opacity: .9; }
.drop-placeholder { background: rgba(9,30,66,.14); border-radius: 8px; min-height: 40px; }
.list-placeholder { width: 272px; flex-shrink: 0; background: rgba(0,0,0,.25); border-radius: 12px; align-self: stretch; }
body.dragging { cursor: grabbing !important; }
body.dragging * { cursor: grabbing !important; }

/* Popover */
.popover { position: absolute; z-index: 500; width: 304px; background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); display: flex; flex-direction: column; max-height: min(80vh, 640px); }
.popover.wide { width: 420px; }
.popover-header { display: flex; align-items: center; height: 40px; padding: 0 8px 0 40px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--text-2); text-align: center; position: relative; flex-shrink: 0; }
.popover-header .t { flex: 1; text-align: center; font-size: 14px; }
.popover-header .close, .popover-header .back { position: absolute; top: 6px; padding: 4px; border-radius: 4px; color: var(--text-3); }
.popover-header .close { right: 6px; } .popover-header .back { left: 6px; }
.popover-header .close:hover, .popover-header .back:hover { background: var(--surface-2); color: var(--text); }
.popover-body { padding: 12px; overflow-y: auto; }
.popover-body .btn.block { margin-bottom: 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border-radius: 4px; text-align: left; }
.menu-item:hover { background: var(--surface-2); }
.menu-item svg { width: 16px; height: 16px; color: var(--text-2); flex-shrink: 0; }
.menu-item.danger { color: var(--danger); } .menu-item.danger:hover { background: #ffeceb; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
.label-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.label-row .swatch { flex: 1; height: 32px; border-radius: 4px; padding: 0 12px; display: flex; align-items: center; font-weight: 600; font-size: 13px; cursor: pointer; }
.label-row .swatch:hover { filter: brightness(.95); }
.label-row input[type=checkbox] { width: 16px; height: 16px; }
.color-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0; }
.color-grid .swatch { height: 32px; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
.color-grid .swatch.selected { border-color: var(--primary); outline: 2px solid #fff; outline-offset: -4px; }
.bg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.bg-grid .swatch { height: 56px; border-radius: 6px; cursor: pointer; background-size: cover; background-position: center; border: 2px solid transparent; }
.bg-grid .swatch.selected { border-color: var(--primary); }
.member-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.member-row:hover { background: var(--surface-2); }
.member-row .name { flex: 1; } .member-row .check { color: var(--text-3); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 400; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 48px 16px; }
.modal { background: var(--bg); border-radius: 12px; width: 768px; max-width: 100%; box-shadow: var(--shadow-lg); position: relative; min-height: 200px; }
.modal.sm { width: 480px; background: #fff; padding: 24px; }
.modal .modal-close { position: absolute; top: 12px; right: 12px; padding: 6px; border-radius: 50%; color: var(--text-2); z-index: 2; }
.modal .modal-close:hover { background: var(--surface-3); }
.modal .modal-close svg { width: 20px; height: 20px; }

/* Card detail */
.card-detail { display: grid; grid-template-columns: 1fr 180px; gap: 16px; padding: 16px 24px 24px; }
.card-detail .cover { grid-column: 1 / -1; margin: -16px -24px 0; height: 160px; background-size: cover; background-position: center; border-radius: 12px 12px 0 0; }
.card-detail .cover.image { height: 200px; background-size: contain; background-repeat: no-repeat; background-color: #e1e4ea; }
.card-detail .main { min-width: 0; }
.card-detail .side { display: flex; flex-direction: column; gap: 16px; }
.card-detail .side h4 { font-size: 12px; color: var(--text-3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .3px; }
.card-detail .side .btn { width: 100%; justify-content: flex-start; margin-bottom: 4px; }
.card-detail .section { display: grid; grid-template-columns: 32px 1fr; gap: 0 8px; margin-top: 24px; }
.card-detail .section > svg { width: 22px; height: 22px; color: var(--text-2); margin-top: 2px; }
.card-detail .section h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-detail .section h3 input { font-size: 16px; font-weight: 600; }
.card-detail .section .section-body { grid-column: 2; }
.card-detail .section .section-head { display: flex; align-items: center; gap: 8px; }
.card-detail .section .section-head .spacer { flex: 1; }
.card-detail .title-input { width: 100%; font-size: 20px; font-weight: 600; padding: 4px 8px; margin-left: -8px; border: 2px solid transparent; border-radius: 3px; background: transparent; outline: none; resize: none; }
.card-detail .title-input:focus { background: #fff; border-color: var(--primary); }
.card-detail .in-list { color: var(--text-3); font-size: 13px; }
.card-detail .in-list a { font-weight: 500; }
.meta-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.meta-row h4 { font-size: 12px; color: var(--text-3); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .3px; }
.meta-row .chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 12px; height: 32px; border-radius: 3px; background: var(--surface-2); font-weight: 500; }
.chip.label { min-width: 48px; font-size: 13px; }
.chip.add { width: 32px; justify-content: center; padding: 0; color: var(--text-2); cursor: pointer; } .chip.add:hover { background: var(--surface-3); }
.chip.due { cursor: pointer; } .chip.due:hover { background: var(--surface-3); }
.chip.due .pill { font-size: 11px; padding: 1px 4px; border-radius: 3px; color: #fff; font-weight: 700; }
.chip.due .pill.overdue { background: var(--danger); } .chip.due .pill.done { background: var(--success); } .chip.due .pill.soon { background: #e2b203; color: var(--text); }
.description { white-space: pre-wrap; word-break: break-word; line-height: 20px; }
.description:empty::before, .desc-placeholder { content: ''; }
.desc-placeholder { background: var(--surface-2); padding: 8px 12px; border-radius: 3px; cursor: pointer; color: var(--text-2); min-height: 56px; }
.desc-placeholder:hover { background: var(--surface-3); }
.md p { margin: 0 0 8px; } .md ul, .md ol { margin: 0 0 8px; padding-left: 22px; } .md code { background: var(--surface-2); padding: 1px 4px; border-radius: 3px; font-size: 12px; } .md pre { background: var(--surface-2); padding: 8px; border-radius: 4px; overflow: auto; } .md h1,.md h2,.md h3 { margin: 8px 0 4px; } .md a { word-break: break-all; } .md blockquote { border-left: 3px solid var(--border); margin: 0 0 8px; padding-left: 10px; color: var(--text-2); }
.checklist .progress { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text-3); margin: 6px 0; }
.checklist .bar { flex: 1; height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.checklist .bar > div { height: 100%; background: var(--primary); transition: width .2s; }
.checklist .bar > div.done { background: var(--success); }
.check-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 6px; margin-left: -8px; }
.check-item:hover { background: var(--surface-2); }
.check-item input[type=checkbox] { margin-top: 3px; width: 16px; height: 16px; cursor: pointer; }
.check-item .txt { flex: 1; line-height: 20px; cursor: pointer; word-break: break-word; }
.check-item.checked .txt { text-decoration: line-through; color: var(--text-3); }
.check-item .tools { display: none; gap: 2px; } .check-item:hover .tools { display: flex; }
.check-item .tools .btn { padding: 2px; }
.check-item .item-meta { display: flex; gap: 4px; align-items: center; margin-top: 2px; }
.check-item .item-meta .badge { font-size: 11px; padding: 1px 6px; border-radius: 3px; background: var(--surface-2); color: var(--text-2); }
.attachment { display: flex; gap: 12px; padding: 8px; border-radius: 6px; } .attachment:hover { background: var(--surface-2); }
.attachment .thumb { width: 112px; height: 80px; border-radius: 4px; background: var(--surface-3); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-2); flex-shrink: 0; font-size: 12px; text-transform: uppercase; }
.attachment .info { flex: 1; min-width: 0; } .attachment .info .name { font-weight: 600; word-break: break-all; } .attachment .info .actions { font-size: 12px; color: var(--text-3); }
.attachment .info .actions a, .attachment .info .actions button { color: var(--text-3); text-decoration: underline; padding: 0; margin-right: 8px; }
.comment { display: grid; grid-template-columns: 32px 1fr; gap: 8px; margin-top: 12px; }
.comment .who { font-weight: 600; } .comment .when { color: var(--text-3); font-size: 12px; margin-left: 6px; }
.comment .bubble { background: #fff; padding: 8px 12px; border-radius: 8px; box-shadow: var(--shadow); margin-top: 4px; word-break: break-word; }
.comment .actions { font-size: 12px; color: var(--text-3); margin-top: 2px; } .comment .actions button { text-decoration: underline; color: var(--text-3); padding: 0 4px 0 0; }
.activity-item { display: grid; grid-template-columns: 32px 1fr; gap: 8px; margin-top: 10px; font-size: 13px; }
.activity-item .when { color: var(--text-3); font-size: 12px; }
.activity-item b { font-weight: 600; }
.custom-fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 16px; }
.custom-fields-grid .input { padding: 4px 8px; }

/* Board side menu */
.side-menu { position: absolute; top: var(--board-header-h); right: 0; bottom: 0; width: 340px; background: #fff; box-shadow: -2px 0 12px rgba(0,0,0,.2); z-index: 50; display: flex; flex-direction: column; animation: slideIn .15s ease; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
.side-menu .popover-header { padding: 0 40px; height: 48px; }
.side-menu .popover-body { flex: 1; }
.side-menu .section-title { font-size: 14px; margin: 16px 0 8px; }

/* Table view */
.table-view { background: rgba(255,255,255,.95); border-radius: 8px; margin: 0; min-width: 100%; }
.table-view table { width: 100%; border-collapse: collapse; }
.table-view th, .table-view td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-view th { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .3px; cursor: pointer; user-select: none; white-space: nowrap; position: sticky; top: 0; background: #fff; z-index: 1; }
.table-view th:hover { color: var(--text); }
.table-view tr:hover td { background: var(--surface-2); }
.table-view td .card-title { cursor: pointer; font-weight: 500; }
.table-view td .card-title:hover { text-decoration: underline; }
.table-view td select, .table-view td input { padding: 4px 6px; border: 1px solid transparent; border-radius: 3px; background: transparent; width: 100%; }
.table-view td select:hover, .table-view td input:hover { border-color: var(--border); background: #fff; }
.table-view .card-label { height: 16px; padding: 0 6px; color: inherit; display: inline-block; margin-right: 2px; }

/* Calendar */
.calendar { background: rgba(255,255,255,.95); border-radius: 8px; padding: 12px; }
.calendar .cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.calendar .cal-head h3 { min-width: 180px; text-align: center; }
.calendar .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.calendar .dow { background: var(--surface-2); padding: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); text-align: center; }
.calendar .day { background: #fff; min-height: 110px; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.calendar .day.other { background: #fafbfc; color: var(--text-3); } .calendar .day.today .dnum { background: var(--primary); color: #fff; }
.calendar .day .dnum { font-size: 12px; width: 22px; height: 22px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.calendar .day.drop-over { background: #e9f2ff; }
.cal-card { font-size: 12px; padding: 3px 6px; border-radius: 4px; background: var(--surface-2); cursor: pointer; display: flex; align-items: center; gap: 4px; border-left: 3px solid var(--primary); }
.cal-card:hover { background: var(--surface-3); } .cal-card.done { opacity: .6; text-decoration: line-through; }
.cal-card .dot { width: 8px; height: 8px; border-radius: 4px; flex-shrink: 0; }

/* Timeline */
.timeline { background: rgba(255,255,255,.95); border-radius: 8px; padding: 12px; overflow: auto; }
.timeline .tl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.timeline .tl-scroll { overflow-x: auto; }
.timeline .tl-grid { position: relative; display: grid; }
.timeline .tl-days { display: flex; position: sticky; top: 0; background: #fff; z-index: 1; border-bottom: 1px solid var(--border); }
.timeline .tl-day { flex-shrink: 0; font-size: 11px; text-align: center; color: var(--text-3); padding: 4px 0; border-right: 1px solid #f1f2f4; }
.timeline .tl-day.weekend { background: #fafbfc; } .timeline .tl-day.today { color: var(--primary); font-weight: 700; }
.timeline .tl-row { position: relative; height: 36px; border-bottom: 1px solid #f1f2f4; }
.timeline .tl-group { font-weight: 600; padding: 6px 8px; background: var(--surface-2); position: sticky; left: 0; font-size: 12px; }
.timeline .tl-bar { position: absolute; top: 6px; height: 24px; border-radius: 4px; background: var(--primary); color: #fff; font-size: 12px; padding: 0 8px; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-shadow: var(--shadow); }
.timeline .tl-bar.done { background: var(--success); } .timeline .tl-bar.overdue { background: var(--danger); }
.timeline .tl-bar .handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; } .timeline .tl-bar .handle.l { left: 0; } .timeline .tl-bar .handle.r { right: 0; }
.timeline .tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .6; }
.timeline .tl-unscheduled { margin-top: 12px; }

/* Dashboard */
.dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.dash-tile { background: rgba(255,255,255,.95); border-radius: 8px; padding: 16px; }
.dash-tile h3 { font-size: 14px; margin-bottom: 12px; color: var(--text-2); }
.dash-tile .big { font-size: 36px; font-weight: 700; }
.bar-chart { display: flex; flex-direction: column; gap: 6px; }
.bar-chart .row { display: grid; grid-template-columns: 120px 1fr 32px; align-items: center; gap: 8px; font-size: 13px; }
.bar-chart .row .bar { height: 18px; border-radius: 3px; background: var(--primary); min-width: 2px; }
.bar-chart .row .n { text-align: right; color: var(--text-2); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--surface-2); padding: 10px; border-radius: 6px; } .stat .v { font-size: 24px; font-weight: 700; } .stat .l { font-size: 12px; color: var(--text-3); }

/* Automation */
.auto-list .rule { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; }
.auto-list .rule .head { display: flex; align-items: center; gap: 8px; }
.auto-list .rule .head b { flex: 1; }
.auto-list .rule .desc { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.auto-list .rule.off { opacity: .6; }
.action-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.action-row select, .action-row input { flex: 1; min-width: 100px; }
.switch { width: 36px; height: 20px; border-radius: 10px; background: var(--surface-3); position: relative; cursor: pointer; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 8px; background: #fff; transition: left .15s; }
.switch.on { background: var(--success); } .switch.on::after { left: 18px; }
.btn-group .btn { margin-right: 4px; margin-bottom: 4px; }

/* Filter */
.filter-active { background: #fff !important; color: var(--primary) !important; }

/* Toast */
#toast-root { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--text); color: #fff; padding: 10px 16px; border-radius: 6px; box-shadow: var(--shadow-lg); font-size: 13px; animation: fadeIn .15s; display: flex; gap: 12px; align-items: center; }
.toast.error { background: var(--danger); } .toast.success { background: var(--success); }
.toast button { color: #fff; text-decoration: underline; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* Search page / my cards */
.result-card { background: #fff; border-radius: 6px; padding: 10px 12px; box-shadow: var(--shadow); margin-bottom: 8px; cursor: pointer; }
.result-card:hover { background: var(--surface-2); }
.result-card .crumb { font-size: 12px; color: var(--text-3); }
.search-dd { position: absolute; top: 40px; left: 0; right: 0; background: #fff; border-radius: 6px; box-shadow: var(--shadow-lg); max-height: 400px; overflow: auto; z-index: 100; padding: 6px; }
.search-dd .hint { padding: 8px; font-size: 12px; color: var(--text-3); }

/* Keyboard shortcuts */
.kbd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.kbd-grid kbd { background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; padding: 1px 6px; font-family: inherit; font-size: 12px; margin-right: 8px; }

/* Members table */
.members-table .member-row { cursor: default; }
.members-table select { padding: 4px 6px; border-radius: 3px; border: 1px solid var(--border); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tabs .btn { border-radius: 3px 3px 0 0; } .tabs .btn.active { color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); background: transparent; }

@media (max-width: 900px) { .board-header .views .btn span:not(.ico) { display: none; } .board-header .views .btn { padding: 4px 6px; } }
@media (max-width: 720px) {
  .home { grid-template-columns: 1fr; } .home .side { display: none; }
  .card-detail { grid-template-columns: 1fr; } .card-detail .side { flex-direction: row; flex-wrap: wrap; } .card-detail .side > div { flex: 1 1 140px; }
  .topnav .search { width: 160px; }
  .board-header .title { max-width: 30vw; }
}

/* Planner */
.container.wide { max-width: 1500px; }
.plan-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.plan-body { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: start; }
.plan-grid-wrap { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); overflow: auto; }
.plan-grid { display: grid; min-width: 760px; }
.plan-corner, .plan-dow { position: sticky; top: 0; background: var(--surface-2); border-bottom: 1px solid var(--border); z-index: 1; }
.plan-dow { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--text-3); text-align: center; }
.plan-dow .dnum { font-size: 16px; color: var(--text); width: 26px; height: 26px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; }
.plan-dow.today .dnum { background: var(--primary); color: #fff; }
.plan-hour { font-size: 11px; color: var(--text-3); padding: 6px 6px 0 0; text-align: right; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.plan-cell { min-height: 44px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 3px; display: flex; flex-direction: column; gap: 3px; }
.plan-cell.today { background: #f7fbff; } .plan-cell.allday { background: #fbfbfc; min-height: 36px; }
.plan-cell.drop-over, .plan-side.drop-over { background: #e9f2ff; outline: 2px dashed var(--primary); outline-offset: -2px; }
.plan-card { font-size: 12px; padding: 4px 6px; border-radius: 4px; background: var(--surface-2); cursor: grab; border-left: 3px solid var(--primary); box-shadow: var(--shadow); }
.plan-card:hover { background: var(--surface-3); } .plan-card.done { opacity: .55; text-decoration: line-through; } .plan-card.dragging { opacity: .4; }
.plan-card.compact { padding: 3px 6px; }
.plan-side { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); padding: 12px; position: sticky; top: 8px; max-height: calc(100vh - 120px); overflow: auto; }
.plan-unscheduled { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
@media (max-width: 900px) { .plan-body { grid-template-columns: 1fr; } .plan-side { position: static; max-height: none; } }

/* Inbox */
.inbox-quick { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 8px; padding: 8px 12px; box-shadow: var(--shadow); margin: 12px 0 16px; }
.inbox-quick .input { flex: 1; border: 0; box-shadow: none; background: transparent; }
.inbox-item { background: var(--surface); border-radius: 8px; padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 10px; }
.inbox-item.unmatched { border-left: 3px solid var(--warning); }
.inbox-body { margin: 8px 0 0 28px; font-size: 13px; color: var(--text-2); white-space: pre-wrap; }
.inbox-body.clamp { max-height: 72px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.inbox-item .btn.subtle.sm { margin-left: 28px; }

/* Board switcher + side panels (Inbox left, Planner right) */
.board-body { flex: 1; display: flex; min-height: 0; align-items: stretch; }
.board-panel { width: 0; flex-shrink: 0; overflow: hidden; background: rgba(255,255,255,.96); color: var(--text); border-radius: 12px; display: flex; flex-direction: column; box-shadow: var(--shadow); margin: 12px 0; transition: width .15s ease, margin .15s ease; }
.board-panel.left.open { width: 300px; margin-left: 12px; } .board-panel.right.open { width: 340px; margin-right: 12px; }
.board-panel .panel-head { padding: 10px 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border); flex-shrink: 0; white-space: nowrap; }
.board-panel .panel-body { flex: 1; overflow: auto; padding: 8px; min-width: 260px; }
.board-canvas.hidden { display: none !important; }
.switcher { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; background: rgba(23,43,77,.92); border-radius: 10px; padding: 4px; box-shadow: var(--shadow-lg); z-index: 40; backdrop-filter: blur(6px); }
.switcher .btn { color: #fff; background: transparent; padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.switcher .btn:hover { background: rgba(255,255,255,.15); }
.switcher .btn.active { background: rgba(255,255,255,.22); box-shadow: inset 0 -2px 0 #579dff; }
.inbox-card { background: #fff; border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; margin-bottom: 8px; cursor: grab; border: 1px solid var(--border); }
.inbox-card:hover { background: var(--surface-2); }
.plan-slot { display: flex; gap: 6px; border-top: 1px solid var(--border); min-height: 34px; padding: 3px 0; }
.plan-slot .hr { width: 46px; font-size: 11px; color: var(--text-3); padding-top: 4px; text-align: right; flex-shrink: 0; }
.plan-slot .cards { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.plan-slot.drop-over { background: #e9f2ff; outline: 2px dashed var(--primary); outline-offset: -2px; border-radius: 4px; }
.list.drop-target { outline: 3px solid #579dff; outline-offset: -1px; }
.menu-item.active { background: #e9f2ff; }
@media (max-width: 760px) { .board-panel.left.open, .board-panel.right.open { width: 260px; } }

/* Card completion circle (Trello-style) */
.card-title-row { display: flex; align-items: flex-start; gap: 6px; }
.card-check { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--text-3); opacity: 0; transition: opacity .12s, width .12s, margin .12s; display: inline-flex; padding: 0; border-radius: 9px; }
.card-check svg { width: 18px; height: 18px; }
.card:hover .card-check, .card-check.on { opacity: 1; }
.card-check.on { color: var(--success); }
.card-title-row.complete .card-title { color: var(--text-2); }
.card:not(:hover) .card-check:not(.on) { width: 0; margin-right: -6px; overflow: hidden; }
.cover-full .card-check { color: #fff; }
/* Collapsed lists: expand icon, vertical name, count badge */
.list.collapsed .list-header { align-items: center; gap: 6px; }
.list.collapsed .expand { transform: none; }
.list.collapsed .vcount { display: inline-flex; min-width: 22px; justify-content: center; margin-top: 4px; }
.list.collapsed .list-header .count:not(.vcount) { display: none; }
/* Overview panel */
.ov-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.ov-stat { background: var(--surface-2); border-radius: 6px; padding: 6px 8px; text-align: center; } .ov-stat .v { font-size: 18px; font-weight: 700; } .ov-stat .l { font-size: 11px; color: var(--text-3); }
.ov-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 4px; } .ov-bar > div { height: 100%; background: var(--success); }
.ov-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.ov-item { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; font-size: 13px; } .ov-item.done { color: var(--text-3); text-decoration: line-through; }
.ov-item input { margin-top: 2px; }
.ov-card { margin-top: 10px; } .ov-card .t { font-weight: 600; font-size: 13px; cursor: pointer; } .ov-card .t:hover { text-decoration: underline; }

.panel-body.show-done .ov-done-row { display: flex !important; }
.board-panel.right.wide.open { width: 520px; }

.plan-card.item { border-left-color: var(--warning); cursor: pointer; } .plan-card.item input { margin: 0; }
.ov-add { background: var(--surface-2); border-radius: 8px; padding: 8px; margin: 6px 0 10px; } .ov-add .input { font-size: 12px; padding: 4px 6px; } .ov-add select.input { max-width: 150px; }

a.menu-item { color: inherit; } a.menu-item:hover { text-decoration: none; }

/* Card density (Trello-like) + Compact cards option */
.card-body { padding: 7px 10px; gap: 5px; }
.card-badges { gap: 2px 6px; } .card-badges .badge { padding: 1px 3px; } .card-badges .badge svg { width: 13px; height: 13px; }
.card-members .avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.list-body { gap: 6px; }
.board-canvas.compact .list { width: 248px; }
.board-canvas.compact .card { border-radius: 6px; }
.board-canvas.compact .card-body { padding: 4px 8px; gap: 3px; }
.board-canvas.compact .card-title { font-size: 13px; line-height: 17px; }
.board-canvas.compact .card-label { height: 6px; min-width: 32px; }
.board-canvas.compact.labels-expanded .card-label { height: 14px; font-size: 11px; line-height: 14px; }
.board-canvas.compact .card-badges { font-size: 11px; gap: 1px 5px; } .board-canvas.compact .card-badges .badge svg { width: 12px; height: 12px; }
.board-canvas.compact .card-members .avatar.sm { width: 18px; height: 18px; font-size: 9px; }
.board-canvas.compact .card-fields { display: none; }
.board-canvas.compact .card-cover { height: 24px; } .board-canvas.compact .card-cover.image { height: 72px; }
.board-canvas.compact .card-check, .board-canvas.compact .card-check svg { width: 15px; height: 15px; }
.board-canvas.compact .list-body { gap: 4px; padding: 4px 6px; }
.board-canvas.compact .list-header { padding: 6px 6px 0 10px; } .board-canvas.compact .list-footer { padding: 4px 6px 6px; }

/* Phones and small tablets */
.topnav .nav-more { display: none; }
@media (max-width: 760px) {
  .topnav { gap: 4px; padding: 0 6px; }
  .topnav > a.btn, .topnav [title="Keyboard shortcuts"] { display: none; }
  .topnav .nav-more { display: inline-flex; }
  .topnav .logo .logo-text { display: none; }
  .topnav .search { width: 44px; max-width: 44px; margin-left: auto; }
  .topnav .search input { padding-left: 30px; color: transparent; }
  .topnav .search input:focus { position: absolute; right: 0; top: -6px; width: min(70vw, 360px); color: inherit; z-index: 5; }
  .board-header { padding: 6px 8px; gap: 2px; } .board-header .sep { display: none; } .board-header .title { font-size: 16px; max-width: 42vw; }
  .board-canvas { padding: 8px; gap: 8px; scroll-snap-type: x mandatory; scroll-padding: 8px; }
  .board-canvas:not(.compact) .list { width: min(calc(100vw - 48px), 300px); scroll-snap-align: start; }
  .board-canvas.compact .list { width: min(calc(100vw - 72px), 260px); scroll-snap-align: start; }
  .board-panel.left.open, .board-panel.right.open, .board-panel.right.wide.open { position: absolute; top: var(--board-header-h); bottom: 0; width: 100%; margin: 0; border-radius: 0; z-index: 30; }
  .board-panel.left.open { left: 0; } .board-panel.right.open { right: 0; }
  .switcher { bottom: 10px; padding: 3px; max-width: calc(100vw - 16px); }
  .switcher .btn { padding: 6px 8px; font-size: 12px; }
  .side-menu { width: 100%; }
  .container { padding: 16px 12px; }
}
@media (max-width: 480px) {
  .switcher .btn { padding: 6px; } .switcher .btn .ico + * , .switcher .btn { font-size: 0; } .switcher .btn .ico { font-size: 14px; }
  .switcher .btn.active::after { content: ""; }
}
/* Touch: cards and lists use pointer drag; let the page scroll until a long press starts a drag */
@media (hover: none) and (pointer: coarse) { .card .edit-btn { display: none !important; } .card-check { opacity: 1; width: 18px !important; margin-right: 0 !important; } }
.card.lifting { transform: scale(1.03); box-shadow: var(--shadow-lg); }
.topnav .logo { white-space: nowrap; }

/* Multi-select + merge */
.card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(12,102,228,.35), var(--shadow); }
.selection-bar { position: absolute; top: calc(var(--board-header-h) + 10px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: #fff; color: var(--text); padding: 8px 12px; border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 45; white-space: nowrap; }
.merge-banner { display: flex; align-items: center; gap: 10px; background: #fff7d6; border: 1px solid #f5cd47; border-radius: 8px; padding: 10px 12px; margin: 0 0 12px 40px; }
.merge-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.merge-row:last-child { border-bottom: 0; }
/* Brand */
.topnav .brand-mark { width: 26px; height: 26px; border-radius: 6px; }

/* Bids view */
.bids-view { background: rgba(255,255,255,.96); border-radius: 8px; padding: 12px; }
.bids-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bids-scroll { overflow-x: auto; }
.bids-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
.bids-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.bids-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.bids-table tr.group td { background: var(--surface-2); font-weight: 600; padding: 8px; }
.bids-table tr.lowest td { background: #e8f7ee; }
.bids-table tr.st-awarded td { background: #dcfff1; } .bids-table tr.st-rejected td, .bids-table tr.st-not_a_bid td { opacity: .55; }
.bids-table .num, .bids-table input[type=number] { text-align: right; font-variant-numeric: tabular-nums; }
.bids-table .cell { width: 100%; min-width: 90px; padding: 4px 6px; border: 1px solid transparent; border-radius: 4px; background: transparent; }
.bids-table .cell:hover { border-color: var(--border); background: #fff; } .bids-table .cell:focus { border-color: var(--primary); background: #fff; outline: none; }
.pill-unpriced { font-size: 11px; background: #fff7d6; color: #6b4f00; padding: 2px 6px; border-radius: 10px; white-space: nowrap; }

/* Roadmap view */
.roadmap { background: rgba(255,255,255,.96); border-radius: 8px; padding: 12px; }
.rm-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rm-scroll { overflow: auto; border: 1px solid var(--border); border-radius: 6px; position: relative; max-height: calc(100vh - 220px); }
.rm-months, .rm-weeks { position: relative; height: 22px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.rm-months { position: sticky; top: 0; z-index: 3; } .rm-weeks { position: sticky; top: 22px; z-index: 3; }
.rm-month { position: absolute; top: 0; height: 22px; line-height: 22px; font-size: 12px; font-weight: 700; padding-left: 8px; border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.rm-week { position: absolute; top: 0; height: 22px; line-height: 22px; font-size: 11px; color: var(--text-3); padding-left: 6px; border-left: 1px dashed var(--border); white-space: nowrap; overflow: hidden; }
.rm-body { position: relative; }
.rm-lane-row { display: flex; border-bottom: 1px solid var(--border); position: relative; }
.rm-lane-label { position: sticky; left: 0; z-index: 2; width: 170px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border); padding: 8px 10px; font-weight: 600; font-size: 13px; }
.rm-lane { position: relative; flex: 1; }
.rm-bar { position: absolute; height: 24px; line-height: 20px; border-radius: 5px; background: #e9f2ff; border: 1px solid #b3d4ff; border-left: 4px solid var(--primary); padding: 1px 6px; font-size: 12px; display: flex; align-items: center; gap: 6px; cursor: pointer; overflow: hidden; white-space: nowrap; box-shadow: var(--shadow); }
.rm-bar:hover { filter: brightness(.96); z-index: 2; } .rm-bar.done { opacity: .6; text-decoration: line-through; } .rm-bar.overdue { background: #ffeceb; border-color: #f5b2ad; }
.rm-bar.cash.in { background: #e3fcef; border-color: #7ee2b8; } .rm-bar.cash.out { background: #fff3e6; border-color: #fbbf87; }
.rm-cash { font-weight: 700; font-size: 11px; padding: 0 5px; border-radius: 3px; background: rgba(0,0,0,.06); } .rm-bar.cash.in .rm-cash { color: var(--success); } .rm-bar.cash.out .rm-cash { color: var(--warning); }
.rm-amt { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.rm-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 1; } .rm-today span { position: absolute; top: 2px; left: 4px; font-size: 10px; color: var(--danger); font-weight: 700; }
.rm-bar .avatar.sm { width: 18px; height: 18px; font-size: 9px; }

/* Plans view */
.plans-view { background: rgba(255,255,255,.96); border-radius: 8px; padding: 12px; }
.plans-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.plans-body { display: grid; grid-template-columns: 260px 1fr; gap: 14px; align-items: start; }
@media (max-width: 760px) { .plans-body { grid-template-columns: 1fr; } }
.plans-side { display: flex; flex-direction: column; gap: 6px; }
.plan-item { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.plan-item:hover { background: var(--surface-2); } .plan-item.active { border-color: var(--primary); background: #e9f2ff; }
.plan-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 4px; background: var(--surface-2); flex-shrink: 0; } .plan-thumb.file { display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.plan-suggest { margin-top: 8px; padding: 8px; background: var(--surface-2); border-radius: 6px; }
.plan-panel { min-width: 0; }
.plan-stage { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; user-select: none; }
.plan-stage img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
.plan-stage.drawing { cursor: crosshair; } .plan-stage.drawing .zone { pointer-events: none; }
.plan-overlay { position: absolute; inset: 0; }
.plan-file { padding: 30px; text-align: center; color: var(--text-2); }
.zone { position: absolute; border: 2px solid var(--primary); background: rgba(12,102,228,.08); border-radius: 3px; cursor: pointer; }
.zone:hover { background: rgba(12,102,228,.16); } .zone.new { border-style: dashed; }
.zone-label { position: absolute; left: 0; top: 0; transform: translateY(-100%); font-size: 11px; background: rgba(255,255,255,.92); padding: 1px 6px; border-radius: 3px 3px 0 0; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.zone-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.08); } .zone-bar > span { display: block; height: 100%; }
.zone-bar.wide { position: static; height: 6px; border-radius: 3px; overflow: hidden; margin: 4px 0; }
.zone-list { display: flex; flex-direction: column; gap: 6px; }
.zone-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; }
.zone-row .dot { width: 10px; height: 10px; border-radius: 5px; margin-top: 5px; flex-shrink: 0; }
.photo-strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; }
.photo-strip a { flex-shrink: 0; text-align: center; font-size: 10px; color: var(--text-3); }
.photo-strip img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; display: block; border: 1px solid var(--border); }
/* Inventory view */
.inv-view { background: rgba(255,255,255,.96); border-radius: 8px; padding: 12px; }
.inv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.inv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.inv-stat { background: var(--surface-2); border-radius: 6px; padding: 8px 10px; } .inv-stat .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; } .inv-stat .l { font-size: 11px; color: var(--text-3); }
.inv-section h4 { margin: 12px 0 6px; font-size: 14px; }
.inv-scroll { overflow-x: auto; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
.inv-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.inv-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.inv-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; } .inv-table .owing { color: var(--danger); font-weight: 700; }
.inv-table .cell { padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; background: #fff; font-size: 12px; }
.pill-unit { font-size: 11px; background: var(--surface-2); padding: 1px 6px; border-radius: 10px; }
.inv-flag { display: inline-block; font-size: 11px; background: #fff7d6; color: #6b4f00; padding: 1px 6px; border-radius: 10px; margin: 1px 2px 1px 0; white-space: nowrap; } .inv-flag.bad { background: #ffeceb; color: var(--danger); }
.inv-table tr.st-sold td, .inv-table tr.st-turned_over td { background: #f6fbf7; } .inv-table tr.st-vacant td { background: #fffaf0; }
.inv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; } .inv-grid .field { margin-top: 4px; }
.inv-pays { max-height: 160px; overflow: auto; }

.plan-group { margin-bottom: 8px; } .plan-group-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; padding: 4px 6px; color: var(--text-2); }
.zone-group { border: 1px solid var(--border); border-radius: 6px; padding: 6px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.zone-group-title { display: flex; align-items: center; gap: 4px; padding: 2px 4px; }

.rv-box { border: 1px solid var(--border); border-radius: 6px; padding: 8px; margin-bottom: 10px; background: var(--surface-2); }
.rv-row { padding: 5px 0; border-top: 1px dashed var(--border); } .rv-row:first-of-type { border-top: 0; } .rv-row select.input { padding: 2px 6px; font-size: 12px; }
.rm-note { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; padding: 6px 0; border-top: 1px solid var(--border); } .rm-note .when { color: var(--text-3); white-space: nowrap; font-size: 11px; }
.rm-lane-label .rm-add { opacity: 0; font-weight: 400; font-size: 11px; color: var(--primary); cursor: pointer; display: block; } .rm-lane-row:hover .rm-add { opacity: 1; }
.photo-groups { display: flex; flex-direction: column; gap: 10px; } .photo-group h4 { margin: 0 0 4px; font-size: 13px; } .photo-group .photo-strip img { width: 96px; height: 72px; }
.photo-zone { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; margin-bottom: 6px; } .photo-zone .ttl { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 4px; }
.photo-groups .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.rm-bar { touch-action: none; user-select: none; } .rm-bar.dragging { opacity: .85; box-shadow: 0 4px 12px rgba(0,0,0,.25); z-index: 5; cursor: grabbing; }
.rm-handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; } .rm-handle.l { left: 0; } .rm-handle.r { right: 0; } .rm-bar:hover .rm-handle { background: rgba(0,0,0,.08); }

.con-table .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; } .con-table td:first-child { width: 14px; } .con-unit td { background: var(--surface-2); }
.con-reports { display: flex; flex-direction: column; gap: 8px; } .con-report { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.con-report-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; } .con-report-body { font-size: 13px; margin-top: 4px; white-space: pre-wrap; }
.con-pct { color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 10px; font-weight: 600; }
.con-ledger { min-width: 1250px; } .con-flagged td { background: #fffaf0; } .con-ledger .owing { color: var(--warning-text); font-weight: 600; }

.con-search { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; min-width: 280px; flex: 1; max-width: 420px; } .con-search input { border: 0; box-shadow: none; flex: 1; min-width: 0; } .con-search input:focus { outline: none; }
.con-prices { min-width: 1100px; } .con-price-row { cursor: pointer; } .con-price-row:hover td { background: var(--surface-2); }
.con-chg.up { color: #c9372c; } .con-chg.down { color: var(--success); } .con-sup { font-size: 11px; background: var(--surface-2); border-radius: 10px; padding: 1px 7px; white-space: nowrap; } .con-sup.best { background: #e3fcef; color: #216e4e; font-weight: 600; }
.con-hist td { background: #fafbfc; padding: 4px 8px 8px 28px; } .con-hist-table { width: 100%; font-size: 12px; border-collapse: collapse; } .con-hist-table th { text-align: left; font-weight: 600; color: var(--text-3); padding: 2px 6px; } .con-hist-table td { padding: 3px 6px; border-top: 1px solid var(--border); background: transparent; }
.con-src { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; padding: 1px 5px; border-radius: 3px; background: var(--surface-2); } .con-src.purchase { background: #e9f2ff; color: #0c4a9e; } .con-src.quote { background: #fff3e6; color: #8a4b00; }
@media (max-width: 700px) { .con-search { min-width: 0; max-width: none; } }
.bids-others { margin-top: 14px; padding-top: 10px; border-top: 2px dashed var(--border); } .bids-others h4 { margin: 0 0 6px; font-size: 14px; } .bids-table.others { min-width: 760px; }
.bids-bulk { gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; flex-wrap: wrap; }

.modal.preview-modal { width: min(1100px, 96vw); max-width: none; padding: 0; background: #1d2125; color: #fff; }
.preview { display: flex; flex-direction: column; height: min(88vh, 900px); }
.preview-head { display: flex; align-items: center; gap: 6px; padding: 10px 44px 10px 14px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.12); } .preview-head .btn { background: rgba(255,255,255,.12); color: #fff; border-color: transparent; } .preview-head .btn:hover { background: rgba(255,255,255,.2); }
.preview-title { font-weight: 600; max-width: 70%; }
.preview-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #0f1215; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; } .preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-fallback { text-align: center; padding: 30px; color: #fff; } .preview-fallback .muted { color: #b6c2cf; } .preview-fallback svg { width: 40px; height: 40px; opacity: .7; }
.modal.preview-modal .modal-close { color: #fff; }
@media (max-width: 700px) { .modal.preview-modal { width: 100vw; } .preview { height: 92vh; } .preview-title { max-width: 55%; } }

.cmp-table { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 700px; background: #fff; border-radius: 8px; overflow: hidden; }
.cmp-table th, .cmp-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); vertical-align: top; min-width: 170px; }
.cmp-table th { background: var(--surface-2); text-align: left; font-weight: 600; } .cmp-table th.lowest, .cmp-table td.lowest { background: #e3fcef; }
.cmp-rowhead { position: sticky; left: 0; background: #fff; font-weight: 600; min-width: 220px; max-width: 320px; z-index: 1; } .cmp-table th.cmp-rowhead { background: var(--surface-2); }
.cmp-contractor { font-size: 14px; }
.cmp-cell .cmp-mark { display: inline-block; width: 18px; font-weight: 700; } .cmp-cell.yes .cmp-mark { color: var(--success); } .cmp-cell.no .cmp-mark { color: var(--danger); } .cmp-cell.no { background: #fff6f5; } .cmp-cell.maybe .cmp-mark { color: var(--warning-text); } .cmp-cell.none { color: var(--text-3); }
.cmp-cell:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.cmp-total td { background: var(--surface-2); font-size: 14px; } .cmp-text td { font-size: 12px; }
