/* =============================================================================
 * WGG Call Centre — layout and look (redesign, Oct 2026)
 * -----------------------------------------------------------------------------
 * Plain CSS, not Tailwind @apply, because two pages load it: the standalone
 * /call-center/ and the Connect+ shell (/app/), which lifts this page's #app
 * markup but not its <head>. Everything is scoped under .cc-ui.
 *
 *   rail (60px) | conversations column (300px) | main (call bar + content)
 *
 * The approved design is call-center/dev/redesign-mock.html.
 * ========================================================================== */
.cc-ui {
    --cc-font: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
    --cc-mono: 'IBM Plex Mono', ui-monospace, monospace;
    --cc-rail: #0f1b33;            /* WGG navy, darkened: the one fixed brand surface */
    --cc-rail-tx: #8d97ab;
    --cc-side: #ffffff;
    --cc-surface: #f7f6f3;
    --cc-surface-2: #efeee9;
    --cc-line: #10183014;
    --cc-line-2: #10183024;
    --cc-tx: #121722;
    --cc-tx-2: #4a5263;
    --cc-tx-3: #8a909c;
    --cc-brand: #00397d;
    --cc-on-brand: #ffffff;
    --cc-live: #0f9d63;
    --cc-live-soft: #0f9d6314;
    --cc-ring: #1f5fb3;
    --cc-ring-soft: #1f5fb31a;
    --cc-warn: #b86e00;
    --cc-warn-soft: #b86e0014;
    --cc-hot: #d42f2f;
    --cc-hot-soft: #d42f2f12;
    --cc-shadow: 0 1px 2px #1018300d, 0 8px 24px -12px #10183026;
    --cc-top: var(--wgg-top, 0px);
    font-family: var(--cc-font);
}
.dark .cc-ui, .cc-ui.dark {
    --cc-rail: #0a0c0f;
    --cc-side: #13161c;
    --cc-surface: #191d25;
    --cc-surface-2: #212632;
    --cc-line: #ffffff10;
    --cc-line-2: #ffffff1c;
    --cc-tx: #e9ecf2;
    --cc-tx-2: #a3abb9;
    --cc-tx-3: #6b7383;
    --cc-brand: #5b8cff;
    --cc-on-brand: #06122e;
    --cc-live: #3ddc97;
    --cc-live-soft: #3ddc9719;
    --cc-ring: #5b8cff;
    --cc-ring-soft: #5b8cff22;
    --cc-warn: #f5b14c;
    --cc-warn-soft: #f5b14c1a;
    --cc-hot: #ff5d5d;
    --cc-hot-soft: #ff5d5d1a;
    --cc-shadow: 0 1px 0 #ffffff08 inset, 0 12px 32px -12px #000c;
}
.cc-ui, .cc-ui button, .cc-ui input, .cc-ui select, .cc-ui textarea { font-family: var(--cc-font); }
/* Numbers that change while you watch them must not wobble. */
.cc-ui .font-mono, .cc-ui code, .cc-ui .tabular-nums, .cc-ui .cc-num { font-family: var(--cc-mono); font-variant-numeric: tabular-nums; }
.cc-ui .font-display { font-family: 'Bricolage Grotesque', var(--cc-font); letter-spacing: -.01em; }
.cc-ui * { scrollbar-width: thin; }
.dark .cc-ui { color-scheme: dark; }

/* ---------------------------------------------------------------- shell */
.cc-shell { display: grid; grid-template-columns: 60px 300px minmax(0, 1fr); min-height: calc(100vh - var(--cc-top)); }

/* icon rail: every section, always visible, never scrolls */
.cc-iconrail {
    position: sticky; top: var(--cc-top); height: calc(100vh - var(--cc-top)); z-index: 35;
    background: var(--cc-rail); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0;
}
.cc-logo { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; margin-bottom: 12px; }
.cc-rail-btn {
    position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
    color: var(--cc-rail-tx); font-size: 15px; transition: background .15s, color .15s;
}
.cc-rail-btn:hover { background: #ffffff12; color: #e6ebf5; }
.cc-rail-btn.on { background: #ffffff1a; color: #fff; }
.cc-rail-btn.on::before { content: ''; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: #5b8cff; }
.cc-rail-btn.live { color: #3ddc97; }
.cc-rail-btn.live::after { content: ''; position: absolute; inset: 6px; border-radius: 8px; border: 1.5px solid #3ddc9766; animation: cc-pulse 1.6s ease-out infinite; }
.cc-pip { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; border-radius: 8px; background: #f5b14c; color: #1d1300; font: 600 9.5px/16px var(--cc-mono); padding: 0 4px; text-align: center; }
/* Tooltips: the label of every icon, because an icon alone is a guess. */
.cc-tip { position: absolute; left: 52px; top: 50%; transform: translateY(-50%); white-space: nowrap; background: #1d2230; color: #fff; font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 6px; box-shadow: var(--cc-shadow); pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 60; }
.cc-rail-btn:hover .cc-tip, .cc-rail-btn:focus-visible .cc-tip { opacity: 1; }
.cc-me { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; margin-top: 6px; }
.cc-me .cc-me-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--cc-rail); }
@keyframes cc-pulse { 0% { opacity: 1; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.25); } }

/* conversations column */
.cc-side {
    position: sticky; top: var(--cc-top); height: calc(100vh - var(--cc-top)); z-index: 20;
    background: var(--cc-side); border-right: 1px solid var(--cc-line); display: flex; flex-direction: column; min-width: 0;
}
.cc-side-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--cc-line); }
.cc-side-scroll { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
/* Cards inside the column sit flat: the column is already the surface. */
.cc-side-scroll .card { box-shadow: none; }
.cc-search {
    width: 100%; margin-top: 10px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
    background: var(--cc-surface); color: var(--cc-tx-3); font-size: 13px; border: 1px solid transparent; transition: border-color .12s;
}
.cc-search:hover { border-color: var(--cc-line-2); }
.cc-kbd { margin-left: auto; font: 500 11px var(--cc-mono); padding: 1px 6px; border-radius: 5px; background: var(--cc-surface-2); color: var(--cc-tx-2); border-bottom: 1px solid var(--cc-line-2); }
.cc-status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 9px; border-radius: 999px; background: var(--cc-surface); font-weight: 600; font-size: 13px; color: var(--cc-tx); }
.cc-status-pill .cc-dot { width: 8px; height: 8px; border-radius: 50%; }
.cc-sub { color: var(--cc-tx-3); font-size: 12px; }

/* collapsible sections at the bottom of the column (dial, team, tools) */
.cc-fold { border-radius: 12px; background: var(--cc-surface); }
.cc-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 12.5px; font-weight: 600; color: var(--cc-tx-2); }
.cc-fold > summary::-webkit-details-marker { display: none; }
.cc-fold > summary .cc-chev { margin-left: auto; font-size: 10px; transition: transform .15s; }
.cc-fold[open] > summary .cc-chev { transform: rotate(180deg); }
.cc-fold > .cc-fold-body { padding: 0 12px 12px; }

/* --------------------------------------------------------------- main */
.cc-main { min-width: 0; display: flex; flex-direction: column; }
.cc-content { width: 100%; max-width: 1400px; margin: 0 auto; padding: 16px 20px 28px; }
.cc-content > * + * { margin-top: 16px; }

/* the call bar: one strip, always in the same place, in every call state */
.cc-callbar {
    position: sticky; top: var(--cc-top); z-index: 25;
    background: var(--cc-side); border-bottom: 1px solid var(--cc-line);
    padding: 12px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
}
.cc-callbar.live { background: linear-gradient(90deg, var(--cc-live-soft), transparent 60%), var(--cc-side); }
.cc-callbar.held { background: linear-gradient(90deg, var(--cc-warn-soft), transparent 60%), var(--cc-side); }
.cc-callbar.ringing { background: linear-gradient(90deg, var(--cc-ring-soft), transparent 70%), var(--cc-side); }
.cc-callbar.ringing::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--cc-ring); animation: cc-ringline 1.2s cubic-bezier(.2,.8,.2,1) infinite; transform-origin: left; }
.cc-callbar.wrap { background: linear-gradient(90deg, var(--cc-warn-soft), transparent 60%), var(--cc-side); }
.cc-callbar.dialing { background: linear-gradient(90deg, var(--cc-ring-soft), transparent 60%), var(--cc-side); }
@keyframes cc-ringline { 0% { transform: scaleX(0); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
.cc-cb-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cc-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex: none; }
.cc-cb-state { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.cc-callbar.live .cc-cb-state { color: var(--cc-live); }
.cc-callbar.held .cc-cb-state, .cc-callbar.wrap .cc-cb-state { color: var(--cc-warn); }
.cc-callbar.ringing .cc-cb-state, .cc-callbar.dialing .cc-cb-state { color: var(--cc-ring); }
.cc-cb-name { font: 700 17px/1.2 'Bricolage Grotesque', var(--cc-font); letter-spacing: -.01em; color: var(--cc-tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28ch; }
.cc-cb-sub { color: var(--cc-tx-2); font-size: 12.5px; }
.cc-timer { font: 500 26px/1 var(--cc-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--cc-tx); margin-left: 6px; }
.cc-rec { display: inline-flex; align-items: center; gap: 6px; font: 600 11px var(--cc-mono); color: var(--cc-hot); padding: 3px 8px; border-radius: 6px; background: var(--cc-hot-soft); }
.cc-rec::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: cc-blink 1.6s infinite; }
@keyframes cc-blink { 50% { opacity: .25; } }
.cc-cb-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cc-cbtn {
    height: 38px; padding: 0 14px; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px;
    font-weight: 600; font-size: 13px; background: var(--cc-surface); color: var(--cc-tx); transition: background .12s, transform .08s;
}
.cc-cbtn:hover:not(:disabled) { background: var(--cc-surface-2); }
.cc-cbtn:active:not(:disabled) { transform: scale(.97); }
.cc-cbtn:disabled { opacity: .45; cursor: not-allowed; }
.cc-cbtn.on { background: var(--cc-warn-soft); color: var(--cc-warn); }
.cc-cbtn.hang { background: var(--cc-hot); color: #fff; }
.cc-cbtn.hang:hover:not(:disabled) { background: color-mix(in srgb, var(--cc-hot) 86%, #000); }
.cc-cbtn.answer { background: var(--cc-live); color: #04251a; padding: 0 18px; }
.dark .cc-ui .cc-cbtn.answer { color: #04251a; }
.cc-cbtn.answer:hover:not(:disabled) { background: color-mix(in srgb, var(--cc-live) 88%, #000); }
.cc-cbtn.primary { background: var(--cc-brand); color: var(--cc-on-brand); }
.cc-cbtn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--cc-brand) 88%, #000); }
.cc-cbtn .cc-kbd { margin-left: 2px; }
.cc-divider { width: 1px; height: 24px; background: var(--cc-line-2); }
.cc-cb-note { flex-basis: 100%; font-size: 12px; color: var(--cc-warn); }
/* wrap-up fields sit on their own row under the bar */
.cc-wrapform { flex-basis: 100%; display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.cc-keypad-pop { flex-basis: 100%; display: flex; align-items: center; gap: 12px; }
.cc-keypad-pop .keypad-key { min-width: 44px; }

/* ---------------------------------------------------- the case (workspace)
 * Conversation wide on the left; customer + account under Details, the
 * knowledge finder under Assist, on the right. Grid areas keep the markup
 * order of views/workspace.js unchanged. */
.cc-ws { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto auto auto 1fr; grid-template-areas: "main tabs" "main left" "main right" "main assist"; align-items: start; }
.cc-ws-main { grid-area: main; align-self: stretch; }
.cc-ws-tabs { grid-area: tabs; display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--cc-surface-2); }
.cc-ws-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--cc-tx-3); transition: background .12s, color .12s; }
.cc-ws-tabs button.on { background: var(--cc-side); color: var(--cc-tx); box-shadow: var(--cc-shadow); }
.cc-ws-left { grid-area: left; min-width: 0; }
.cc-ws-right { grid-area: right; min-width: 0; }
.cc-ws-assist { grid-area: assist; min-width: 0; }
@media (max-width: 1279px) {
    .cc-ws { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "main" "tabs" "left" "right" "assist"; }
}

/* ----------------------------------------------- command palette (Ctrl K) */
.cc-cmdk-wrap { position: fixed; inset: 0; z-index: 100; background: #05070acc; display: flex; align-items: flex-start; justify-content: center; padding: 14vh 16px 16px; }
.cc-cmdk { width: 100%; max-width: 620px; border-radius: 16px; background: var(--cc-side); box-shadow: 0 30px 80px -20px #000, 0 0 0 1px var(--cc-line-2); overflow: hidden; animation: cc-pop .16s cubic-bezier(.2,.8,.2,1); color: var(--cc-tx); }
@keyframes cc-pop { from { transform: scale(.98) translateY(-6px); opacity: 0; } }
.cc-cmdk input { width: 100%; padding: 18px 20px; font-size: 16px; background: transparent; border: 0; outline: 0; border-bottom: 1px solid var(--cc-line); color: inherit; }
.cc-cmdk ul { list-style: none; margin: 0; padding: 8px; max-height: 380px; overflow-y: auto; }
.cc-cmdk .cc-grp { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cc-tx-3); padding: 10px 12px 4px; }
.cc-cmdk .cc-it { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.cc-cmdk .cc-it i { width: 16px; text-align: center; color: var(--cc-tx-3); }
.cc-cmdk .cc-it .cc-hint { margin-left: auto; color: var(--cc-tx-3); font-size: 12px; }
.cc-cmdk .cc-it.on { background: var(--cc-surface); }
.cc-cmdk .cc-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--cc-line); color: var(--cc-tx-3); font-size: 12px; }

/* ------------------------------------------------------- small screens */
@media (max-width: 1279px) { .cc-shell { grid-template-columns: 60px 270px minmax(0, 1fr); } .cc-cbtn .cc-lbl { display: none; } }
@media (max-width: 1023px) {
    .cc-shell { display: block; }
    .cc-iconrail { position: sticky; height: auto; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 6px 10px; }
    .cc-iconrail::-webkit-scrollbar { display: none; }
    .cc-iconrail .cc-logo { margin: 0 6px 0 0; }
    .cc-iconrail .cc-grow { display: none; }
    .cc-rail-btn.on::before { left: 10px; right: 10px; top: auto; bottom: -6px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
    .cc-tip { display: none; }
    .cc-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--cc-line); }
    .cc-callbar { top: calc(var(--cc-top) + 52px); }
    .cc-content { padding: 12px; }
    .cc-wrapform { grid-template-columns: 1fr; }
    .cc-kbd { display: none; }   /* no keyboard on a phone */
}
@media (prefers-reduced-motion: reduce) {
    .cc-ui *, .cc-ui *::before, .cc-ui *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
