/* ---------- shared: right drawer, view cards ---------- */
.drawer { position: fixed; top: 48px; right: 0; bottom: 0; width: 400px; background: #fff; box-shadow: -6px 0 20px rgba(0,0,0,.12); z-index: 450; display: flex; flex-direction: column; animation: slidein .2s var(--ease); }
.drawer .dh { display: flex; align-items: center; gap: 8px; padding: 20px 20px 12px; border-bottom: 1px solid var(--border); }
.drawer .dh h3 { flex: 1; font-size: 20px; }
.drawer .db { flex: 1; overflow: auto; padding: 8px 20px 24px; }
.drawer .dsec { border-bottom: 1px solid var(--border); padding: 12px 0; }
.drawer .dsec h4 { margin: 0 0 8px; font-size: 15px; font-weight: 500; }
.drawer .dsec label.ck { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; }
.drawer .dsec select, .drawer .dsec input[type=text], .drawer .dsec input[type=number], .drawer .dsec input[type=date] { width: 100%; height: 32px; border: 1px solid var(--ui-border); border-radius: 4px; padding: 0 8px; background: #fff; }
.drawer .dsec .row2 { display: flex; gap: 8px; }
.vwrap { flex: 1; min-height: 0; overflow: auto; padding: 0 32px 40px 40px; }
.vcard { border: 1px solid var(--border); border-radius: 8px; background: #fff; display: flex; flex-direction: column; min-height: 0; }
.vcard .vch { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); flex: none; }
.vcard .vch h3 { font-size: 18px; font-weight: 500; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .vch .seg button { padding: 4px 10px; }
.vcard .vch select { height: 32px; border: 1px solid var(--ui-border); border-radius: 4px; padding: 0 8px; background: #fff; }
.miss { text-align: center; padding: 60px 20px; color: var(--text2); }
.miss h3 { color: var(--text); font-size: 18px; margin-bottom: 8px; }

/* ---------- kanban ---------- */
.kb-wrap { flex: 1; min-height: 0; overflow: auto; padding: 0 32px 24px 40px; display: flex; gap: 16px; align-items: flex-start; }
.kb-col { width: 260px; flex: none; background: var(--grey-bg); border-radius: 8px; display: flex; flex-direction: column; max-height: 100%; min-height: 400px; }
.kb-col.over { box-shadow: inset 0 0 0 2px var(--primary); }
.kb-head { height: 40px; border-radius: 8px 8px 0 0; color: #fff; font-weight: 500; font-size: 15px; display: flex; align-items: center; gap: 8px; padding: 0 10px; flex: none; }
.kb-head .kc { font-weight: 400; opacity: .9; }
.kb-cards { padding: 12px; display: flex; flex-direction: column; gap: 8px; overflow: auto; flex: 1; }
.kb-card { width: 236px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.kb-card:hover { box-shadow: var(--sh-xs), 0 2px 8px rgba(0,0,0,.08); }
.kb-card.dragging { opacity: .4; }
.kb-card .kt { font-size: 14px; line-height: 18px; word-wrap: break-word; }
.kb-card .kchips { display: flex; flex-wrap: wrap; gap: 6px; }
.kchip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 4px; background: var(--grey-bg); border: 1px solid #e7e9ef; font-size: 13px; position: relative; overflow: hidden; max-width: 100%; white-space: nowrap; }
.kchip.st { padding-left: 10px; }
.kchip.st::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.kchip .ic { color: var(--text2); }
.kb-card .kfoot { display: flex; align-items: center; justify-content: space-between; min-height: 26px; }
.kb-card .kicons { display: flex; gap: 10px; color: var(--text2); margin-left: auto; align-items: center; font-size: 12px; }
.kb-card .kicons span { display: flex; align-items: center; gap: 2px; }
.kb-add { margin: 0 12px 12px; display: flex; align-items: center; gap: 6px; color: var(--text2); padding: 6px 8px; border-radius: 4px; }
.kb-add:hover { background: var(--hover); }
.kb-addin { margin: 0 12px 12px; }
.kbattery { display: flex; width: 140px; height: 24px; border-radius: 2px; overflow: hidden; margin-right: 4px; }
.kbattery i { display: block; height: 100%; }

/* ---------- calendar ---------- */
.cal { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); flex: none; }
.cal-head div { text-align: center; padding: 8px 0; font-size: 15px; border-right: 1px solid var(--border); }
.cal-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(90px, 1fr); overflow: auto; }
.cal-day { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px 2px; position: relative; min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 3px; }
.cal-day.other { background: #fafbfc; }
.cal-day.other .dn { color: var(--disabled); }
.cal-day.over { background: var(--highlight); }
.cal-day .dn { text-align: right; padding: 2px 6px 0; font-size: 15px; }
.cal-day .dn.today span { background: var(--primary); color: #fff; border-radius: 4px; padding: 1px 6px; }
.cal-day .cadd { position: absolute; left: 6px; top: 4px; display: none; color: var(--primary); font-size: 13px; align-items: center; gap: 2px; }
.cal-day:hover .cadd { display: flex; }
.cal-item { height: 22px; border-radius: 4px; color: #fff; font-weight: 600; font-size: 13px; padding: 0 8px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; flex: none; margin: 0 2px; }
.cal-item.cont { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -3px; }
.cal-item.tail { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: -3px; }
.cal-more { font-size: 12px; color: var(--text2); padding: 0 8px; cursor: pointer; }
.cal-legend { display: flex; gap: 18px; justify-content: center; padding: 10px; font-size: 14px; flex: none; }
.cal-legend span { display: flex; align-items: center; gap: 6px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.cal-week .cal-grid { grid-auto-rows: 1fr; }
.cal-week .cal-day { min-height: 300px; }
.cal-title { font-size: 16px; min-width: 150px; text-align: center; }

/* ---------- gantt / timeline ---------- */
.gt-card { margin: 0 32px 24px 40px; flex: 1; min-height: 0; }
.gt { flex: 1; overflow: auto; position: relative; }
.gt-inner { position: relative; width: max-content; min-width: 100%; }
.gt-row { display: flex; height: 36px; }
.gt-left { position: sticky; left: 0; z-index: 3; width: 300px; flex: none; background: #fff; border-right: 1px solid var(--border); display: flex; align-items: center; gap: 8px; padding: 0 12px 0 28px; font-size: 14px; }
.gt-left .gn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.gt-left .gn:hover { color: var(--primary); }
.gt-left .gd { color: var(--text); font-size: 14px; }
.gt-row.gt-grp .gt-left { font-family: var(--title); font-weight: 500; font-size: 15px; padding-left: 12px; }
.gt-track { position: relative; flex: none; }
.gt-head { position: sticky; top: 0; z-index: 4; height: 64px; background: #fff; border-bottom: 1px solid var(--border); }
.gt-head .gt-left { z-index: 5; }
.gt-head .gt-track { height: 64px; }
.gt-top, .gt-bot { position: absolute; left: 0; right: 0; display: flex; }
.gt-top { top: 0; height: 32px; } .gt-bot { top: 32px; height: 32px; }
.gt-top div { position: absolute; top: 0; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 14px; white-space: nowrap; overflow: hidden; color: var(--text2); }
.gt-top div b { font-weight: 600; color: var(--text); margin-right: 4px; }
.gt-bot div { position: absolute; top: 0; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text2); border-right: 1px solid #eceef5; white-space: nowrap; overflow: hidden; }
.gt-bot div.today { color: var(--primary); font-weight: 600; }
.gt-bar { position: absolute; top: 7px; height: 22px; border-radius: 4px; cursor: grab; display: flex; align-items: center; color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; user-select: none; }
.gt-bar span.lab { overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.gt-bar .gt-out { position: absolute; left: 100%; margin-left: 8px; color: var(--text); font-weight: 400; font-size: 13px; }
.gt-bar .h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.gt-bar .h.l { left: 0; } .gt-bar .h.r { right: 0; }
.gt-bar:hover .h { background: rgba(0,0,0,.15); }
.gt-bar.ms { width: 16px !important; height: 16px; top: 10px; transform: rotate(45deg); border-radius: 3px; }
.gt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--primary); z-index: 2; pointer-events: none; }
.gt-today::before { content: ''; position: absolute; top: 0; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }

/* ---------- chart ---------- */
.chart-box { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 16px; flex: 1; min-height: 0; }
.chart-box svg { max-width: 100%; max-height: 100%; }
.chart-legend { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.chart-legend span { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.chart-legend i { width: 12px; height: 12px; border-radius: 50%; display: block; flex: none; }
.chart-svg text { font-family: var(--font); fill: var(--text2); font-size: 11px; }
.chart-svg .val { fill: var(--text); font-size: 12px; font-weight: 600; }
.chart-type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chart-type-grid button { border: 1px solid var(--border); border-radius: 4px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.chart-type-grid button.on { border-color: var(--primary); background: var(--highlight); color: var(--primary); }

/* ---------- files gallery / cards ---------- */
.fg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.fg-card { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; }
.fg-card:hover { box-shadow: var(--sh-xs), 0 2px 8px rgba(0,0,0,.08); }
.fg-card .fp { height: 140px; background: var(--grey-bg); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; color: var(--text2); }
.fg-card .fp img, .fg-card .fp video { width: 100%; height: 100%; object-fit: cover; }
.fg-card .fi { padding: 8px 12px; }
.fg-card .fi b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-card .fi small { color: var(--text2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.icard { border: 1px solid var(--border); border-radius: 8px; background: #fff; overflow: hidden; }
.icard .ich { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); border-top: 4px solid var(--gc); }
.icard .ich b { flex: 1; font-weight: 500; font-size: 15px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icard .icr { display: grid; grid-template-columns: 110px 1fr; align-items: center; border-bottom: 1px solid #eceef5; }
.icard .icr:last-child { border-bottom: 0; }
.icard .icr .k { color: var(--text2); font-size: 13px; padding: 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icard .icr .cell { border: 0; height: 34px; }

/* ---------- workload ---------- */
.wl { border: 1px solid var(--border); border-radius: 8px; overflow: auto; background: #fff; }
.wl table { border-collapse: collapse; width: 100%; }
.wl th, .wl td { border-bottom: 1px solid var(--border); border-right: 1px solid #eceef5; height: 52px; text-align: center; font-weight: 400; font-size: 13px; min-width: 56px; }
.wl th { height: 40px; color: var(--text2); position: sticky; top: 0; background: #fff; z-index: 1; }
.wl th.today { color: var(--primary); font-weight: 600; }
.wl td.who { text-align: left; padding: 0 16px; min-width: 200px; position: sticky; left: 0; background: #fff; }
.wl td.who div { display: flex; align-items: center; gap: 10px; }
.wl td.wk { background: #fafbfc; }
.wl .wbox { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 30px; border-radius: 4px; background: #00c875; color: #fff; font-weight: 600; cursor: pointer; padding: 0 6px; }
.wl .wbox.mid { background: #fdab3d; }
.wl .wbox.over { background: #df2f4a; }

/* ---------- form ---------- */
.fv-bar { display: flex; align-items: center; gap: 8px; padding: 12px 32px 12px 40px; flex: none; }
.fv-bar .seg button { padding: 6px 16px; }
.fv-body { flex: 1; min-height: 0; overflow: auto; background: var(--grey-bg); display: flex; }
.fv-edit-side { width: 300px; flex: none; background: #fff; border-right: 1px solid var(--border); overflow: auto; padding: 16px; }
.fv-edit-side h4 { margin: 12px 0 8px; font-weight: 500; font-size: 15px; }
.fv-q { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.fv-q:hover { background: var(--hover); }
.fv-q.on { background: var(--selected); }
.fv-q .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-q.off .n { color: var(--disabled); text-decoration: line-through; }
.fv-canvas { flex: 1; overflow: auto; padding: 32px 20px 60px; }
.form-card { max-width: 720px; margin: 0 auto; background: #fff; border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,.08); overflow: hidden; }
.form-card .fcover { height: 160px; background-size: cover; background-position: center; }
.form-card .fbody { padding: 36px 48px 40px; }
.form-card h1 { font-family: var(--title); font-size: 30px; font-weight: 500; margin-bottom: 8px; outline: 0; }
.form-card .fdesc { color: var(--text2); margin-bottom: 28px; outline: 0; white-space: pre-wrap; min-height: 20px; }
.form-card .fq { margin-bottom: 26px; }
.form-card .fq.sel { outline: 2px solid var(--primary); outline-offset: 10px; border-radius: 2px; }
.form-card .fq label.ql { display: block; font-size: 16px; margin-bottom: 8px; }
.form-card .fq label.ql .req { color: var(--negative); }
.form-card .fq .qd { color: var(--text2); font-size: 13px; margin: -4px 0 8px; }
.form-card .fq input:not([type=checkbox]):not([type=radio]), .form-card .fq textarea, .form-card .fq select { width: 100%; height: 44px; border: 1px solid var(--ui-border); border-radius: 4px; padding: 0 12px; font-size: 15px; background: #fff; outline: 0; }
.form-card .fq textarea { height: 110px; padding: 10px 12px; resize: vertical; }
.form-card .fq input:focus, .form-card .fq textarea:focus, .form-card .fq select:focus { border-color: var(--accent, var(--primary)); }
.form-card .fopts { display: flex; flex-wrap: wrap; gap: 8px; }
.form-card .fopts button { border: 1px solid var(--ui-border); border-radius: 4px; padding: 8px 14px; font-size: 14px; background: #fff; }
.form-card .fopts button.on { border-color: var(--accent, var(--primary)); background: var(--accent, var(--primary)); color: #fff; }
.form-card .fstars { font-size: 28px; color: #e7e9ef; cursor: pointer; letter-spacing: 3px; }
.form-card .fstars .on { color: #ffcb00; }
.form-card .fsubmit { background: var(--accent, var(--primary)); color: #fff; height: 44px; padding: 0 32px; border-radius: 4px; font-size: 16px; }
.form-card .ferr { color: var(--negative); font-size: 13px; margin-top: 6px; }
.form-card .thanks { text-align: center; padding: 60px 20px; }
.form-card .thanks h1 { margin-bottom: 12px; }
.public-form { min-height: 100vh; background: var(--grey-bg); padding: 40px 16px; overflow: auto; height: 100vh; }
.public-form .powered { text-align: center; color: var(--text2); font-size: 13px; margin-top: 18px; }

/* ---------- dashboards ---------- */
.dash-head { display: flex; align-items: center; gap: 8px; padding: 20px 32px 12px 36px; flex: none; }
.dash-head h1 { font-size: 30px; font-weight: 500; padding: 0 4px; border: 1px solid transparent; border-radius: 4px; cursor: text; }
.dash-head h1:hover { border-color: var(--border); }
.dash-tb { display: flex; align-items: center; gap: 8px; padding: 0 32px 14px 36px; border-bottom: 1px solid var(--border); flex: none; }
.dash-tb .dfilter { display: flex; align-items: center; gap: 6px; height: 32px; border: 1px solid var(--ui-border); border-radius: 4px; padding: 0 8px; width: 186px; }
.dash-tb .dfilter input { border: 0; outline: 0; flex: 1; min-width: 0; }
.dash-body { flex: 1; overflow: auto; background: var(--grey-bg); padding: 12px; }
.dgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; grid-auto-flow: dense; }
.widget { background: #fff; border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; min-height: 190px; min-width: 0; overflow: hidden; }
.widget.tall { min-height: 380px; }
.widget.drop { box-shadow: 0 0 0 2px var(--primary); }
.widget .wh { display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--border); flex: none; cursor: grab; }
.widget .wh h3 { font-family: var(--title); font-size: 18px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget .wh .wf { color: var(--text2); width: 26px; height: 26px; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.widget .wh .wf.on { background: var(--selected); color: var(--primary); }
.widget .wh .sp { flex: 1; }
.widget .wb { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.w-num { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 40px; font-family: var(--font); color: var(--text); padding: 20px; }
.w-num small { font-size: 22px; color: var(--text2); margin: 0 4px; }
.w-batt { padding: 30px 24px; }
.w-batt .bar { display: flex; height: 36px; border-radius: 4px; overflow: hidden; background: #c4c4c4; }
.w-batt .bar i { display: block; height: 100%; }
.w-batt .pct { font-size: 30px; margin-bottom: 10px; }
.w-batt .lg { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--text2); }
.w-batt .lg span { display: flex; gap: 6px; align-items: center; }
.w-batt .lg i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.w-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.w-table th { position: sticky; top: 0; background: #fff; color: var(--text2); font-weight: 400; text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.w-table td { padding: 0 12px; height: 38px; border-bottom: 1px solid #eceef5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.w-table tr:hover td { background: var(--grey-bg); cursor: pointer; }
.w-table td.st { color: #fff; text-align: center; }
.w-count { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.w-count .big { font-size: 46px; font-family: var(--title); }
.w-count .units { display: flex; gap: 22px; }
.w-count .units div { text-align: center; } .w-count .units b { display: block; font-size: 32px; font-weight: 500; } .w-count .units small { color: var(--text2); }
.w-text { padding: 16px 20px; outline: 0; flex: 1; line-height: 22px; }
.w-todo { padding: 10px 16px; }
.w-todo .tr { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #eceef5; }
.w-todo .tr.done span { text-decoration: line-through; color: var(--text2); }
.w-todo .tr span { flex: 1; }
.w-todo input.add { width: 100%; border: 0; outline: 0; padding: 8px 0; }
.w-feed .fr { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #eceef5; cursor: pointer; }
.w-feed .fr:hover { background: var(--grey-bg); }
.w-feed .fr div { flex: 1; min-width: 0; font-size: 14px; }
.w-feed .fr small { color: var(--text2); display: block; }
.w-mcal { display: grid; grid-template-columns: repeat(7, 1fr); flex: 1; }
.w-mcal .h { text-align: center; color: var(--text2); font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.w-mcal .d { border-right: 1px solid #eceef5; border-bottom: 1px solid #eceef5; min-height: 64px; padding: 2px; overflow: hidden; }
.w-mcal .d .n { font-size: 12px; text-align: right; padding: 0 4px; color: var(--text2); }
.w-mcal .d .n.t { color: var(--primary); font-weight: 600; }
.w-mcal .d .e { font-size: 11px; color: #fff; border-radius: 3px; padding: 1px 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.wpick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 360px; padding: 12px; }
.wpick button { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 4px; border: 1px solid var(--border); text-align: left; }
.wpick button:hover { background: var(--hover); }
.dash-empty { text-align: center; padding: 80px 20px; color: var(--text2); }
.dash-empty h3 { color: var(--text); font-size: 20px; margin-bottom: 8px; }
.doc-fallback { max-width: 820px; margin: 0 auto; padding: 32px 20px; }
.doc-fallback h1 { font-size: 32px; font-weight: 600; margin-bottom: 16px; }
.doc-fallback .ed { min-height: 300px; outline: 0; line-height: 24px; font-size: 16px; }
