@media (max-width:700px) {
  .shell .view {padding-inline:12px;}
  .view .heading {gap:10px; align-items:center;}
  .view .heading > div:first-child {min-width:0;}
  .view .heading h1 {font-size:clamp(24px,7vw,30px);}
  .view .heading > .actions {flex:1 1 100%; gap:6px;}
  .view .heading > .actions > :is(.button,a) {
    flex:1 1 auto; min-width:0; min-height:40px; display:grid; place-items:center;
    padding:6px 9px; text-align:center; white-space:normal;
  }
  .view .panel .toolbar {
    display:grid; grid-template-columns:repeat(6,minmax(0,1fr));
    gap:8px; padding:12px; align-items:stretch;
  }
  .view .panel .toolbar > * {grid-column:span 6; min-width:0;}
  .view .panel .toolbar > :is(input,select) {
    box-sizing:border-box; width:100%; max-width:none; min-height:42px; margin:0;
  }
  .view .panel .toolbar > select {grid-column:span 3; padding:6px;}
  .view .panel .toolbar:has(> select:nth-of-type(3)):not(:has(> select:nth-of-type(4))) > select {
    grid-column:span 2; font-size:14px;
  }
  .view .panel .toolbar > select:only-of-type {grid-column:span 6;}
  .view .data-table.mobile-cards tbody > tr {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px;
    padding:12px; border-bottom:1px solid #dce8f2;
  }
  .view .data-table.mobile-cards tbody tr > td {
    min-width:0; padding:7px 8px; border:0; border-radius:8px;
    background:#f2f7fc; overflow-wrap:anywhere;
  }
  .view .data-table.mobile-cards tbody tr > td:is(:first-child,[data-label="客户"],[data-label="联系方式"],[data-label="录音操作"],[data-label="下一步"]) {
    grid-column:1 / -1;
  }
  .view .data-table.mobile-cards tbody tr > td:first-child {
    padding:3px 0 5px; background:transparent; color:#153e59;
  }
  .view .data-table.mobile-cards tbody tr > td:not(:first-child)::before {
    display:block; margin:0 0 3px; font-size:11px; line-height:1.2;
  }
  .view .data-table.mobile-cards tr:has(> td[data-label="联系方式"]) > td[data-label="负责人"],
  .view .data-table.mobile-cards tr:has(> td[data-label="来源"]) > td[data-label="AI 复盘"] {
    grid-column:1 / -1;
  }
  .view .data-table.mobile-cards tbody tr:has(> td[data-label="联系方式"])
    > td:is([data-label="联系方式"],[data-label="优先级"],[data-label="状态"],[data-label="负责人"])::before {
    display:inline;
    margin:0 7px 0 0;
    white-space:nowrap;
  }
  .view .data-table.mobile-cards td[data-label="联系方式"] > .button {
    display:inline-flex;
    align-items:center;
    margin-inline-start:4px;
    vertical-align:middle;
  }
  .view .data-table.mobile-cards tbody > tr:has(> td[data-label="联系方式"]) {
    align-items:start;
    gap:4px 10px;
    padding:9px 12px;
  }
  .view .data-table.mobile-cards tbody tr:has(> td[data-label="联系方式"]) > td {
    background:transparent;
    padding:2px 0;
    line-height:1.35;
  }
  .view .data-table.mobile-cards tbody tr:has(> td[data-label="联系方式"]) > td:first-child {
    padding-bottom:3px;
  }
  .view .data-table.mobile-cards td[data-label="联系方式"] > .button {
    min-height:36px;
    padding:3px 8px;
  }
  .view .data-table.mobile-cards tbody tr:has(> td[data-label="联系方式"]) > td:not(:first-child) {
    font-size:13px;
    font-weight:400;
  }
  .view .data-table.mobile-cards tbody tr:has(> td[data-label="联系方式"]) > td:not(:first-child)::before,
  .view .data-table.mobile-cards tbody tr:has(> td[data-label="联系方式"]) > td:not(:first-child) :is(small,.badge,.button) {
    font:inherit;
  }
  .view .data-table.mobile-cards tbody tr:has(> td[data-label="联系方式"]) > td[data-label="联系方式"] > .button {
    justify-content:center;
    min-width:56px;
    min-height:28px;
    padding:4px 12px;
    border-radius:6px;
    box-shadow:none;
  }
  .view .data-table.mobile-cards td[data-label="录音操作"] .button {
    width:100%; min-height:40px;
  }
  .view .panel .empty {padding:24px 12px;}
}

:root{font-family:"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:#172540;background:#edf2fa;line-height:1.5;--accent:#2056a2;--dark:#102c59;--muted:#52647e;--line:#dbe4f0;--pale:#e9f2ff}
*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}button{cursor:pointer}button:disabled{opacity:.6;cursor:wait}button:focus-visible,a:focus-visible{outline:2px solid #2a6cc1;outline-offset:3px}
.shell{display:grid;grid-template-columns:236px minmax(0,1fr);min-height:100vh}.sidebar{height:100vh;position:sticky;top:0;background:var(--dark);color:#f1f6ff;display:flex;flex-direction:column;padding:25px 17px;overflow:auto}.brand{display:flex;gap:11px;align-items:center;color:#fff;font-size:17px;font-weight:750;letter-spacing:.04em;margin:3px 2px 39px}.brand:hover{text-decoration:none}.brand-mark{border-radius:11px;background:#f5ca62;color:#112c56;font-size:20px;display:grid;place-items:center;width:42px;height:42px;flex:none}.brand small{display:block;font-size:10px;color:#aebfdb;font-weight:500;letter-spacing:.06em;margin-top:2px}.nav-label{font-size:10px;color:#a5b8d6;letter-spacing:.18em;margin:0 11px 8px}.nav-label:not(:first-child){margin-top:25px}.nav-link{display:flex;gap:12px;align-items:center;padding:10px 11px;border-radius:8px;color:#e3ecfc;font-size:14px;margin-bottom:3px}.nav-link:hover{background:#1e4278;text-decoration:none}.nav-link.active{background:#244a80;color:#fff4cf;box-shadow:inset 3px 0 #f5ca62;font-weight:700}.profile{margin-top:auto;padding:23px 5px 0}.profile-inner{border-top:1px solid #365586;padding-top:16px;display:flex;align-items:center;gap:10px;font-size:13px}.avatar{display:grid;place-items:center;background:#244a80;border-radius:50%;width:33px;height:33px;color:#fff2c6;flex:none}.profile small{display:block;color:#aebfdb}
.topbar{height:60px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 34px;font-size:13px;color:var(--muted)}.topbar strong{color:#233650}.slash{margin:0 10px;color:#7f8ea6}.view{padding:27px 34px 44px;max-width:1600px;margin:auto}.heading{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:21px}.heading h1{margin:0;font-size:29px;letter-spacing:-.035em}.heading p{margin:4px 0 0;color:var(--muted);font-size:13px}.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.button{background:#fff;color:#233650;border:1px solid #d1dced;border-radius:8px;padding:8px 12px;display:inline-flex;align-items:center;gap:5px;font-weight:650;font-size:13px;white-space:nowrap}.button:hover{background:#f2f7fd;text-decoration:none}.button.primary{background:var(--accent);border-color:var(--accent);color:white}.button.primary:hover{background:#1a4789}.button.small{font-size:12px;padding:5px 9px}.button.text{border-color:transparent;background:transparent;color:var(--accent)}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px}.stat{border:1px solid var(--line);background:#fff;border-radius:11px;padding:16px 17px;color:#233650;min-width:0}.stat:hover{border-color:#a3bce4;text-decoration:none}.stat strong{display:block;font-size:29px;letter-spacing:-.04em;margin:5px 0 0;color:#122e5d;overflow-wrap:anywhere}.stat small,.muted{color:var(--muted);font-size:12px}.stat-label{font-size:13px;display:flex;justify-content:space-between;gap:5px;align-items:center}.stat-label svg{color:var(--accent)}
.panel{border:1px solid var(--line);background:#fff;border-radius:11px;margin-bottom:15px;min-width:0;overflow:hidden}.panel-head{padding:14px 17px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;border-bottom:1px solid #edf2f8}.panel-head h2,.panel-head h3{font-size:15px;margin:0}.panel-body{padding:15px 17px}.grid{display:grid;grid-template-columns:1.45fr 1fr;gap:14px}.scroll{overflow:auto}.data-table{width:100%;border-collapse:collapse;text-align:left;font-size:13px}.data-table th{font-weight:650;color:var(--muted);background:#f7f9fd;white-space:nowrap}.data-table th,.data-table td{padding:10px 13px;border-bottom:1px solid #edf2f8;vertical-align:top}.data-table td:first-child,.data-table th:first-child{padding-left:17px}.data-table tr:last-child td{border-bottom:0}.data-table td{overflow-wrap:anywhere}.data-table a{font-weight:650}.empty{padding:32px 17px;text-align:center;color:var(--muted);font-size:13px}.empty strong{display:block;color:#233650;margin-bottom:5px;font-size:15px}.empty .button{margin-top:12px}
.badge{font-size:11px;border-radius:999px;padding:2px 8px;display:inline-block;background:var(--pale);color:#1e508f;white-space:nowrap}.badge.alert{background:#ffede8;color:#9a291e}.badge.neutral{background:#ecf1f7;color:#465b78}.toolbar{display:flex;flex-wrap:wrap;gap:8px;padding:12px 17px;border-bottom:1px solid var(--line)}input,select,textarea{min-width:0;background:#fff;border:1px solid #d1dced;border-radius:7px;color:#172540;padding:8px 9px}input:focus,select:focus,textarea:focus{outline:2px solid #9ebcef;outline-offset:0}.toolbar input[type=search]{min-width:min(260px,100%)}.toolbar input,.toolbar select{font-size:13px}
.stage-row{display:flex;justify-content:space-between;align-items:center;padding:7px 0;gap:12px;font-size:13px;border-bottom:1px solid #edf2f8}.stage-row:last-child{border:0}.stage-row span:first-child{display:flex;align-items:center;gap:7px}.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#b68431}.details{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin:0}.details dt{font-size:12px;color:var(--muted);margin:0 0 3px}.details dd{margin:0;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}.detail-wide{grid-column:span 3}.back{display:inline-flex;color:var(--accent);font-weight:650;font-size:13px;margin-bottom:9px}.tabs{display:flex;gap:8px;overflow:auto;margin:3px 0 10px}.tabs a{border:1px solid var(--line);background:white;padding:7px 10px;border-radius:7px;font-size:12px;white-space:nowrap}
dialog{border:1px solid var(--line);border-radius:14px;width:min(690px,calc(100% - 24px));max-height:90vh;padding:0;color:#172540;background:#fff;box-shadow:0 18px 60px #112c5650}dialog::backdrop{background:#112c5673}.dialog-head,.dialog-foot{padding:14px 19px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);gap:10px}.dialog-head h2{font-size:19px;margin:0}.dialog-foot{border-bottom:0;border-top:1px solid var(--line);justify-content:flex-end}.fields{padding:16px 19px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.field{display:grid;gap:4px;font-size:13px}.field>span{font-weight:620}.field.wide,.form-error{grid-column:1/-1}.field.check{display:flex;align-items:center;padding:7px 0}.field.check input{width:16px;height:16px}.field textarea{min-height:64px;resize:vertical}.form-error{color:#a42b22;font-size:13px;margin:0}.form-error:empty{display:none}.form-note{margin:0;grid-column:1/-1;color:var(--muted);font-size:13px}.import-preview{grid-column:1/-1;border:1px solid var(--line);border-radius:8px;padding:10px;font-size:13px}.import-preview:empty{display:none}#toast{position:fixed;right:20px;bottom:20px;background:#142d58;color:#fff;border-radius:8px;padding:10px 15px;max-width:min(360px,90vw);font-size:13px;z-index:1}#toast:empty{display:none}
@media(max-width:1000px){.shell{grid-template-columns:186px minmax(0,1fr)}.view{padding:21px}.topbar{padding:0 21px}.grid{grid-template-columns:1fr}.data-table th,.data-table td{padding:8px 10px}}
@media(max-width:700px){.shell{display:block}.sidebar{position:static;height:auto;padding:10px 12px}.brand{margin:0 0 7px;font-size:15px}.brand-mark{width:32px;height:32px;font-size:17px}.brand small{display:none}.sidebar nav{display:flex;overflow:auto;gap:3px}.nav-label,.profile{display:none}.nav-link{font-size:12px;white-space:nowrap;padding:7px 8px}.nav-link svg{display:none}.topbar{height:45px;padding:0 12px}.view{padding:15px 12px}.heading{align-items:flex-start;flex-wrap:wrap}.heading h1{font-size:24px}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.stat{padding:11px}.stat strong{font-size:23px}.details{grid-template-columns:repeat(2,minmax(0,1fr))}.detail-wide{grid-column:span 2}.fields{grid-template-columns:1fr}.data-table{min-width:520px}}
.phone-steps{margin:0;padding-inline-start:22px;font-size:14px}.phone-steps li+li{margin-top:8px}#open-native:not(:empty){margin-top:12px}#phone-state{margin-top:0}
@media(max-width:700px){.data-table.mobile-cards{min-width:0;display:block}.mobile-cards thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.mobile-cards tbody,.mobile-cards tr,.mobile-cards td{display:block}.mobile-cards tr{padding:11px 14px;border-bottom:1px solid var(--line)}.mobile-cards td,.mobile-cards td:first-child{padding:3px 0;border:0}.mobile-cards td:first-child{font-size:16px}.mobile-cards td:not(:first-child)::before{content:attr(data-label);color:var(--muted);font-size:11px;margin-right:7px}}

/* Brand surfaces and depth */
:root {
  --navy:#102c59; --blue:#2a61b1; --gold:#f5ca62; --gold-ink:#67490c;
  --shadow:0 2px 6px #16396c07,0 15px 32px -26px #193b7380;
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;
}
body {background:radial-gradient(ellipse at 88% 0,#fff8e6b0,transparent 36%),linear-gradient(150deg,#f0f5fd,#e9eff8);}
.shell {grid-template-columns:244px minmax(0,1fr);min-height:100dvh;}
.sidebar {
  height:100dvh;background:linear-gradient(165deg,#d9f4fc,#a9ddf1);color:#153e59;
  box-shadow:inset -1px 0 #75adc64d,5px 0 28px #152e6015;padding:27px 16px 19px;
}
.brand {color:#163b55;gap:11px;letter-spacing:0;margin:4px 4px 33px;}
.brand-mark {display:block;object-fit:cover;width:44px;height:44px;border-radius:13px;background:#173b74;box-shadow:inset 0 0 0 1px #ffffff38,0 7px 14px #00153866;}
.brand small {color:#345a70;font-size:10px;letter-spacing:.015em;}
.nav-label {color:#345a70;font-size:11px;letter-spacing:.06em;}
.nav-link {color:#153e59;padding:10px 12px;border-radius:11px;border:1px solid transparent;transition:background .16s;}
.nav-link.active {
  color:#103a55;background:#ffffffba;border-color:#ffffffa6;
  box-shadow:inset 3px 0 var(--gold),0 4px 10px #04132c32;
}
.nav-link:hover {background:#ffffff75;}
.nav-link.active svg {color:#825700;}
.profile-inner {border-color:#77b2cd;padding-inline:3px;}
.profile small {color:#345a70;}
.avatar {color:#201c14;background:linear-gradient(165deg,#ffe6a0,#edbb46);box-shadow:inset 0 0 0 1px #fff8ce77;}
.topbar {
  position:sticky;top:0;z-index:2;height:62px;background:#fafdffe0;backdrop-filter:blur(18px) saturate(135%);
  -webkit-backdrop-filter:blur(18px) saturate(135%);border-bottom-color:#dce6f2;box-shadow:0 3px 12px #122e5d08;
}
.top-actions {display:flex;align-items:center;gap:15px;}
.view {padding-top:33px;}
.heading {margin-bottom:24px;gap:18px;}
.heading h1 {color:#102c59;font-size:clamp(28px,3vw,40px);font-weight:760;letter-spacing:-.055em;line-height:1.12;}
.heading p {margin-top:8px;font-size:14px;}
.button {
  border-radius:10px;padding:8px 13px;background:linear-gradient(#fff,#f6f8fc);color:#243959;
  box-shadow:0 2px 4px #18335e0d,inset 0 1px #fff;min-height:35px;
}
.button:hover {background:#eaf2ff;}
.button.primary {background:linear-gradient(155deg,#ffe797,#f3c557 72%,#eab747);color:#352506;border-color:#e5b74e;box-shadow:0 5px 11px #8a671d25,inset 0 1px #fff8c5;}
.button.primary:hover {background:linear-gradient(155deg,#fff0ad,#f4ca64);}
.button.small {min-height:30px;}
.button.text {box-shadow:none;}
.panel,.stat {border:1px solid #dce5f0;box-shadow:var(--shadow),inset 0 1px #fff;border-radius:18px;}
.stat {padding:17px 18px;background:linear-gradient(151deg,#fff 35%,#f4f8ff 100%);}
.stat:first-child {background:linear-gradient(149deg,#fffdf7 35%,#fff2cb 100%);border-color:#efdba7;}
.stat-label svg {width:31px;height:31px;flex:none;padding:7px;border-radius:10px;color:#235396;background:#e8f1ff;box-shadow:inset 0 1px 1px #fff;}
.stat:first-child svg {background:#f8e4a6;color:#715318;}
.stat strong {font-variant-numeric:tabular-nums;font-size:clamp(24px,2.7vw,35px);}
.panel {background:linear-gradient(#fff,#fcfdff);}
.panel-head {padding:16px 19px;}
.panel-head h2,.panel-head h3 {color:#142f59;font-size:16px;}
.panel-body {padding:17px 19px;}
.data-table th {background:#f4f7fc;font-size:12px;}
.data-table tbody tr:hover {background:#f4f8ff;}
.badge.gold {background:#fff0c4;color:var(--gold-ink);}
.dot {background:linear-gradient(#ffe290,#c99230);box-shadow:0 1px 3px #ad7e2455;}
input,select,textarea {accent-color:var(--blue);}
dialog {border-radius:20px;box-shadow:0 22px 72px #0e245b52;}
.dialog-head {background:linear-gradient(120deg,#fff,#eff5ff);}
#toast {box-shadow:0 9px 24px #172f5a42;}
#mobile-nav {display:none;}
#web-call:not(:empty) {margin-top:14px;}
.shortcut-list a {display:flex;align-items:center;gap:13px;padding:13px 18px;border-top:1px solid var(--line);font-size:14px;}
.shortcut-list a span:nth-child(2) {flex:1;}

@media (min-width:701px) and (max-width:1000px) {.shell {grid-template-columns:193px minmax(0,1fr);}}
@media (max-width:700px) {
  .shell {display:block;}
  .sidebar {height:auto;padding:calc(10px + env(safe-area-inset-top)) 15px 10px;}
  .sidebar nav,.profile {display:none;}
  .brand {margin:0;font-size:15px;}
  .brand-mark {width:31px;height:31px;border-radius:9px;}
  .topbar {height:47px;padding:0 14px;position:static;}
  .top-actions {gap:7px;}
  #today {display:none;}
  .view {padding:20px 13px calc(92px + env(safe-area-inset-bottom));}
  .heading {margin-bottom:16px;}
  .heading h1 {font-size:30px;}
  .heading p {font-size:12px;}
  .panel,.stat {border-radius:15px;}
  .stat {padding:10px 12px;}
  .stat small {font-size:11px;}
  .stat-label svg {width:27px;height:27px;padding:5px;}
  .data-table.mobile-cards td {padding-top:6px;}
  .panel-head,.panel-body {padding:13px 14px;}
  .button {min-height:40px;}
  .button.small {min-height:36px;}
  input,select,textarea,.toolbar input,.toolbar select {font-size:16px;}
  #mobile-nav:not(:empty) {
    display:grid;grid-template-columns:repeat(4,1fr);position:fixed;z-index:4;inset:auto 0 0;
    padding:7px 9px calc(7px + env(safe-area-inset-bottom));background:#fbfdfff0;
    backdrop-filter:blur(20px) saturate(140%);-webkit-backdrop-filter:blur(20px) saturate(140%);
    box-shadow:0 -5px 20px #18335e12;border-top:1px solid #d8e3f1;
  }
  #mobile-nav a {display:grid;justify-items:center;gap:3px;padding:5px 3px;font-size:11px;color:#52647e;border-radius:12px;}
  #mobile-nav a[aria-current] {background:#fff2cb;color:#60450a;font-weight:700;}
  #mobile-nav svg {width:19px;height:19px;}
  #toast {bottom:calc(78px + env(safe-area-inset-bottom));z-index:5;}
}
@media (prefers-reduced-motion:reduce) {.nav-link {transition:none;}}

[hidden] {display:none !important;}
.call-player{width:min(100%,620px)}.coaching h3{margin:16px 0 6px;color:#142f59;font-size:15px}.coaching p,.call-transcript{white-space:pre-wrap;overflow-wrap:anywhere}.coaching blockquote{margin:8px 0;padding:12px 14px;background:#fff5d8;border-left:3px solid #e3b749;border-radius:4px 10px 10px 4px;white-space:pre-wrap}.phone-steps li{overflow-wrap:anywhere}

#employee-login, #employee-account { display:grid; gap:14px; max-width:420px; }
#employee-login label, #employee-account label { display:grid; gap:6px; }
#employee-login p:empty, #employee-account p:empty { display:none; }
#employee-phone-summary { font-size: 0.875rem; }

/* Brand backdrop stays behind the opaque content surfaces. */
body { isolation: isolate; }
body::before {
  content: "";
  position: fixed;
  inset: -12px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(rgba(237,242,250,.65), rgba(237,242,250,.46)),
    url("/factory-background.jpg") center bottom / cover no-repeat;
  filter: blur(6px);
}

.brand-mark { object-fit: contain; background: #fff; padding: 3px; }
body .panel, body .stat { background-color: #fff; }

/* Keep the factory visible even when the dashboard cards fill the viewport. */
.view:has(.stats) > .heading {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 164px;
  padding: 24px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #e9f2ff;
}
.view:has(.stats) > .heading::before {
  content: "";
  position: absolute;
  inset: -5px;
  z-index: -1;
  background: linear-gradient(90deg, #f6faff 8%, #f6faffe8 36%, #f6faff38 78%),
    url("/factory-background.jpg") right 76% / cover no-repeat;
  filter: blur(3px);
}
