/* The shared look of Sanaol's working surfaces: the owner console and the partner cabinet.
   Both build on the storefront's tokens, so they follow the brand automatically, but everything
   is scoped under .console / .cabinet — nothing here can reach a customer-facing screen. */
.console, .cabinet {
  --c-gap: 16px;
  --c-line: var(--line, #18151b);
  --c-paper: var(--paper, #fffdf8);
  --c-ink: var(--ink, #18151b);
  --c-muted: var(--muted, #6d6574);
  --c-accent: var(--coral, #f27662);
  --c-ok: var(--green, #318b55);
  --c-wait: var(--gold, #c89550);
  --c-off: var(--plum, #9e3158);
}

/* One thing to do, with no list behind it. */
.c-task.solo > .c-row { border-top: 0; }

/* Numbers first, always in the same four slots. */
.c-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: var(--c-gap); }
.c-kpi {
  padding: 14px 16px; border: 1.5px solid var(--c-line); border-radius: 14px; background: var(--c-paper);
  display: flex; flex-direction: column; gap: 2px;
}
.c-kpi span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--c-muted); }
.c-kpi strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.c-kpi em { font-style: normal; font-size: .78rem; color: var(--c-muted); }
.c-card {
  border: 1.5px solid var(--c-line); border-radius: 16px; background: var(--c-paper);
  margin-bottom: var(--c-gap); overflow: hidden;
}
.c-card-head { padding: 16px 18px 10px; }
.c-card-head h2 { margin: 0; font-size: 1rem; }
.c-card-head .small { margin: 4px 0 0; }
/* One row shape everywhere: lead, main, value, actions. */
.c-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px;
  border-top: 1px solid color-mix(in srgb, var(--c-line) 18%, transparent);
  color: inherit; text-decoration: none;
}
.c-card > .c-row:first-child, .c-card-head + .c-row { border-top: 0; }
.c-row.link { cursor: pointer; }
.c-row.link:hover { background: color-mix(in srgb, var(--c-accent) 7%, transparent); }
.c-row.warn { box-shadow: inset 3px 0 0 var(--c-wait); }
.c-row.danger { box-shadow: inset 3px 0 0 var(--c-off); }
.c-row-lead { flex: none; }
.c-row-lead img { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; display: block; border: 1px solid var(--c-line); }
.c-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.c-row-main strong { font-size: .94rem; font-weight: 700; }
.c-row-main span { font-size: .78rem; color: var(--c-muted); overflow-wrap: anywhere; }
.c-row-value { flex: none; text-align: right; font-size: .82rem; font-variant-numeric: tabular-nums; }
.c-row-value strong { font-size: 1rem; }
.c-row-actions { flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.c-row-go { flex: none; opacity: .35; }
.c-row-go svg { width: 18px; }
.c-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--peach, #ffd2c7); border: 1.5px solid var(--c-line);
  font-size: .78rem; font-weight: 800; letter-spacing: .02em;
}
.c-rank {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  border: 1.5px solid var(--c-line); font-weight: 800; font-size: .85rem;
}
.c-chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1.5px solid var(--c-line);
  font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.c-chip.ok { background: var(--green-soft, #e8f4ee); color: var(--c-ok); border-color: var(--c-ok); }
.c-chip.wait { background: color-mix(in srgb, var(--c-wait) 16%, transparent); color: #7a5a1e; border-color: var(--c-wait); }
.c-chip.off { background: color-mix(in srgb, var(--c-off) 12%, transparent); color: var(--c-off); border-color: var(--c-off); }
.c-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 18px 0; }
.c-dim { color: var(--c-muted); font-weight: 400; }
.c-danger { color: var(--c-off); }
.c-empty { margin: 0; padding: 22px 18px; color: var(--c-muted); font-size: .88rem; }
.c-break { overflow-wrap: anywhere; }
/* The queue on Today: the work is inside the task, not one click away. */
.c-task {
  border: 1.5px solid var(--c-line); border-radius: 16px; background: var(--c-paper);
  margin-bottom: 12px; overflow: hidden;
}
.c-task.warn { border-color: var(--c-wait); }
.c-task > summary {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none;
}
.c-task > summary::-webkit-details-marker { display: none; }
.c-task > summary div { display: flex; flex-direction: column; gap: 1px; }
.c-task > summary strong { font-size: .96rem; }
.c-task > summary span { font-size: .78rem; color: var(--c-muted); }
.c-task-count {
  flex: none; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px;
  display: grid; place-items: center; background: var(--c-accent); color: #fff;
  border: 1.5px solid var(--c-line); font-weight: 800; font-variant-numeric: tabular-nums;
}
.c-task.warn .c-task-count { background: var(--c-wait); }
.c-task-body { border-top: 1px solid color-mix(in srgb, var(--c-line) 18%, transparent); }
.c-task-body .c-row:first-child { border-top: 0; }
.c-more { display: block; padding: 12px 18px; font-size: .82rem; font-weight: 700; color: var(--c-accent); text-decoration: none; }
.c-clear { display: flex; align-items: center; gap: 14px; padding: 22px 18px; }
.c-clear svg { width: 26px; flex: none; color: var(--c-ok); }
.c-clear div { display: flex; flex-direction: column; gap: 2px; }
.c-feed { list-style: none; margin: 0; padding: 6px 18px 16px; display: flex; flex-direction: column; gap: 7px; }
.c-feed.long { max-height: 460px; overflow-y: auto; }
.c-feed li { font-size: .82rem; color: var(--c-ink); }
.c-feed li span:first-child { display: inline-block; min-width: 92px; color: var(--c-muted); font-variant-numeric: tabular-nums; }
/* Switching between two lists of the same kind. */
.c-segmented { display: flex; gap: 6px; margin-bottom: 12px; }
.c-segmented button {
  flex: 1 1 0; padding: 10px 12px; border: 1.5px solid var(--c-line); border-radius: 12px;
  background: var(--c-paper); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
}
.c-segmented button.active { background: var(--c-ink); color: var(--c-paper); }
.c-segmented b { font-variant-numeric: tabular-nums; opacity: .6; }
.c-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; }
.c-card > .c-filters:first-child { padding-top: 16px; }
.c-filters button {
  padding: 6px 12px; border: 1.5px solid var(--c-line); border-radius: 999px; background: transparent;
  font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; color: var(--c-ink);
}
.c-filters button.active { background: var(--c-ink); color: var(--c-paper); }
.c-filters b { font-variant-numeric: tabular-nums; opacity: .6; }
.c-search { padding: 16px 18px 10px; }
.c-search input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--c-line); border-radius: 12px;
  background: var(--cream, #f5efff); font: inherit; font-size: .9rem;
}
.c-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 18px; }
.c-card > .c-actions { padding-top: 0; }
.c-link {
  border: 0; background: none; padding: 0; font: inherit; font-size: .8rem; font-weight: 700;
  color: var(--c-off); text-decoration: underline; cursor: pointer;
}
.c-note {
  margin: 0 18px 14px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px dashed var(--c-line); background: var(--cream, #f5efff); font-size: .84rem;
}
.c-good { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 18px 16px; font-size: .9rem; color: var(--c-ok); font-weight: 700; }
.c-good svg { width: 20px; }
.c-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 16px 18px; }
.c-fact { display: flex; flex-direction: column; gap: 2px; }
.c-fact span { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--c-muted); }
.c-fact strong { font-size: .92rem; overflow-wrap: anywhere; }
.c-bars { display: flex; flex-direction: column; gap: 12px; padding: 0 18px 18px; }
.c-bars > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.c-bars span { font-size: .8rem; color: var(--c-muted); }
.c-bars b { font-size: .85rem; font-variant-numeric: tabular-nums; }
.c-bars i {
  grid-column: 1 / -1; height: 8px; border-radius: 999px; border: 1.5px solid var(--c-line);
  background: linear-gradient(to right, var(--c-accent) var(--fill), transparent var(--fill));
}
.c-back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px;
  font-size: .84rem; font-weight: 700; color: var(--c-muted); text-decoration: none;
}
.c-back svg { width: 16px; }
.c-back:hover { color: var(--c-ink); }
.c-form { padding: 16px 18px; }
.c-card > .c-form { padding-top: 0; }
.c-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.c-form .field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.c-form label { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: var(--c-muted); }
.c-form input, .c-form select {
  padding: 10px 13px; border: 1.5px solid var(--c-line); border-radius: 11px;
  background: var(--cream, #f5efff); font: inherit; font-size: .9rem; width: 100%;
}
.c-form .error { display: none; }
.c-form .error.show { display: block; margin-bottom: 10px; color: var(--c-off); font-size: .84rem; font-weight: 700; }
@media (max-width: 720px) {
  /* Two numbers per row on a phone: one per row turns the screen into a scroll. */
  .c-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .c-kpi { padding: 11px 12px; }
  .c-kpi strong { font-size: 1.2rem; }
  .c-kpi span { font-size: .64rem; }
  .c-kpi em { font-size: .7rem; }
  .c-row { padding: 12px 14px; gap: 10px; }
  .c-card-head, .c-search, .c-filters, .c-actions, .c-facts, .c-form { padding-left: 14px; padding-right: 14px; }
  .c-task > summary { padding: 12px 14px; }
  .c-row { flex-wrap: wrap; }
  /* Keep the avatar next to the name; the amount and the buttons drop to their own lines. */
  .c-row-main { flex: 1 1 55%; }
  .c-row-value { flex: 1 0 100%; text-align: left; }
  .c-row-actions { width: 100%; justify-content: flex-start; }
  .c-row-go { position: absolute; opacity: 0; }
  .c-row.link { position: relative; }
}
