/* LMF v3.1 Darījumi board (lane U-B; replaces lane 2.1's stub). The page body of #deals: columns, cards, the closed view and the
   "Pārvietot uz..." menu. Kit controls (v31-btn, v31-chip, v31-notice, v31-empty, v31-empty-line, v31-skel) keep their own look from
   workspace-v31-shell.css; this file only places them and draws the columns and cards. Own buttons repeat the kit's guard (lane K2)
   so the app's id rules on buttons cannot restyle them. Tokens only (gate zero rule 2); spacing in multiples of 4.
   Widths: eight columns from 1180 px, four from 721 px, one column on a phone (cards full width, no sideways scroll). */

.v31-db-page{min-width:0}
.v31-db{display:flex;flex-direction:column;gap:var(--v31-s-3);min-width:0;color:var(--v31-text);font:var(--v31-fw) var(--v31-fs)/var(--v31-lh) var(--v31-font)}
.v31-db-slot{display:flex;flex-direction:column;gap:var(--v31-s-2)}
.v31-db-slot:empty{display:none}
.v31-db-skel{border:1px solid var(--v31-line);border-radius:var(--v31-r);background:var(--v31-surface)}

/* the head's switch: Aktīvie / Kavēti / Noslēgti */
/* G1 4.8: the chosen view is lake like everything chosen inside deals, not the kit's forest green */
.v31-db-seg .v31-btn:not(#v31-kit#v31-kit#v31-kit#v31-kit)[aria-pressed="true"]{background-color:var(--v31-crm-tint);border-color:var(--v31-crm);color:var(--v31-crm-ink)}
.v31-db-seg .v31-btn:not(#v31-kit#v31-kit#v31-kit#v31-kit)[aria-pressed="true"]:hover{background-color:var(--v31-crm-tint);border-color:var(--v31-crm-hover)}
.v31-db-seg{display:inline-flex;gap:var(--v31-s-1);margin-inline-start:var(--v31-s-4);padding:var(--v31-s-1);border-radius:var(--v31-r-ctl);background:var(--v31-surface-2)}

/* the empty board: one block over the columns, which stay so the stages can be learnt */
.v31-db-empty:not(#v31-kit#v31-kit#v31-kit#v31-kit)>.v31-btn{width:var(--v31-act);min-width:var(--v31-act)}
.v31-db-none:not(#v31-kit#v31-kit#v31-kit#v31-kit){justify-content:center;background:var(--v31-surface);border:1px dashed var(--v31-line-strong);border-radius:var(--v31-r)}

/* columns */
/* G1 M5: a column is never narrower than its heading (a heading is a label, gate zero 18): min-width:min-content on the column and
   no shortening of the name. A column with cards gets more room than an empty one, so names and steps keep whole words on 1280 px */
.v31-db-cols{display:flex;gap:var(--v31-s-2);align-items:flex-start;min-width:0}
.v31-db-col{flex:1 1 0;display:flex;flex-direction:column;min-width:min-content;min-height:160px;background:var(--v31-surface-2);border-radius:var(--v31-r)}
.v31-db-col-h{display:flex;flex-direction:column;gap:var(--v31-s-2);padding:var(--v31-s-3) var(--v31-s-3) var(--v31-s-2)}
.v31-db-col-n{display:flex;align-items:baseline;flex-wrap:wrap;gap:var(--v31-s-2);min-height:28px}
.v31-db-col-n b{font:var(--v31-fw-heavy) var(--v31-fs-xl)/1 var(--v31-font);font-variant-numeric:tabular-nums;color:var(--v31-text)}
.v31-db-col-late{display:inline-flex;align-items:center;gap:var(--v31-s-1);color:var(--v31-late);font:var(--v31-fw-bold) var(--v31-fs-sm)/1.2 var(--v31-font);white-space:nowrap}
.v31-db-col-late .v31-i{width:15px;height:15px;color:var(--v31-late)}
.v31-db-bar{height:4px;border-radius:4px;background:color-mix(in srgb,var(--v31-crm) 42%,var(--v31-surface))}
.v31-db-bar.is-zero{background:var(--v31-crm-line)}
.v31-db-col.is-empty{flex-grow:.7}
.v31-db-cols.is-closed .v31-db-col{flex:0 1 360px}
.v31-db-col.is-closed .v31-db-bar{background:var(--v31-line-strong)}
.v31-db-col-t{display:flex;align-items:center;gap:var(--v31-s-2);min-width:max-content;margin:0;color:var(--v31-text-2);font:var(--v31-fw-bold) var(--v31-fs-sm)/var(--v31-lh-row) var(--v31-font)}
.v31-db-col-t .v31-i{flex:none;width:15px;height:15px;color:var(--v31-crm)}
.v31-db-col-t span{min-width:max-content;white-space:nowrap}
.v31-db-col-b{display:flex;flex-direction:column;gap:var(--v31-s-2);padding:0 var(--v31-s-2) var(--v31-s-2);min-width:0}

/* a card: the property, the deal's name and who acted last, the one thing it waits for, the date and its services */
.v31-db-card{position:relative;display:flex;flex-direction:column;gap:var(--v31-s-1);min-width:0;padding:var(--v31-s-3);background:var(--v31-surface);border:1px solid var(--v31-line);border-radius:var(--v31-r-ctl);
  box-shadow:var(--v31-sh-1);transition:box-shadow var(--v31-t-ctl),border-color var(--v31-t-ctl)}
.v31-db-card:hover{border-color:var(--v31-crm-line);box-shadow:var(--v31-sh-2)}
.v31-db-card.is-late{box-shadow:inset 3px 0 0 var(--v31-late),var(--v31-sh-1)}
.v31-db-card.is-late:hover{box-shadow:inset 3px 0 0 var(--v31-late),var(--v31-sh-2)}
.v31-db-card.is-closed{box-shadow:none}
.v31-db-card-h{display:flex;align-items:flex-start;gap:var(--v31-s-1);min-width:0}
.v31-db-open:not(#v31-kit#v31-kit#v31-kit#v31-kit){flex:1;min-width:0;min-height:var(--v31-min-target);height:auto;margin:0;padding:var(--v31-s-1) 0;display:block;appearance:none;-webkit-appearance:none;
  border:0;border-radius:var(--v31-s-1);background:none;box-shadow:none;color:var(--v31-text);text-align:start;cursor:pointer;
  font:var(--v31-fw-bold) var(--v31-fs)/var(--v31-lh-head) var(--v31-font);overflow-wrap:break-word}
/* the whole card opens the property; the "..." button and the menu stand above that */
.v31-db-open:not(#v31-kit#v31-kit#v31-kit#v31-kit)::after{content:"";position:absolute;inset:0;border-radius:var(--v31-r-ctl)}
.v31-db-open:not(#v31-kit#v31-kit#v31-kit#v31-kit):hover{color:var(--v31-crm-ink);text-decoration:underline;text-underline-offset:3px}
.v31-db-open:not(#v31-kit#v31-kit#v31-kit#v31-kit):focus-visible{outline:none}
.v31-db-open:not(#v31-kit#v31-kit#v31-kit#v31-kit):focus-visible::after{outline:2px solid var(--v31-focus);outline-offset:2px}
.v31-db-more:not(#v31-kit#v31-kit#v31-kit#v31-kit){position:relative;z-index:1;flex:none;margin:calc(var(--v31-s-1) * -1) calc(var(--v31-s-1) * -1) 0 0}
.v31-db-sub{min-width:0;color:var(--v31-text-2);font:var(--v31-fw) var(--v31-fs-sm)/var(--v31-lh-row) var(--v31-font);overflow-wrap:break-word}
.v31-db-who{color:var(--v31-muted)}
.v31-db-line,.v31-db-kept{display:flex;align-items:flex-start;gap:var(--v31-s-2);min-width:0;color:var(--v31-text);font:var(--v31-fw) var(--v31-fs-sm)/var(--v31-lh-row) var(--v31-font)}
.v31-db-line .v31-i,.v31-db-kept .v31-i{flex:none;width:15px;height:15px;margin-top:1px;color:var(--v31-crm)}
.v31-db-line.is-wait .v31-i{color:var(--v31-warn)}
.v31-db-line>span,.v31-db-kept>span{min-width:0;overflow-wrap:break-word}
.v31-db-kept{color:var(--v31-text-2)}
.v31-db-card.is-closed .v31-db-line{color:var(--v31-text-2)}
.v31-db-card.is-closed .v31-db-line .v31-i{color:var(--v31-muted)}
.v31-db-foot{display:flex;flex-wrap:wrap;align-items:center;gap:var(--v31-s-1) var(--v31-s-2);min-width:0;margin-top:var(--v31-s-1)}
.v31-db-inform{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--v31-warn-bg);color:var(--v31-warn)}
.v31-db-inform .v31-i{width:15px;height:15px}
.v31-db-svcs{display:inline-flex;flex-wrap:wrap;gap:var(--v31-s-1);margin-inline-start:auto}
.v31-db-svc{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--v31-surface-2);color:var(--v31-muted);font-style:normal}
.v31-db-svc .v31-i{width:15px;height:15px}
.v31-db-svc.is-now{background:var(--v31-crm);color:var(--v31-surface)}
.v31-db-svc.is-done{background:var(--v31-ok-bg);color:var(--v31-ok)}

/* "Pārvietot uz...": a small menu under the card's "..." button; the preview line says what LMF will do */
.v31-db-menu{position:absolute;z-index:20;top:44px;left:0;width:248px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:var(--v31-s-1);padding:var(--v31-s-2);
  background:var(--v31-surface);border:1px solid var(--v31-line-strong);border-radius:var(--v31-r);box-shadow:var(--v31-sh-pop)}
.v31-db-menu.is-left{left:auto;right:0}
.v31-db-menu.is-up{top:auto;bottom:calc(100% - 40px)}
/* G1 4.11: the title is a quiet 13 px label, not a row that looks like a choice */
.v31-db-menu-h{padding:var(--v31-s-1) var(--v31-s-2);color:var(--v31-muted);font:var(--v31-fw) var(--v31-fs-sm)/var(--v31-lh-row) var(--v31-font)}
.v31-db-menu-l{display:flex;flex-direction:column;gap:var(--v31-s-1)}
.v31-db-item:not(#v31-kit#v31-kit#v31-kit#v31-kit){display:flex;align-items:center;gap:var(--v31-s-2);width:100%;min-height:var(--v31-ctl);height:auto;margin:0;padding:0 var(--v31-s-2);appearance:none;-webkit-appearance:none;
  border:0;border-radius:var(--v31-s-2);background:none;box-shadow:none;color:var(--v31-text);text-align:start;cursor:pointer;font:var(--v31-fw-bold) var(--v31-fs-sm)/var(--v31-lh-row) var(--v31-font)}
.v31-db-item:not(#v31-kit#v31-kit#v31-kit#v31-kit) .v31-i{flex:none;width:15px;height:15px;color:var(--v31-crm)}
.v31-db-item:not(#v31-kit#v31-kit#v31-kit#v31-kit):hover,.v31-db-item:not(#v31-kit#v31-kit#v31-kit#v31-kit):focus-visible{background:var(--v31-crm-soft);outline:none}
.v31-db-item:not(#v31-kit#v31-kit#v31-kit#v31-kit):focus-visible{box-shadow:inset 0 0 0 2px var(--v31-focus)}
.v31-db-item:not(#v31-kit#v31-kit#v31-kit#v31-kit):disabled{color:var(--v31-muted);cursor:not-allowed}
.v31-db-item:not(#v31-kit#v31-kit#v31-kit#v31-kit)[aria-busy="true"]{cursor:progress;background:var(--v31-crm-soft)}
.v31-db-item-t{flex:1;min-width:0}
.v31-db-item-b{display:inline-flex;align-items:center;gap:var(--v31-s-1);color:var(--v31-muted);font:var(--v31-fw) var(--v31-fs-xs)/1 var(--v31-font)}
.v31-db-item-b .v31-i{color:var(--v31-muted)}
.v31-db-menu-pre{margin:0;padding:var(--v31-s-2);border-top:1px solid var(--v31-line);color:var(--v31-text-2);font:var(--v31-fw) var(--v31-fs-sm)/var(--v31-lh) var(--v31-font);text-wrap:pretty}
.v31-db-menu-pre:empty{display:none}
.v31-db-menu-pre.is-wait{color:var(--v31-muted)}
.v31-db-menu-pre.is-refused{color:var(--v31-late)}
.v31-db-menu-slot:empty{display:none}

.v31-db-more-row{display:flex;justify-content:center}

@media (prefers-reduced-motion:reduce){.v31-db-card{transition:none}}

/* four columns on a narrow PC window */
@media (max-width:1179px){.v31-db-cols{flex-wrap:wrap}.v31-db-col,.v31-db-col.is-empty{flex:1 1 calc(25% - var(--v31-s-2))}}

/* phone: one column, the thing to do first; an empty column is only its heading row */
@media (max-width:720px){
  .v31-db-seg{margin-inline-start:0}
  .v31-db-cols{flex-direction:column;align-items:stretch}
  .v31-db-col,.v31-db-col.is-empty,.v31-db-cols.is-closed .v31-db-col{flex:none;min-height:0}
  .v31-db-col-h{flex-direction:row;flex-wrap:wrap;align-items:center;gap:var(--v31-s-2) var(--v31-s-3)}
  .v31-db-col-h .v31-db-bar{order:3;flex-basis:100%}
  .v31-db-col-n{order:2;margin-inline-start:auto;min-height:0}
  .v31-db-col-n b{font-size:var(--v31-fs-md)}
  .v31-db-col-t{order:1;font-size:var(--v31-fs)}
  .v31-db-col.is-empty .v31-db-col-b{display:none}
  .v31-db-more:not(#v31-kit#v31-kit#v31-kit#v31-kit){min-width:44px;min-height:44px}
  .v31-db-item:not(#v31-kit#v31-kit#v31-kit#v31-kit){min-height:44px;font-size:var(--v31-fs)}
  .v31-db-menu{width:auto;left:0;right:0}
  .v31-db-empty:not(#v31-kit#v31-kit#v31-kit#v31-kit){grid-template-columns:var(--v31-gut) minmax(0,1fr)}
  .v31-db-empty:not(#v31-kit#v31-kit#v31-kit#v31-kit)>.v31-btn{grid-column:1 / -1;grid-row:auto;width:100%;min-width:0}
}
