:root {
  --bg: #f3f7ff; --panel: #ffffff; --text: #1e293b; --muted: #64748b; --line: #e3e9f5; --line-soft: #eef3fb;
  --accent: #1f8f8c; --accent-2: #06b6d4; --accent-weak: #e6f4f3;
  --ok: #10b981; --ok-weak: #dcfce7; --warn: #f59e0b; --warn-weak: #fef3c7; --ng: #f43f5e; --ng-weak: #ffe4e9;
  --info: #0ea5e9; --info-weak: #e0f2fe; --pink: #ec4899; --violet: #8b5cf6; --orange: #f97316;
  --radius: 16px; --shadow: 0 1px 2px rgba(30,41,59,.04), 0 6px 20px rgba(31,143,140,.07);
  --grad: linear-gradient(120deg, #06b6d4 0%, #1f8f8c 55%, #3cc2bd 100%);
  --grad-warm: linear-gradient(120deg, #fb7185 0%, #f97316 100%);
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body { margin: 0; font-family: "Inter", -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; font-size: 14px; color: var(--text);
  background: radial-gradient(60% 40% at 0% 0%, #e0f7ff 0%, transparent 60%), radial-gradient(50% 40% at 100% 0%, #fdeaff 0%, transparent 60%), var(--bg); background-attachment: fixed; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 14px; font-weight: 700; transition: all .15s; }
button:hover:not(:disabled) { border-color: #c7d2fe; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(31,143,140,.12); }
button.primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 6px 16px rgba(31,143,140,.3); }
button.danger { background: var(--grad-warm); color: #fff; border: 0; box-shadow: 0 6px 16px rgba(244,63,94,.3); }
button.ghost { background: #fff; }
button:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }
input, select, textarea { border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 11px; background: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-weak); }
a { color: var(--accent); }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0 0 20px; font-size: 13px; }
h2 { font-size: 15px; margin: 22px 0 10px; letter-spacing: -.01em; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--text); margin: 0 0 12px; }
.panel-title .dotc { width: 10px; height: 10px; border-radius: 4px; background: var(--grad); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; }
.grid label, .field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
.grid label input, .grid label select { color: var(--text); font-size: 14px; font-weight: 400; }
table { border-collapse: separate; border-spacing: 0; width: 100%; background: #fff; }
th, td { border-bottom: 1px solid var(--line-soft); padding: 10px 12px; text-align: left; white-space: nowrap; }
th { background: #f7f9ff; font-size: 11px; font-weight: 800; color: #6b7aa1; letter-spacing: .04em; position: sticky; top: 0; z-index: 1; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: #f1f8f7; }
.table-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 12px; background: #fff; cursor: pointer; user-select: none; font-size: 13px; font-weight: 600; transition: all .12s; }
.chip:hover { border-color: #c7d2fe; background: #f8f9ff; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 3px 10px rgba(31,143,140,.3); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ng); color: #fff; font-size: 11px; font-weight: 800; }

/* KPI：1枚ずつ違う色 */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.kpi { --c: var(--accent); position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -24px; top: -24px; width: 84px; height: 84px; border-radius: 50%; background: var(--c); opacity: .12; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--c); }
.kpi .v { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: 4px; color: var(--c); }
.kpi .l { font-size: 12px; font-weight: 700; color: var(--muted); }
.kpis .kpi:nth-child(6n+1) { --c: #1f8f8c; } .kpis .kpi:nth-child(6n+2) { --c: #0ea5e9; } .kpis .kpi:nth-child(6n+3) { --c: #10b981; }
.kpis .kpi:nth-child(6n+4) { --c: #f59e0b; } .kpis .kpi:nth-child(6n+5) { --c: #ec4899; } .kpis .kpi:nth-child(6n+6) { --c: #8b5cf6; }
.kpi.hero { background: var(--grad); border: 0; }
.kpi.hero::before { display: none; } .kpi.hero::after { background: #fff; opacity: .18; }
.kpi.hero .v, .kpi.hero .l { color: #fff; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #eef2f7; color: var(--muted); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-ready { background: var(--ok-weak); color: #059669; }
.st-talking { background: var(--info-weak); color: #0284c7; }
.st-dialing { background: #ede9fe; color: #7c3aed; }
.st-wrapup { background: var(--warn-weak); color: #d97706; }
.st-break, .st-offline { background: #eef2f7; color: var(--muted); }
.st-ready::before, .st-talking::before, .st-dialing::before { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.toast { position: fixed; right: 20px; bottom: 20px; background: #1e293b; color: #fff; padding: 12px 16px; border-radius: 14px; opacity: 0; transform: translateY(8px); transition: all .2s; z-index: 99; box-shadow: 0 10px 30px rgba(30,41,59,.25); font-weight: 700; }
.toast.show { opacity: 1; transform: none; }
.modal-bg { position: fixed; inset: 0; background: rgba(30,41,59,.35); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: 20px; padding: 24px; width: min(920px, 94vw); max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(30,41,59,.25); }
.ico { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }

/* 画面のふち：転送の受付状況をひと目でわかるように（緑＝受付中、青＝対応中、赤＝全員対応中、グレー＝受け付けていない） */
body.frame-green::after, body.frame-blue::after, body.frame-red::after, body.frame-gray::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 200; border: 6px solid var(--frame); transition: border-color .3s;
}
body.frame-green { --frame: #10b981; } body.frame-blue { --frame: #3b82f6; } body.frame-red { --frame: #f43f5e; } body.frame-gray { --frame: #94a3b8; }
body.frame-green::after { animation: framePulse 2.4s ease-in-out infinite; }
@keyframes framePulse { 0%, 100% { border-color: #10b981; } 50% { border-color: #6ee7b7; } }

/* ---------- チャット ---------- */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.chat-tabs button { flex: 1; padding: 6px 8px; font-size: 13px; border-radius: 10px; background: #f1f5f9; border-color: transparent; color: var(--muted); }
.chat-tabs button.on { background: var(--grad); color: #fff; }
.cbadge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 5px; border-radius: 999px; background: var(--ng); color: #fff; font-size: 11px; font-weight: 800; }
.chat-tabs button.on .cbadge { background: #fff; color: var(--ng); }
.chat-peer { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .chat-peer[hidden] { display: none; }
.chat-peer button { padding: 3px 10px; font-size: 12px; }
.chat-users { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 3px; } .chat-users[hidden] { display: none; }
.chat-user { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; text-align: left; font-size: 13px; background: #fff; }
.chat-user small { font-size: 10px; color: var(--accent); background: var(--accent-weak); padding: 1px 6px; border-radius: 999px; }
.chat-user .cbadge { margin-left: auto; }
.chat-user .dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; flex-shrink: 0; } .chat-user .dot.on { background: #10b981; }
.chat-msgs { flex: 1; min-height: 60px; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 6px 2px; background: #f8faff; border-radius: 12px; } .chat-msgs[hidden] { display: none; }
.cmsg { max-width: 86%; align-self: flex-start; margin: 0 6px; }
.cmsg.mine { align-self: flex-end; }
.cfrom { font-size: 10px; font-weight: 800; color: var(--muted); margin: 0 0 1px 4px; }
.cbody { padding: 6px 10px; border-radius: 12px 12px 12px 4px; background: #fff; border: 1px solid var(--line); font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.cmsg.mine .cbody { background: linear-gradient(120deg, #1f8f8c, #8b5cf6); color: #fff; border: 0; border-radius: 12px 12px 4px 12px; }
.ctime { font-size: 9px; color: var(--muted); margin: 1px 4px 0; } .cmsg.mine .ctime { text-align: right; }
.cempty { margin: auto; color: var(--muted); font-size: 12px; text-align: center; padding: 10px; }
.chat-form { display: flex; gap: 6px; margin-top: 6px; } .chat-form[hidden] { display: none; }
.chat-form input { flex: 1; min-width: 0; padding: 7px 10px; font-size: 13px; }
.chat-form button { padding: 7px 12px; font-size: 13px; }

/* =====================================================================
   落ち着いたテーマ（2026-10-14）
   基本は白とグレー、強調は藍色1色。色は「状態」（緑＝待機・受付中／青＝通話／黄＝後処理・保留／赤＝注意）だけに使う。
   ===================================================================== */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --text: #111827; --muted: #6b7280; --line: #e5e7eb; --line-soft: #f0f1f4;
  --accent: #1f8f8c; --accent-weak: #e6f4f3; --grad: #1f8f8c; --grad-warm: #dc2626;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.04); --radius: 12px;
}
body { background: var(--bg); }
button { border: 1px solid var(--line); border-radius: 10px; font-weight: 700; }
button:hover:not(:disabled) { transform: none; box-shadow: none; background: #f9fafb; border-color: #d1d5db; }
button.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); box-shadow: none; }
button.primary:hover:not(:disabled) { background: #176f6d; border-color: #176f6d; }
button.danger { background: #dc2626; color: #fff; border: 1px solid #dc2626; box-shadow: none; }
button.danger:hover:not(:disabled) { background: #b91c1c; }
input, select, textarea { border: 1px solid #d1d5db; border-radius: 8px; }
.panel { border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-title { color: #374151; font-size: 12px; letter-spacing: .02em; }
.panel-title .dotc { background: var(--accent); width: 6px; height: 14px; border-radius: 3px; }
th { background: #f9fafb; color: #6b7280; }
.table-wrap { box-shadow: var(--shadow); border-radius: var(--radius); }
.chip { border: 1px solid var(--line); }
.chip.on { background: #111827; border-color: #111827; box-shadow: none; }
.kpi { box-shadow: var(--shadow); }
.kpi::after { display: none; }
.kpi::before { inset: 16px auto auto 18px; width: 8px; height: 8px; border-radius: 50%; }
.kpi .l { padding-left: 14px; }
.kpi .v { color: var(--text); font-size: 28px; }
.kpi.hero { background: #fff; border: 1px solid var(--line); }
.kpi.hero::before { display: block; background: var(--accent); }
.kpi.hero .v, .kpi.hero .l { color: var(--text); } .kpi.hero .l { color: var(--muted); }
.count { background: #dc2626; }
.toast { background: #111827; border-radius: 10px; }
.cmsg.mine .cbody { background: var(--accent); }
.chat-tabs button.on { background: #111827; }
.chat-msgs { background: #f9fafb; }
body.frame-green::after, body.frame-blue::after, body.frame-red::after, body.frame-gray::after { border-width: 4px; }
body.frame-green::after { animation: none; }

/* ===== NEXT のブランド（コーポレートサイトと同じ色：濃い紺緑 × ティール） ===== */
:root {
  --brand-ink: #0f1d26; --brand: #1f8f8c; --brand-l: #3cc2bd; --brand-d: #176f6d;
  --accent: #1f8f8c; --accent-2: #3cc2bd; --accent-weak: #e6f4f3;
  --grad: linear-gradient(115deg, #1d4a4c 0%, #1f8f8c 60%, #3cc2bd 100%);
}
button.primary { background: var(--brand); border-color: var(--brand); }
button.primary:hover:not(:disabled) { background: var(--brand-d); border-color: var(--brand-d); }
.brand-mark { display: inline-flex; align-items: center; gap: 8px; font-family: "Montserrat", "Hiragino Sans", sans-serif; font-weight: 800; letter-spacing: .04em; color: var(--brand-ink); }
.brand-mark img { height: 28px; width: 28px; display: block; }
.nc-w { font-family: "Montserrat", "Hiragino Sans", sans-serif; font-weight: 900; letter-spacing: .02em; color: var(--brand-ink); white-space: nowrap; font-size: 16px; }
.nc-w i { font-style: normal; color: var(--brand); margin-left: .18em; }
.brand .co { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 4px; }
