/* Sirayah CRM — fixed sidebar for navigation and buckets, calm work surface on the right. */
@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root { --bg:#FBF7EF; --surface:#FFFFFF; --sand:#F4E9D3; --tan:#DDC49A; --clay:#8B5E3C; --brown:#5F3A16; --ink:#2B1606; --muted:rgba(43,22,6,.64); --line:rgba(95,58,22,.15);
  --bad:#8A1F11; --bad-bg:#F7DCD2; --ok-bg:#DDE8CF; --ok:#2F4A14; --warn-bg:#FBEBC2; --warn:#6A4A05; --shadow:0 1px 2px rgba(43,22,6,.04), 0 10px 28px -14px rgba(95,58,22,.22); color-scheme: light; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3, p, ul { margin: 0; padding: 0; } ul { list-style: none; }
h1, h2 { font-family: "Bricolage Grotesque", "Inter", system-ui, sans-serif; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: lining-nums; }
h3 { font: 600 .74rem/1.3 "Inter", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--clay); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; border-radius: 6px; }
.ico { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 20px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--bg); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--brown); border-color: var(--brown); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--sand); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { min-height: 34px; padding: 4px 14px; font-size: .86rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--clay); font-weight: 600; cursor: pointer; padding: 4px; }
label { display: grid; gap: 5px; font-weight: 600; font-size: .85rem; align-content: start; }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; min-height: 42px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); font-weight: 400; font-size: .95rem; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: 3px solid rgba(139,94,60,.35); outline-offset: 0; }
textarea { min-height: 84px; resize: vertical; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
label.check input { width: 18px; min-height: 18px; height: 18px; }
.msg { border-radius: 12px; padding: 10px 14px; font-size: .9rem; font-weight: 500; }
.msg.bad { background: var(--bad-bg); color: var(--bad); } .msg.ok { background: var(--ok-bg); color: var(--ok); } .msg.warn { background: var(--warn-bg); color: var(--warn); margin-bottom: 16px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sand); color: var(--brown); display: inline-grid; place-items: center; font-weight: 600; font-size: .8rem; flex: none; }
.avatar.tiny { width: 22px; height: 22px; font-size: .62rem; } .avatar.big { width: 52px; height: 52px; font-size: 1.05rem; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who small { display: block; color: var(--muted); font-size: .8rem; }
.pill { display: inline-block; border-radius: 999px; padding: 3px 11px; font-size: .78rem; font-weight: 600; background: var(--sand); white-space: nowrap; }
.pill.off, .pill.stage-disqualified { background: #ECE7DD; color: var(--muted); }
.pill.stage-contract, .pill.stage-property_search { background: var(--ok-bg); color: var(--ok); } .pill.stage-purchased { background: var(--ink); color: var(--tan); } .pill.stage-long_term { background: #E6DFF2; color: #43307A; } .pill.stage-lead { background: #F6D9CF; color: #7A2A14; }
.stars { color: #B7791F; letter-spacing: 1px; white-space: nowrap; } .stars .off { color: var(--tan); }

/* sign-in pages */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.auth form { width: min(420px, 100%); background: var(--surface); border-radius: 22px; padding: 32px 28px; display: grid; gap: 16px; }
.auth img { height: 40px; width: auto; } .auth .logo { display: flex; gap: 10px; align-items: center; direction: ltr; }
.auth p { font-size: .9rem; color: var(--muted); }

/* shell */
#app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 18px; }
.side-brand img { height: 34px; width: auto; border-radius: 7px; }
.side-brand b { display: block; font: 500 1.2rem/1.1 "Bricolage Grotesque", sans-serif; } .side-brand span { font-size: .7rem; letter-spacing: .16em; color: var(--muted); }
.side nav { display: grid; gap: 2px; }
.side-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 12px; background: none; cursor: pointer; font-weight: 500; color: var(--muted); }
.side-item span { flex: 1; min-width: 0; }
.side-item b { font-size: .76rem; font-weight: 600; background: var(--sand); color: var(--brown); border-radius: 999px; padding: 1px 8px; }
.side-item:hover { background: var(--bg); color: var(--ink); }
.side-item[aria-current="page"] { background: var(--sand); color: var(--ink); font-weight: 600; }
.side-label { font: 600 .68rem/1 "Inter", sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 18px 12px 6px; }
.side-user { margin-top: auto; display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; padding: 14px 10px 0; border-top: 1px solid var(--line); }
.side-user b { display: block; font-size: .92rem; } .side-user span:not(.avatar) { font-size: .78rem; color: var(--muted); } .side-user .btn { grid-column: 1 / -1; }
.main { min-width: 0; }
.mobile-top { display: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; padding: 26px 28px 18px; }
.topbar h1 { font-size: 1.9rem; } .topbar p { color: var(--muted); margin-top: 2px; }
.topbar-tools { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.topbar-tools input[type=search] { width: 230px; border-radius: 999px; background: var(--surface); }
main { padding: 0 28px 48px; }
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 30; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .topbar { padding: 18px 16px 12px; } .topbar h1 { font-size: 1.5rem; } .topbar-tools .btn { display: none; } .topbar-tools input[type=search] { width: 100%; }
  .topbar-tools { width: 100%; }
  main { padding: 0 16px 40px; }
}

/* dashboard */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { text-align: left; border: 0; border-radius: 18px; padding: 18px 20px; display: grid; gap: 14px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile-top { display: flex; justify-content: space-between; gap: 8px; font: 600 .72rem/1.3 "Inter", sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.tile b { font: 500 2.6rem/1 "Bricolage Grotesque", sans-serif; }
.t-hot { background: linear-gradient(135deg, #F8DDD3, #EDB9A8); color: #6E2412; } .t-pipe { background: linear-gradient(135deg, #F6ECD8, #E6CFA4); color: var(--brown); }
.t-contract { background: linear-gradient(135deg, #E2EED6, #BFD9A6); color: #2F4A14; } .t-long { background: linear-gradient(135deg, #ECE6F6, #CFC2EA); color: #43307A; }
.dash { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dash-side { display: grid; gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: grid; gap: 14px; box-shadow: var(--shadow); min-width: 0; }
.panel + .panel { margin-top: 18px; } .dash .panel + .panel { margin-top: 0; }
.panel h2 { font-size: 1.2rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-head p { color: var(--muted); font-size: .9rem; }
.panel.call { background: var(--ink); color: var(--bg); border-color: var(--ink); } .panel.call p { color: rgba(251,247,239,.75); } .panel.call .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); justify-self: start; }
.bignum { font: 500 3rem/1 "Bricolage Grotesque", sans-serif; }
.bars { display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 118px 1fr 22px; gap: 10px; align-items: center; font-size: .86rem; }
.bars .bar { height: 8px; border-radius: 999px; background: var(--sand); overflow: hidden; } .bars .bar i { display: block; height: 100%; border-radius: 999px; background: var(--clay); }
.bars b { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); font-size: .9rem; padding: 6px 2px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash { grid-template-columns: 1fr; } }

/* tables */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font: 600 .68rem/1.3 "Inter", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 8px 12px; white-space: nowrap; }
td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
tr.rowlink { cursor: pointer; } tr.rowlink:hover td { background: var(--bg); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
/* Team list on phones: one card per user, so the buttons are not hidden off to the side */
@media (max-width: 700px) {
  table.team thead { display: none; }
  table.team tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 14px 0; border-top: 1px solid var(--line); }
  table.team tbody tr:first-child { border-top: 0; }
  table.team td { padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  table.team td:nth-child(1), table.team td:nth-child(2), table.team td:nth-child(5) { flex: 1 0 100%; }
  table.team td:nth-child(2), table.team td:nth-child(3) { color: var(--muted); }
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* pipeline */
.board-scroll { overflow-x: auto; padding-bottom: 12px; }
.board { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; min-width: 1440px; align-items: start; }
.board.compact .col { min-height: 120px; gap: 5px; }
.dash.even { grid-template-columns: repeat(2, minmax(0, 1fr)); } @media (max-width: 1100px) { .dash.even { grid-template-columns: 1fr; } }
/* compact cards: one line each, so a long column still fits on the screen */
.card.mini { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 5px; padding: 6px 6px 6px 9px; border-radius: 10px; }
.card.mini .name { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-stars { color: #B7791F; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.avatar.tiny { width: 22px; height: 22px; font-size: .62rem; }
.col { background: var(--sand); border-radius: 16px; padding: 8px; display: grid; gap: 8px; align-content: start; min-height: 220px; border: 2px dashed transparent; transition: border-color .15s, background .15s; }
.is-dragging .col { border-color: rgba(139,94,60,.35); }
.col.over { border-color: var(--ink); background: var(--tan); }
.col h2 { font: 600 .82rem/1.3 "Inter", sans-serif; letter-spacing: 0; display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 4px; }
.col h2 span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.col h2 i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--tan); display: grid; place-items: center; font-size: .72rem; }
.col h2 b { font-weight: 600; background: var(--surface); border-radius: 999px; padding: 1px 9px; font-size: .78rem; }
.col .empty { font-size: .84rem; padding: 10px 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 4px; cursor: grab; text-align: left; width: 100%; box-shadow: 0 1px 2px rgba(43,22,6,.05); }
.card:hover { border-color: var(--clay); } .card.dragging { opacity: .4; }
.card-top { display: flex; justify-content: space-between; align-items: center; } .card .age { font-size: .74rem; color: var(--muted); }
.card .name { font-weight: 600; font-size: .98rem; overflow-wrap: anywhere; }
.card .meta { font-size: .82rem; color: var(--muted); }
.card .foot { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.park { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.park-zone { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; border: 2px dashed var(--line); border-radius: 16px; color: var(--muted); font-weight: 500; font-size: .9rem; transition: border-color .15s, background .15s; }
.is-dragging .park-zone { border-color: var(--clay); color: var(--ink); } .park-zone.over { background: var(--tan); border-color: var(--ink); }
@media (max-width: 600px) { .park { grid-template-columns: 1fr; } }

/* automatic emails */
.auto-list { display: grid; gap: 14px; max-width: 860px; }
.auto-list .panel + .panel { margin-top: 0; }
.auto { border-left: 4px solid var(--line); } .auto.on { border-left-color: var(--ok); }

/* dialogs */
dialog { border: 0; padding: 0; background: var(--bg); color: var(--ink); width: min(580px, 100%); max-width: 100%; height: 100%; max-height: 100%; margin: 0 0 0 auto; box-shadow: -12px 0 40px rgba(43,22,6,.25); }
dialog::backdrop { background: rgba(43,22,6,.45); }
dialog.center { height: auto; max-height: calc(100% - 32px); margin: auto; border-radius: 22px; width: min(520px, calc(100% - 32px)); overflow-y: auto; }
dialog.center:has(.wide) { width: min(760px, calc(100% - 32px)); }
.sheet { display: grid; gap: 16px; padding: 24px; }
.sheet h2 { font-size: 1.5rem; overflow-wrap: anywhere; }
.sheet > p { color: var(--muted); font-size: .9rem; }
.sumbox { display: flex; align-items: end; } .sum { background: var(--sand); border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: .9rem; width: 100%; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.facts div { display: grid; gap: 1px; min-width: 0; }
.facts span { font: 600 .66rem/1.4 "Inter", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts b { font-weight: 500; overflow-wrap: anywhere; }
.starpick { display: flex; gap: 2px; }
.starpick button { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--tan); padding: 2px; } .starpick button.on { color: #B7791F; }
.log { display: grid; gap: 8px; }
.log li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.log li.system { background: transparent; border-style: dashed; font-size: .86rem; }
.log .when { font-size: .76rem; color: var(--muted); } .log .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; margin-inline: auto; width: fit-content; max-width: calc(100% - 32px); z-index: 60; box-shadow: 0 6px 24px rgba(43,22,6,.25); }

/* finance */
.tile small { font-size: .8rem; opacity: .85; line-height: 1.35; }
.tile .money { font-size: clamp(1.5rem, 2.4vw, 2.1rem); font-variant-numeric: tabular-nums; }
div.tile { cursor: default; } div.tile:hover { transform: none; box-shadow: none; }
.bars.wide li { grid-template-columns: 82px 1fr minmax(96px, auto); }
.hint { font-size: .86rem; color: var(--muted); }
/* tables that turn into one card per row on phones */
@media (max-width: 700px) {
  table.stack thead { display: none; }
  table.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
  table.stack tbody tr:first-child { border-top: 0; }
  table.stack td { padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  table.stack td:first-child { grid-column: 1 / -1; }
  table.stack td[data-th]::before { content: attr(data-th) ": "; color: var(--muted); font-size: .8rem; }
}

/* roles and permissions */
table.perms td, table.perms th { white-space: normal; }
table.perms th:not(:first-child), table.perms td:not(:first-child) { text-align: center; width: 84px; padding-inline: 6px; }
table.perms input[type=checkbox] { width: 20px; min-height: 20px; height: 20px; }
table.perms .no { color: var(--muted); }
@media (max-width: 600px) { table.perms th:not(:first-child), table.perms td:not(:first-child) { width: 58px; padding-inline: 2px; } table.perms th { font-size: .6rem; letter-spacing: .06em; } table.perms td:first-child { padding-inline-start: 0; } }
