/* JustPimps - calm, Notion-like workspace */
:root {
  --bg: #ffffff; --side: #f7f7f5; --text: #37352f; --muted: #787774; --faint: #a5a29d;
  --line: #e9e9e7; --line-soft: #f1f1ef; --hover: rgba(55, 53, 47, .06); --hover-2: rgba(55, 53, 47, .1);
  --accent: #2383e2; --accent-text: #fff; --navy: #10294A; --gold: #B59356;
  --danger: #eb5757; --ok: #448361; --pop: #fff; --shadow: 0 0 0 1px rgba(15,15,15,.05), 0 3px 6px rgba(15,15,15,.1), 0 9px 24px rgba(15,15,15,.2);
  --t-default-bg: rgba(206,205,202,.5); --t-default: #37352f;
  --t-gray-bg: #e3e2e0; --t-gray: #32302c; --t-brown-bg: #eee0da; --t-brown: #442a1e;
  --t-orange-bg: #fadec9; --t-orange: #49290e; --t-yellow-bg: #fdecc8; --t-yellow: #402c1b;
  --t-green-bg: #dbeddb; --t-green: #1c3829; --t-blue-bg: #d3e5ef; --t-blue: #183347;
  --t-purple-bg: #e8deee; --t-purple: #412454; --t-pink-bg: #f5e0e9; --t-pink: #4c2337;
  --t-red-bg: #ffe2dd; --t-red: #5d1715;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919; --side: #202020; --text: rgba(255,255,255,.81); --muted: rgba(255,255,255,.46); --faint: rgba(255,255,255,.28);
    --line: #2f2f2f; --line-soft: #252525; --hover: rgba(255,255,255,.055); --hover-2: rgba(255,255,255,.1);
    --pop: #252525; --shadow: 0 0 0 1px rgba(255,255,255,.07), 0 3px 6px rgba(0,0,0,.3), 0 9px 24px rgba(0,0,0,.5);
    --t-default-bg: rgba(255,255,255,.094); --t-default: rgba(255,255,255,.81);
    --t-gray-bg: #373737; --t-gray: rgba(255,255,255,.81); --t-brown-bg: #4a3228; --t-brown: rgba(255,255,255,.81);
    --t-orange-bg: #5c3b23; --t-orange: rgba(255,255,255,.81); --t-yellow-bg: #564328; --t-yellow: rgba(255,255,255,.81);
    --t-green-bg: #243d30; --t-green: rgba(255,255,255,.81); --t-blue-bg: #143a4e; --t-blue: rgba(255,255,255,.81);
    --t-purple-bg: #3c2d49; --t-purple: rgba(255,255,255,.81); --t-pink-bg: #4e2c3c; --t-pink: rgba(255,255,255,.81);
    --t-red-bg: #522e2a; --t-red: rgba(255,255,255,.81);
  }
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(35,131,226,.28); }

/* ---------- layout */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 10px 8px; gap: 1px; overflow-y: auto; border-right: 1px solid var(--line-soft); }
.ws { display: flex; align-items: center; gap: 8px; padding: 6px 8px 12px; font-weight: 600; }
.ws .badge { background: var(--navy); color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .05em;
  border-radius: 4px; padding: 3px 5px; }
.side .sec { font-size: 12px; color: var(--muted); font-weight: 500; padding: 14px 8px 4px; }
.side a.nav { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 6px; color: var(--muted);
  text-decoration: none; font-weight: 500; min-height: 30px; }
.side a.nav:hover { background: var(--hover); }
.side a.nav.active { background: var(--hover-2); color: var(--text); }
.side a.nav .ico { width: 20px; text-align: center; font-size: 15px; }
.side .grow { flex: 1; }
.side .me { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 6px; }
.side .me .who { flex: 1; min-width: 0; line-height: 1.25; }
.side .me .who small { color: var(--muted); display: block; font-size: 12px; }
.side .me button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 4px 6px; border-radius: 4px; }
.side .me button:hover { background: var(--hover); }
main { min-width: 0; padding: 40px 56px 120px; }
.page { max-width: 1180px; margin: 0 auto; }
.page.narrow { max-width: 860px; }
.page-ico { font-size: 44px; line-height: 1; margin-bottom: 8px; }
h1 { font-size: 32px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.01em; line-height: 1.2; }
h2 { font-size: 18px; font-weight: 600; margin: 32px 0 6px; }
h3 { font-size: 12px; font-weight: 500; color: var(--muted); margin: 24px 0 6px; }
.sub { color: var(--muted); margin-bottom: 18px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.empty { color: var(--faint); padding: 14px 2px; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted);
  padding: 4px 8px; border-radius: 5px; cursor: pointer; font-size: 14px; white-space: nowrap; min-height: 28px; text-decoration: none; }
.btn:hover { background: var(--hover); color: var(--text); }
.btn.on { color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-text); font-weight: 500; padding: 4px 10px; }
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.outline { border: 1px solid var(--line); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
input.plain, select.plain, textarea.plain { border: 0; background: transparent; outline: none; width: 100%; padding: 4px 6px; border-radius: 4px; }
input.box, select.box, textarea.box { border: 1px solid var(--line); background: var(--bg); border-radius: 5px; padding: 5px 8px; outline: none; width: 100%; }
input.box:focus, select.box:focus, textarea.box:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(35,131,226,.25); }

/* ---------- tags */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 3px; font-size: 13px; line-height: 20px;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; background: var(--t-default-bg); color: var(--t-default); }
.tag.c-gray { background: var(--t-gray-bg); color: var(--t-gray); } .tag.c-brown { background: var(--t-brown-bg); color: var(--t-brown); }
.tag.c-orange { background: var(--t-orange-bg); color: var(--t-orange); } .tag.c-yellow { background: var(--t-yellow-bg); color: var(--t-yellow); }
.tag.c-green { background: var(--t-green-bg); color: var(--t-green); } .tag.c-blue { background: var(--t-blue-bg); color: var(--t-blue); }
.tag.c-purple { background: var(--t-purple-bg); color: var(--t-purple); } .tag.c-pink { background: var(--t-pink-bg); color: var(--t-pink); }
.tag.c-red { background: var(--t-red-bg); color: var(--t-red); }
.tag.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .55; }
.tag .x { cursor: pointer; opacity: .6; margin-left: 2px; }
.tag .x:hover { opacity: 1; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.nowrap .tags { flex-wrap: nowrap; overflow: hidden; }
.av { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 10px;
  font-weight: 600; flex: none; }
.av.lg { width: 26px; height: 26px; font-size: 11px; }
.person { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.due-over { color: var(--danger); }
.due-today { color: #d9730d; }
.money-in { color: var(--ok); }
.check { width: 16px; height: 16px; border-radius: 3px; border: 1.5px solid var(--faint); display: inline-grid; place-items: center; font-size: 11px; }
.check.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.stars { letter-spacing: 1px; color: var(--gold); }
.stars .off { color: var(--line); }

/* ---------- views bar + toolbar */
.viewbar { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); margin: 14px 0 0; flex-wrap: wrap; }
.viewbar .vt { border: 0; background: none; padding: 6px 8px 8px; color: var(--muted); cursor: pointer; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 4px 4px 0 0; display: inline-flex; gap: 6px; align-items: center; }
.viewbar .vt:hover { background: var(--hover); }
.viewbar .vt.on { color: var(--text); border-bottom-color: var(--text); }
.viewbar .tools { margin-left: auto; display: flex; align-items: center; gap: 2px; padding-bottom: 4px; }
.viewbar .search { width: 0; padding: 0; border: 0; transition: width .15s; background: transparent; outline: none; }
.viewbar .search.open { width: 180px; padding: 3px 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 14px; padding: 1px 4px 1px 10px;
  font-size: 13px; color: var(--accent); background: rgba(35,131,226,.06); }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; border-radius: 50%; width: 20px; height: 20px; }
.chip button:hover { background: var(--hover); }

/* ---------- database table */
.tbl-wrap { overflow-x: auto; margin-top: 2px; padding-bottom: 6px; }
table.db { border-collapse: collapse; min-width: 100%; table-layout: fixed; }
table.db th, table.db td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left;
  padding: 0; vertical-align: top; }
table.db th:last-child, table.db td:last-child { border-right: 0; }
table.db th { font-weight: 400; color: var(--muted); font-size: 14px; height: 33px; }
table.db th .h { display: flex; align-items: center; gap: 6px; padding: 6px 8px; cursor: pointer; white-space: nowrap; overflow: hidden; }
table.db th .h:hover { background: var(--hover); }
table.db th .h .ti { opacity: .65; font-size: 12px; width: 14px; text-align: center; flex: none; }
table.db th.add .h { justify-content: center; }
table.db td .c { padding: 6px 8px; min-height: 33px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: default; }
table.db td.ed .c { cursor: pointer; }
table.db td.ed:hover .c { background: var(--hover); }
table.db td.title .c { font-weight: 500; display: flex; align-items: center; gap: 6px; }
table.db td.title .c .t { overflow: hidden; text-overflow: ellipsis; }
table.db td.title .open { margin-left: auto; visibility: hidden; border: 1px solid var(--line); background: var(--bg); border-radius: 4px;
  font-size: 11px; font-weight: 600; color: var(--muted); padding: 0 6px; cursor: pointer; letter-spacing: .03em; flex: none; }
table.db tr:hover td.title .open { visibility: visible; }
table.db td.num .c { text-align: right; font-variant-numeric: tabular-nums; }
table.db tr.newrow td { border-bottom: 0; }
table.db tr.newrow .c { color: var(--faint); cursor: pointer; }
table.db tr.newrow:hover .c { background: var(--hover); }
table.db tr.calc td .c { color: var(--muted); font-size: 12px; text-align: right; }
.group-h { display: flex; align-items: center; gap: 8px; padding: 18px 0 6px; font-weight: 500; }

/* ---------- board */
.board { display: flex; gap: 12px; overflow-x: auto; padding: 10px 0 12px; align-items: flex-start; }
.bcol { width: 262px; flex: none; border-radius: 6px; padding: 2px; }
.bcol.drop { background: var(--hover); }
.bcol .bh { display: flex; align-items: center; gap: 8px; padding: 4px 4px 8px; }
.bcol .bh .n { color: var(--muted); font-size: 13px; }
.card { background: var(--bg); border-radius: 6px; box-shadow: rgba(15,15,15,.1) 0 0 0 1px, rgba(15,15,15,.1) 0 2px 4px;
  padding: 8px 10px; margin-bottom: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
@media (prefers-color-scheme: dark) { .card { background: #252525; box-shadow: rgba(255,255,255,.07) 0 0 0 1px; } }
.card:hover { background: var(--side); }
.card .ct { font-weight: 500; word-break: break-word; }
.card img { width: calc(100% + 20px); margin: -8px -10px 2px; border-radius: 6px 6px 0 0; aspect-ratio: 16/9; object-fit: cover; display: block; }
.card .cp { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bcol .add { width: 100%; justify-content: flex-start; color: var(--faint); }

/* ---------- popovers & menus */
.pop { position: fixed; z-index: 80; background: var(--pop); border-radius: 6px; box-shadow: var(--shadow); min-width: 220px;
  max-width: 360px; max-height: 420px; overflow: auto; padding: 4px 0; }
.pop .ph { font-size: 12px; color: var(--muted); padding: 6px 12px 4px; }
.pop .pi { display: flex; align-items: center; gap: 8px; padding: 5px 12px; cursor: pointer; min-height: 30px; }
.pop .pi:hover, .pop .pi.kb { background: var(--hover); }
.pop .pi .r { margin-left: auto; color: var(--faint); }
.pop .pi .more { margin-left: auto; visibility: hidden; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 4px; padding: 0 4px; }
.pop .pi:hover .more { visibility: visible; }
.pop .pi .more:hover { background: var(--hover-2); }
.pop .sel { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; background: var(--hover); align-items: center; }
.pop .sel input { flex: 1; min-width: 80px; border: 0; background: transparent; outline: none; padding: 2px; }
.pop .inp { padding: 6px 8px; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.pop textarea.box { min-height: 90px; resize: vertical; }

/* ---------- page / peek */
.overlay { position: fixed; inset: 0; background: rgba(15,15,15,.45); z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 6vh 20px; }
.peek { background: var(--bg); border-radius: 8px; box-shadow: var(--shadow); width: 100%; max-width: 780px; max-height: 88vh;
  overflow: auto; padding: 22px 56px 40px; position: relative; }
.peek .top { display: flex; gap: 4px; justify-content: flex-end; margin: -10px -40px 6px 0; }
.title-in { font-size: 30px; font-weight: 700; border: 0; outline: none; background: transparent; width: 100%; padding: 2px 0; margin: 0 0 10px; }
.props { display: grid; grid-template-columns: 170px minmax(0, 1fr); row-gap: 1px; margin-bottom: 14px; }
.props .pl { color: var(--muted); display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 4px; min-height: 34px; white-space: nowrap; overflow: hidden; }
.props .pl .ti { width: 16px; text-align: center; font-size: 12px; opacity: .7; }
.props .pv { padding: 5px 8px; border-radius: 4px; min-height: 34px; display: flex; align-items: center; min-width: 0; word-break: break-word; }
.props .pv.ed { cursor: pointer; }
.props .pv.ed:hover { background: var(--hover); }
.props .pv .t { overflow: hidden; text-overflow: ellipsis; }
.props .pv.long { white-space: pre-wrap; align-items: flex-start; }
.addprop { color: var(--faint); }
.body-sec { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
.doc { width: 100%; border: 0; outline: none; background: transparent; resize: none; min-height: 120px; line-height: 1.6; padding: 4px 2px; }
.doc::placeholder { color: var(--faint); }
.imgprev { max-width: 100%; max-height: 300px; border-radius: 6px; display: block; margin: 6px 0; }

/* ---------- home + lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 5px; cursor: pointer; min-height: 34px; }
.list li:hover { background: var(--hover); }
.list li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li .r { color: var(--muted); font-size: 13px; white-space: nowrap; }
.kpis { display: flex; gap: 28px; flex-wrap: wrap; margin: 6px 0 4px; }
.kpi .n { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; }
.cols2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px 40px; }

/* ---------- activity thread */
.composer { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin: 6px 0 12px; }
.composer textarea { width: 100%; border: 0; outline: none; background: transparent; resize: vertical; min-height: 44px; }
.msg { display: flex; gap: 10px; padding: 8px 0; }
.msg .mb { flex: 1; min-width: 0; }
.msg .mt { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.msg .mt b { font-weight: 600; }
.msg .body { white-space: pre-wrap; margin-top: 2px; }
.msg .x { visibility: hidden; margin-left: auto; }
.msg:hover .x { visibility: visible; }

/* ---------- calendar */
.cal { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); margin-top: 8px; }
.cal .dh { padding: 8px 6px; font-size: 12px; color: var(--muted); border-left: 1px solid var(--line-soft); }
.cal .dh b { display: block; font-size: 18px; color: var(--text); font-weight: 500; }
.cal .dh.today b { color: #fff; background: var(--danger); border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; }
.cal .hour { height: 44px; font-size: 11px; color: var(--faint); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.cal .day { position: relative; border-left: 1px solid var(--line-soft); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, var(--line-soft) 0 1px, transparent 1px 44px); }
.ev { position: absolute; left: 2px; right: 2px; border-radius: 4px; padding: 2px 6px; font-size: 12px; overflow: hidden;
  cursor: pointer; line-height: 1.3; border-left: 3px solid; }
.ev.st-Cancelled, .ev.st-No-show { opacity: .5; text-decoration: line-through; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; }

/* ---------- finance */
.fin-kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border: 1px solid var(--line); border-radius: 8px; margin: 12px 0 6px; }
.fin-kpis > div { padding: 14px 16px; border-right: 1px solid var(--line); }
.fin-kpis > div:last-child { border-right: 0; }
.fin-kpis .n { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.fin-kpis .l { color: var(--muted); font-size: 13px; }
table.plain { border-collapse: collapse; width: 100%; }
table.plain th, table.plain td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.plain th { color: var(--muted); font-weight: 400; font-size: 13px; }
table.plain td.num, table.plain th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 3px; background: var(--hover-2); overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------- misc */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(90px); background: #2f2f2f; color: #fff;
  padding: 8px 14px; border-radius: 6px; font-size: 13px; transition: transform .18s; z-index: 90; box-shadow: var(--shadow); }
#toast.show { transform: translateX(-50%) translateY(0); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .box-in { width: 100%; max-width: 320px; }
.login h1 { font-size: 26px; margin-bottom: 18px; text-align: center; }
.login form { display: flex; flex-direction: column; gap: 10px; }
.login label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.err { color: var(--danger); font-size: 13px; }
.settings-sec { border-bottom: 1px solid var(--line); padding: 4px 0 22px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .sec, .side .grow { display: none; }
  .side a.nav span.lbl { display: none; }
  main { padding: 24px 16px 80px; }
  .cols2, .fin-kpis { grid-template-columns: 1fr 1fr; }
  .peek { padding: 18px 20px 30px; }
  .props { grid-template-columns: 120px minmax(0,1fr); }
}
