:root {
  --crm-navy: #1F2145;
  --crm-coral: #F04E45;
  --crm-coral-dark: #C93A34;
  --crm-paper: #FFF8F2;
  --crm-card: rgb(255 255 255 / .74);
  --crm-solid: #FFFFFF;
  --crm-line: rgb(31 33 69 / .1);
  --crm-muted: #55577A;
  --crm-soft: rgb(31 33 69 / .05);
  --crm-shadow: 0 10px 28px rgb(31 33 69 / .07);
}

.crm { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; color: var(--crm-navy); }
.crm[hidden] { display: none !important; }

.crm-side {
  position: sticky; top: 0; z-index: 5; display: flex; flex-direction: column; gap: 22px; height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 22px) 14px 18px max(14px, env(safe-area-inset-left));
  background: var(--crm-navy); color: var(--crm-paper);
}
.crm-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.crm-brand span { display: grid; line-height: 1.05; }
.crm-brand b { font-size: 1.25rem; font-weight: 900; letter-spacing: -.03em; }
.crm-brand small { color: rgb(255 248 242 / .68); font-size: .72rem; font-weight: 700; letter-spacing: .12em; }
.crm-nav { display: grid; gap: 4px; }
.crm-nav button {
  display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 12px;
  background: transparent; color: rgb(255 248 242 / .76); font-size: .92rem; font-weight: 600; text-align: left;
}
.crm-nav button span { width: 18px; font-size: 1rem; text-align: center; }
.crm-nav button:hover { background: rgb(255 255 255 / .07); color: var(--crm-paper); }
.crm-nav button[aria-current=page] { background: var(--crm-paper); color: var(--crm-navy); font-weight: 800; }
.crm-nav em { min-width: 21px; margin-left: auto; padding: 1px 6px; border-radius: 99px; background: var(--crm-coral); color: #fff; font-size: .72rem; font-style: normal; font-weight: 800; text-align: center; }
.crm-logout { min-height: 40px; margin-top: auto; border: 1px solid rgb(255 255 255 / .18); border-radius: 12px; background: transparent; color: rgb(255 248 242 / .82); font-size: .85rem; font-weight: 600; }
.crm-logout:hover { background: rgb(255 255 255 / .07); }

.crm-main { width: 100%; max-width: 1320px; min-width: 0; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 26px) max(28px, env(safe-area-inset-right)) 40px 28px; }
.crm-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.crm-eyebrow { margin: 0 0 2px; color: var(--crm-muted); font-size: .84rem; text-transform: capitalize; }
.crm-head h1 { font-size: 2rem; font-weight: 900; letter-spacing: -.04em; }
.crm-view { display: grid; gap: 16px; min-width: 0; }
.crm-view[hidden] { display: none !important; }

.crm-primary, .crm-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 9px 16px;
  border-radius: 12px; font-size: .9rem; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer;
}
.crm-primary { flex: none; border: 0; background: var(--crm-coral-dark); color: #fff; box-shadow: 0 7px 16px rgb(201 58 52 / .24); }
.crm-primary:hover { background: #B4322D; }
.crm-primary:disabled { opacity: .6; cursor: default; }
.crm-primary span { font-size: 1.15rem; line-height: 1; }
.crm-secondary { border: 1px solid var(--crm-line); background: var(--crm-solid); color: var(--crm-navy); }
.crm-secondary:hover { border-color: rgb(31 33 69 / .3); }
.crm-secondary.danger { border-color: rgb(201 58 52 / .4); color: var(--crm-coral-dark); }
.crm-secondary.compact { min-height: 38px; padding: 6px 12px; }
.delete-zone h3 { color: var(--crm-coral-dark); }
.delete-form { display: grid; gap: 10px; margin: 0; }
.delete-form[hidden] { display: none; }
.delete-form p { margin: 0; }
.delete-form label { display: grid; gap: 6px; font-weight: 700; }
.crm-delete { min-height: 44px; padding: 8px 14px; border: 0; border-radius: 12px; background: #C93A34; color: #fff; font-weight: 800; cursor: pointer; }
.crm-delete:disabled { opacity: .45; cursor: not-allowed; }
.crm-secondary[hidden] { display: none !important; }
.crm-link { padding: 6px 2px; border: 0; background: transparent; color: var(--crm-coral-dark); font-size: .84rem; font-weight: 700; }

.crm-kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.crm-kpi { display: grid; align-content: start; gap: 3px; min-width: 0; padding: 15px; border: 1px solid var(--crm-line); border-radius: 18px; background: var(--crm-card); box-shadow: var(--crm-shadow); }
.crm-kpi span { color: var(--crm-muted); font-size: .79rem; font-weight: 600; }
.crm-kpi strong { font-size: 1.6rem; font-weight: 900; line-height: 1.15; letter-spacing: -.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.crm-kpi small { color: var(--crm-muted); font-size: .74rem; }
.crm-kpi.hero { grid-column: span 2; background: var(--crm-navy); color: var(--crm-paper); }
.crm-kpi.hero span, .crm-kpi.hero small { color: rgb(255 248 242 / .74); }
.crm-kpi.hero strong { font-size: 2rem; }

.crm-columns { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.crm-panel { min-width: 0; padding: 16px; border: 1px solid var(--crm-line); border-radius: 20px; background: var(--crm-card); box-shadow: var(--crm-shadow); }
.crm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.crm-panel h2 { font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; }
.crm-count { min-width: 24px; padding: 2px 8px; border-radius: 99px; background: var(--crm-soft); font-size: .78rem; font-weight: 800; text-align: center; }
.crm-muted { margin: 6px 0; color: var(--crm-muted); font-size: .88rem; }
.crm-list { display: grid; gap: 2px; }

.stage-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.stage-tile { display: grid; justify-items: start; gap: 2px; min-width: 0; padding: 12px; border: 1px solid var(--crm-line); border-radius: 14px; background: var(--crm-solid); text-align: left; }
.stage-tile b { font-size: 1.45rem; font-weight: 900; line-height: 1.1; }
.stage-tile small { color: var(--crm-muted); font-size: .78rem; }
.stage-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
.stage-dot.stage-prospect { background: #9A9CB6; }
.stage-dot.stage-demo { background: #55577A; }
.stage-dot.stage-trial { background: var(--crm-coral); }
.stage-dot.stage-client { background: var(--crm-navy); }
.stage-dot.stage-lost { background: #D8D2CC; }
.stage-pill, .status-pill { display: inline-flex; align-items: center; width: fit-content; padding: 3px 9px; border-radius: 99px; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.stage-pill.stage-prospect { background: rgb(31 33 69 / .07); color: #45476A; }
.stage-pill.stage-demo { background: rgb(31 33 69 / .13); color: var(--crm-navy); }
.stage-pill.stage-trial { background: rgb(240 78 69 / .15); color: #A62E29; }
.stage-pill.stage-client { background: var(--crm-navy); color: var(--crm-paper); }
.stage-pill.stage-lost { background: #EFE9E3; color: #5F5A55; }
.status-pill { background: rgb(201 58 52 / .12); color: #A62E29; }

.account-row { display: flex; align-items: center; gap: 11px; width: 100%; min-width: 0; padding: 9px 7px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.account-row:hover { background: var(--crm-soft); }
.account-main { display: grid; flex: 1; min-width: 0; }
.account-main b, .deal-head b, .cell-brand b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.account-main small, .deal-head small, .cell-brand small { color: var(--crm-muted); font-size: .76rem; }
.account-logo { display: inline-grid; flex: none; place-items: center; width: 38px; height: 38px; border: 1px solid var(--crm-line); border-radius: 11px; background: #fff; object-fit: cover; }
.account-letter { border: 0; background: var(--crm-navy); color: var(--crm-coral); font-size: 1.05rem; font-weight: 900; }
.account-logo.large { width: 60px; height: 60px; border-radius: 17px; font-size: 1.6rem; }
.row-stats { display: grid; flex: none; justify-items: end; }
.row-stats b { font-size: .86rem; }
.row-stats small { color: var(--crm-muted); font-size: .75rem; }
.due { flex: none; color: var(--crm-muted); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.due.late { color: var(--crm-coral-dark); font-weight: 800; }
.due.today { color: var(--crm-navy); font-weight: 800; }

.crm-empty { display: grid; justify-items: center; gap: 6px; padding: 34px 16px; text-align: center; }
.crm-empty[hidden] { display: none !important; }
.crm-empty b { font-size: 1.05rem; }
.crm-empty p { max-width: 42ch; margin: 0 0 8px; color: var(--crm-muted); font-size: .9rem; }

.crm-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(130px, 170px)); gap: 8px; }
.crm-toolbar input, .crm-toolbar select {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--crm-line); border-radius: 12px;
  background: var(--crm-solid); box-shadow: none; color: var(--crm-navy); font-family: inherit; font-size: 15px;
}
.crm-table-wrap { padding: 4px; overflow-x: auto; }
.crm-table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: .88rem; }
.crm-table[hidden] { display: none; }
.crm-table th { padding: 11px 12px; border-bottom: 1px solid var(--crm-line); color: var(--crm-muted); font-size: .74rem; font-weight: 700; text-align: left; white-space: nowrap; }
.crm-table td { padding: 10px 12px; border-bottom: 1px solid var(--crm-line); vertical-align: middle; }
.crm-table tbody tr { cursor: pointer; }
.crm-table tbody tr:last-child td { border-bottom: 0; }
.crm-table tbody tr:hover { background: var(--crm-soft); }
.crm-table tbody tr:focus-visible { outline: 3px solid var(--crm-coral); outline-offset: -3px; }
.crm-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-brand > span:not(.account-logo):not(.status-pill) { display: grid; min-width: 0; }

.crm-board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.board-column { display: flex; flex-direction: column; gap: 9px; min-width: 0; min-height: 320px; padding: 11px; border: 1px solid var(--crm-line); border-radius: 18px; background: rgb(255 255 255 / .46); transition: border-color .12s, background .12s; }
.board-column.drop { border-color: var(--crm-coral); background: rgb(240 78 69 / .08); }
.board-column header { display: flex; align-items: center; gap: 7px; min-height: 26px; }
.board-column header b { font-size: .9rem; }
.board-column header em { padding: 0 7px; border-radius: 99px; background: var(--crm-soft); font-size: .74rem; font-style: normal; font-weight: 800; }
.board-column header small { margin-left: auto; color: var(--crm-muted); font-size: .74rem; font-weight: 700; }
.board-cards { display: grid; align-content: start; gap: 8px; }
.board-empty { margin: 0; padding: 18px 8px; border: 1px dashed var(--crm-line); border-radius: 12px; color: var(--crm-muted); font-size: .82rem; text-align: center; }
.deal-card { display: grid; gap: 9px; padding: 11px; border: 1px solid var(--crm-line); border-radius: 14px; background: var(--crm-solid); box-shadow: 0 4px 12px rgb(31 33 69 / .05); cursor: grab; }
.deal-card:hover { border-color: rgb(31 33 69 / .26); }
.deal-card.dragging { opacity: .45; }
.deal-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.deal-head > span:last-child { display: grid; min-width: 0; }
.deal-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 8px; color: var(--crm-muted); font-size: .78rem; font-weight: 600; }
.deal-card select { width: 100%; min-height: 34px; padding: 4px 8px; border: 1px solid var(--crm-line); border-radius: 9px; background: var(--crm-paper); color: var(--crm-navy); font-family: inherit; font-size: .8rem; }
.crm-followups { display: grid; gap: 14px; }
.followup-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.followup-row .account-row { flex: 1; }

.crm-dialog, .crm-drawer { border: 0; color: var(--crm-navy); background: var(--crm-paper); box-shadow: 0 30px 80px rgb(31 33 69 / .3); }
.crm-dialog::backdrop, .crm-drawer::backdrop { background: rgb(31 33 69 / .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.crm-dialog { width: min(880px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 22px; overflow-y: auto; border-radius: 24px; }
.crm-dialog-small { width: min(680px, calc(100vw - 32px)); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dialog-head h2 { font-size: 1.4rem; font-weight: 900; letter-spacing: -.03em; }
.dialog-close { flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--crm-soft); color: var(--crm-navy); font-size: 1.5rem; line-height: 1; }
#create-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
#create-form label { min-width: 0; }
#create-form input:not([type=file]):not([type=color]), #create-form select {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--crm-line); border-radius: 12px;
  background: #fff; box-shadow: none; color: var(--crm-navy); font-family: inherit; font-size: 15px;
}
#create-form .create-wide { grid-column: 1 / -1; }
#create-form .error:empty { display: none; }
.crm-dialog .app-preview { background: #fff; border-color: var(--crm-line); }
.crm-dialog .secret { margin: 0 0 14px; background: rgb(240 78 69 / .12); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border: 1px solid rgb(240 78 69 / .25); }
.crm-dialog .share-box { margin: 0; }
.crm-dialog .share-actions input { min-height: 44px; padding: 8px 12px; border: 1px solid var(--crm-line); border-radius: 12px; background: #fff; box-shadow: none; }

.crm-drawer { position: fixed; inset: 0 0 0 auto; width: min(560px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; overflow-y: auto; }
#drawer-content { display: grid; gap: 16px; padding: calc(env(safe-area-inset-top) + 20px) 20px calc(env(safe-area-inset-bottom) + 28px); }
.drawer-head { display: flex; align-items: flex-start; gap: 13px; }
.drawer-head > div { flex: 1; min-width: 0; }
.drawer-head h2 { font-size: 1.45rem; font-weight: 900; letter-spacing: -.03em; overflow-wrap: anywhere; }
.drawer-head p { margin: 1px 0 6px; color: var(--crm-muted); font-size: .84rem; overflow-wrap: anywhere; }
.drawer-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.drawer-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--crm-line); border-radius: 14px; background: var(--crm-line); }
.drawer-stats span { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 10px; background: #fff; color: var(--crm-muted); font-size: .72rem; }
.drawer-stats b { color: var(--crm-navy); font-size: .98rem; font-weight: 800; overflow-wrap: anywhere; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.drawer-actions > * { flex: 1 1 auto; }
.drawer-form, .drawer-section { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--crm-line); }
.drawer-form { margin: 0; }
#drawer-content h3 { margin: 0; font-size: .96rem; font-weight: 800; }
.drawer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.drawer-field { display: grid; gap: 4px; min-width: 0; font-size: .8rem; font-weight: 600; }
.drawer-field input, .drawer-field select, .note-form textarea {
  width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid var(--crm-line); border-radius: 11px;
  background: #fff; box-shadow: none; color: var(--crm-navy); font-family: inherit; font-size: 15px;
}
.drawer-form .error:empty { display: none; }
.note-form { display: grid; gap: 7px; margin: 0; }
.note-form textarea { min-height: 76px; resize: vertical; }
.notes-list { display: grid; gap: 7px; }
.note { padding: 10px 12px; border: 1px solid var(--crm-line); border-radius: 12px; background: #fff; }
.note p { margin: 0 0 5px; font-size: .88rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.note footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--crm-muted); }
.note-delete { padding: 4px 2px; border: 0; background: transparent; color: var(--crm-coral-dark); font-size: .76rem; font-weight: 700; }

.crm :focus-visible, .crm-dialog :focus-visible, .crm-drawer :focus-visible { outline: 3px solid var(--crm-coral); outline-offset: 2px; }

@media (max-width: 1180px) {
  .crm-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-kpi.hero { grid-column: span 1; }
  .crm-board { grid-template-columns: repeat(5, 230px); }
}
@media (max-width: 860px) {
  .crm { display: block; padding-bottom: calc(env(safe-area-inset-bottom) + 72px); }
  .crm-side {
    position: fixed; inset: auto 0 0; display: block; height: auto; padding: 6px max(8px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 6px) max(8px, env(safe-area-inset-left));
    box-shadow: 0 -8px 24px rgb(31 33 69 / .2);
  }
  .crm-brand, .crm-logout { display: none; }
  .crm-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .crm-nav button { position: relative; flex-direction: column; justify-content: center; gap: 1px; min-height: 52px; padding: 5px 2px; font-size: .7rem; text-align: center; }
  .crm-nav em { position: absolute; top: 3px; right: 12%; min-width: 17px; padding: 0 4px; font-size: .64rem; }
  .crm-main { padding: calc(env(safe-area-inset-top) + 16px) max(16px, env(safe-area-inset-right)) 20px max(16px, env(safe-area-inset-left)); }
  .crm-head { align-items: flex-start; }
  .crm-head h1 { font-size: 1.65rem; }
  .crm-head .crm-primary { padding: 8px 12px; font-size: 0; gap: 0; width: 46px; height: 46px; min-height: 46px; border-radius: 15px; }
  .crm-head .crm-primary span { font-size: 1.6rem; }
  .crm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-kpi.hero { grid-column: 1 / -1; }
  .crm-columns { grid-template-columns: minmax(0, 1fr); }
  .crm-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-toolbar input { grid-column: 1 / -1; }
  .crm-toolbar select { padding: 8px 6px; font-size: 13px; }
  .crm-table-wrap { padding: 0; overflow: visible; background: transparent; border: 0; box-shadow: none; }
  .crm-table { display: block; min-width: 0; }
  .crm-table thead { display: none; }
  .crm-table tbody { display: grid; gap: 9px; }
  .crm-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 13px; border: 1px solid var(--crm-line); border-radius: 16px; background: var(--crm-card); }
  .crm-table td { display: grid; gap: 1px; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
  .crm-table td::before { content: attr(data-label); color: var(--crm-muted); font-size: .7rem; font-weight: 600; }
  .crm-table .cell-account { grid-column: 1 / -1; }
  .crm-table .cell-account::before { display: none; }
  .crm-table .num { text-align: left; }
  .crm-table .due { white-space: normal; }
  #create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-dialog { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom) + 20px); border-radius: 24px 24px 0 0; }
  .brand-builder { grid-template-columns: minmax(0, 1fr) !important; }
  .share-grid { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 460px) {
  .stage-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .drawer-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer-grid { grid-template-columns: minmax(0, 1fr); }
  #create-form label:has(#new-name), #create-form label:has(#new-slug) { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .crm *, .crm-dialog *, .crm-drawer * { transition: none !important; }
}


.team-list { display: grid; gap: 7px; }
.team-row { display: grid; gap: 7px; padding: 10px 12px; border: 1px solid var(--crm-line); border-radius: 12px; background: #fff; }
.team-row.inactive { background: #F7F1EC; }
.team-main { display: grid; min-width: 0; }
.team-main b { font-size: .9rem; overflow-wrap: anywhere; }
.team-main small { color: var(--crm-muted); font-size: .76rem; overflow-wrap: anywhere; }
.team-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.team-actions button { min-height: 34px; padding: 4px 10px; border: 1px solid var(--crm-line); border-radius: 9px; background: transparent; color: var(--crm-navy); font-size: .76rem; font-weight: 700; }
.team-actions button.danger { border-color: rgb(201 58 52 / .35); color: var(--crm-coral-dark); }
.team-form { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 7px; margin: 0; }
.team-form input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--crm-line); border-radius: 11px; background: #fff; box-shadow: none; color: var(--crm-navy); font-family: inherit; font-size: 15px; }
.team-form .error { grid-column: 1 / -1; }
.team-form .error:empty { display: none; }


.link-list { display: grid; gap: 7px; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px; padding: 9px 10px; border: 1px solid var(--crm-line); border-radius: 12px; background: #fff; }
.link-row > span { display: grid; min-width: 0; }
.link-row b { font-size: .86rem; }
.link-row small { overflow: hidden; color: var(--crm-muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 460px) {
  .link-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-row > span { grid-column: 1 / -1; }
}

.status-pill.late { background: #FFF0D6; color: #8A5A00; }
.billing-warning { margin: 0; padding: 12px 14px; border-radius: 12px; background: #FDE8E6; color: #A52E29; font-weight: 700; }
.billing-profile summary { cursor: pointer; font-weight: 800; }
.billing-profile form { margin-top: 14px; }
.invoice-list { display: grid; gap: 8px; }
.invoice-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--crm-line, rgb(31 33 69 / .12)); border-radius: 12px; background: rgb(255 255 255 / .6); }
.invoice-main { display: grid; min-width: 0; }
.invoice-main small { overflow-wrap: anywhere; }
.invoice-status { padding: 3px 9px; border-radius: 99px; background: #FFF0D6; color: #8A5A00; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.invoice-status.paid { background: #DDF3E4; color: #17603A; }
.invoice-status.late { background: #C93A34; color: #fff; }
.invoice-status.void { background: #EEE; color: #555; }
.invoice-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.invoice-actions select { min-height: 38px; max-width: 120px; padding: 4px 8px; border: 1px solid var(--crm-line, rgb(31 33 69 / .2)); border-radius: 10px; background: #fff; }
