/* One customer (js/views/customer.js, #/customer/<name>).
   Shared tokens and components are in /styles.css (docs/ui-notes-v2.md): the chart, its legend,
   the alert rows of Needs attention and the tables are the Overview's. Every class in this file
   starts with "customer-". Plain ASCII only. */

/* The chart first, the whole width; then today; then its open alerts beside the alert rules that
   watch it (1200 px and wider); then its trunk groups, then the rotations. One column on phones. */
.customer-grid { display: grid; gap: 16px; }
.customer-grid > .panel + .panel { margin-top: 0; }
@media (min-width: 720px) { .customer-grid { gap: 24px; } }
@media (min-width: 1200px) {
  .customer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "chart chart" "today today" "alerts rules" "tgs tgs" "rots rots";
    align-items: start;
  }
  .customer-chart { grid-area: chart; }
  .customer-today { grid-area: today; }
  .customer-alerts { grid-area: alerts; align-self: stretch; }
  .customer-rules-panel { grid-area: rules; align-self: stretch; }
  .customer-tgs { grid-area: tgs; }
  .customer-rots { grid-area: rots; }
}

/* The chart: what it shows (calls per minute, answered, call length) and over how long. */
.customer-chart .panel-head { margin-bottom: 12px; }
.customer-chart .panel-actions { gap: 8px 12px; }
.customer-chart h2 .whatis { margin-left: 0; }
.customer-legend { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 10px; padding: 0; list-style: none; }
.customer-count { color: var(--slate); font-weight: 400; }
.customer-legend .legend-keys { color: var(--slate); }
@media (max-width: 719px) {
  .customer-chart .panel-actions { display: grid; width: 100%; }
  .customer-chart .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .customer-chart .seg button { min-width: 0; padding: 0 6px; }
}

/* Today: four figures, each with what it is above it. */
.customer-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
@media (min-width: 720px) { .customer-figs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.customer-fig { min-width: 0; padding: 8px 12px; border-radius: 6px; background: var(--hover); }
.customer-fig dt { display: flex; align-items: center; color: var(--slate); font-size: 14px; }
.customer-fig dd { margin: 2px 0 0; color: var(--ink); font-size: 26px; line-height: 1.15; }

/* Its open alerts, drawn like Needs attention on Overview. */
.customer-alerts .attn-meta a { font-weight: 700; }

/* Its trunk groups: a table on wide screens, one block per trunk group on phones. */
.customer-table td.num b { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.customer-tg { font-weight: 700; }
.customer-tg-link { display: block; margin-top: 2px; color: var(--slate); font-size: 13px; font-weight: 400; }
.customer-cell-label { display: none; }
@media (max-width: 719px) {
  .customer-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .customer-table, .customer-table tbody { display: block; }
  .customer-table tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .customer-table tr:first-child { padding-top: 0; }
  .customer-table tr:last-child { padding-bottom: 0; border-bottom: 0; }
  .customer-table th, .customer-table td { display: block; padding: 0; border: 0; text-align: left; }
  .customer-table .customer-tg { flex: 1 1 100%; margin-bottom: 4px; }
  .customer-table td.num { flex: none; white-space: nowrap; }
  .customer-cell-label { display: inline; color: var(--slate); font-size: 13px; }
}

/* The alerts that watch it, each a sentence with Edit, and the ways to create one. */
.customer-rules { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.customer-rule { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.customer-rule-text { flex: 1 1 260px; min-width: 0; max-width: 46em; margin: 0; }
.customer-rule.off .customer-rule-text { color: var(--slate); }
.customer-none { margin: 0; color: var(--slate); }
.customer-create { margin-top: 18px; }
.customer-create-title { margin: 0; font-weight: 700; }
.customer-create .secondary { margin: 2px 0 10px; font-size: 14px; }
.customer-create-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 719px) {
  .customer-create-list { display: grid; grid-template-columns: minmax(0, 1fr); }
  .customer-create-list .btn { width: 100%; }
}

/* The rotations in the time the chart shows: the time, then the vendor or trunk group. */
.customer-rot-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.customer-rot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.customer-rot-time { flex: none; min-width: 3.5em; color: var(--slate); font-variant-numeric: tabular-nums; }
.customer-rot-what { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.customer-rot-more { margin: 10px 0 0; color: var(--slate); font-size: 14px; }
