/* OpsCRM is intentionally self-contained for iframe embedding. */
*,
*::before,
*::after { box-sizing: border-box; }

html { min-width: 320px; background: #0B1120; color-scheme: dark; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #0B1120; color: #E8ECF6; }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.opscrm-app {
  --bg: #0B1120;
  --panel: #131C31;
  --panel-raised: #17223A;
  --panel-soft: #10192B;
  --border: #26324A;
  --border-soft: #202C43;
  --text: #E8ECF6;
  --muted: #929DB3;
  --quiet: #66738D;
  --accent: #818CF8;
  --green: #34D399;
  min-height: 100vh;
  padding: 0 26px 22px;
  color: var(--text);
  background:
    radial-gradient(ellipse at 66% -27%, rgba(76, 91, 164, .12), transparent 48%),
    var(--bg);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  font-size: 13px;
  line-height: 1.45;
  isolation: isolate;
}

.topbar {
  width: min(100%, 1440px);
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(62, 76, 105, .42);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-size: 13px; font-weight: 680; letter-spacing: -.025em; }
.brand-separator { padding: 0 3px; color: #66738D; font-weight: 400; }
.brand-mark { width: 22px; height: 22px; display: flex; align-items: end; justify-content: center; gap: 2px; padding: 4px; border: 1px solid #4C568C; border-radius: 7px; background: linear-gradient(145deg, #252E52, #171D37); }
.brand-mark i { width: 3px; border-radius: 2px 2px 1px 1px; background: var(--accent); box-shadow: 0 0 8px rgba(129, 140, 248, .45); }
.brand-mark i:nth-child(1) { height: 6px; opacity: .7; }
.brand-mark i:nth-child(2) { height: 10px; }
.brand-mark i:nth-child(3) { height: 8px; opacity: .82; }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.demo-badge { display: inline-flex; align-items: center; gap: 7px; color: #A6B1C8; font-size: 11px; letter-spacing: .01em; }
.badge-dot, .online-dot, .live-dot, .footer-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(52, 211, 153, .38); }
.reset-button { min-height: 31px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 10px; border: 1px solid #2C3952; border-radius: 7px; background: #111A2B; color: #B8C2D4; font-size: 11px; cursor: pointer; transition: border-color .16s, background .16s, color .16s; }
.reset-button:hover { border-color: #536185; background: #17223A; color: #F0F2FA; }
.reset-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.app-frame { width: min(100%, 1440px); min-height: 620px; margin: 0 auto; display: grid; grid-template-columns: 154px minmax(0, 1fr); }
.mini-sidebar { display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 31px 13px 15px 0; border-right: 1px solid rgba(62, 76, 105, .42); }
.sidebar-label { padding: 0 11px 8px; color: #66738D; font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nav-item { min-height: 39px; display: flex; align-items: center; gap: 10px; padding: 0 11px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #8995AC; text-align: left; font-size: 12px; cursor: pointer; transition: .16s ease; }
.nav-item svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: rgba(129, 140, 248, .055); color: #CAD0E3; }
.nav-item.is-active { border-color: rgba(129, 140, 248, .2); background: linear-gradient(90deg, rgba(129, 140, 248, .14), rgba(129, 140, 248, .055)); color: #DCE0FF; box-shadow: inset 2px 0 #818CF8; }
.nav-item.is-active svg { color: #9EA7FF; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 14px 11px 0; border-top: 1px solid var(--border-soft); color: #72809A; font-size: 10px; }
.online-dot { width: 5px; height: 5px; }

.workspace { position: relative; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; padding: 30px 0 0 26px; }
.workspace.with-drawer { grid-template-columns: minmax(0, 1fr) 306px; gap: 22px; padding-right: 0; }
.main-column { min-width: 0; display: flex; flex-direction: column; }
.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 21px; }
.eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: #8C98AF; font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.eyebrow-line { width: 13px; height: 1px; background: var(--accent); }
.eyebrow-date { color: #596781; font-weight: 500; }
h1, h2, h3, p { margin: 0; }
.view-heading h1 { color: #F3F5FC; font-size: clamp(23px, 2.8vw, 29px); font-weight: 630; letter-spacing: -.055em; line-height: 1.12; }
.page-subtitle { margin-top: 7px; color: var(--muted); font-size: 11px; }
.heading-date { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding-bottom: 3px; white-space: nowrap; }
.heading-date-label { color: #65728B; font-size: 8px; font-weight: 700; letter-spacing: .17em; }
.heading-date time { color: #A5B0C6; font-size: 10px; font-weight: 650; letter-spacing: .09em; }

.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 28px; }
.kpi-card { min-width: 0; min-height: 102px; padding: 13px 15px 11px; border: 1px solid var(--border); border-radius: 9px; background: linear-gradient(148deg, rgba(24, 36, 61, .88), rgba(19, 28, 49, .98) 64%); box-shadow: 0 8px 18px rgba(1, 5, 13, .12); }
.pipeline-card { border-color: #39436D; background: linear-gradient(138deg, rgba(37, 44, 82, .65), rgba(19, 28, 49, .98) 72%); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kpi-label { overflow: hidden; color: #9AA6BC; font-size: 10px; font-weight: 540; text-overflow: ellipsis; white-space: nowrap; }
.kpi-glyph { width: 19px; height: 19px; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid rgba(129, 140, 248, .2); border-radius: 6px; background: rgba(129, 140, 248, .08); color: #A4ACFF; font-size: 13px; }
.people-glyph { font-size: 16px; }
.kpi-value { overflow: hidden; margin-top: 6px; color: #F3F5FC; font-size: clamp(19px, 2.4vw, 25px); font-weight: 650; letter-spacing: -.045em; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-card .kpi-value { color: #D9DDFF; }
.kpi-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: #78869F; font-size: 9px; white-space: nowrap; }
.kpi-pip { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; }
.indigo-pip { background: var(--accent); box-shadow: 0 0 7px rgba(129, 140, 248, .4); }
.green-pip { background: var(--green); }
.violet-pip { background: #C084FC; }
.kpi-divider { color: #46536D; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading h2 { color: #E8ECF6; font-size: 15px; font-weight: 620; letter-spacing: -.025em; }
.section-heading p { margin-top: 3px; color: #7F8BA3; font-size: 10px; }
.result-count { padding-bottom: 2px; color: #79869E; font-size: 10px; white-space: nowrap; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.search-box { width: min(100%, 285px); height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 9px; border: 1px solid #2A3650; border-radius: 7px; background: #10192A; color: #79869F; transition: border-color .16s, box-shadow .16s; }
.search-box:focus-within { border-color: #6974D1; box-shadow: 0 0 0 2px rgba(129, 140, 248, .1); }
.search-box svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #E8ECF6; font-size: 10px; }
.search-box input::placeholder { color: #71809A; opacity: 1; }
.search-box kbd { display: grid; width: 16px; height: 17px; flex: 0 0 auto; place-items: center; border: 1px solid #33405B; border-radius: 4px; color: #75829A; font: 10px/1 "Segoe UI", sans-serif; }
.filter-pills { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.filter-pill { min-height: 27px; padding: 0 9px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #8995AB; font-size: 9px; cursor: pointer; transition: .14s ease; }
.filter-pill:hover { background: #17223A; color: #C8D0E1; }
.filter-pill.is-active { border-color: #39466A; background: #192440; color: #D7DBFF; }
.list-head { display: grid; grid-template-columns: minmax(160px, 1.3fr) minmax(145px, 1fr) 90px 108px; gap: 10px; padding: 8px 13px; color: #65728B; font-size: 8px; font-weight: 700; letter-spacing: .11em; }
.lead-list { display: flex; flex-direction: column; gap: 6px; }
.lead-row { display: grid; grid-template-columns: minmax(160px, 1.3fr) minmax(145px, 1fr) 90px 108px; align-items: center; gap: 10px; min-height: 67px; padding: 8px 13px; border: 1px solid #253149; border-radius: 8px; background: rgba(19, 28, 49, .88); cursor: pointer; transition: border-color .16s, background .16s, transform .16s; }
.lead-row:hover, .lead-row:focus-within { border-color: #3E4A6B; background: #17223A; }
.lead-row:active { transform: translateY(1px); }
.lead-primary { min-width: 0; display: flex; align-items: center; gap: 10px; }
.lead-avatar { width: 31px; height: 31px; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid rgba(129, 140, 248, .18); border-radius: 9px; background: var(--avatar-bg, #202947); color: var(--avatar-color, #ADB5FF); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.lead-copy { min-width: 0; }
.lead-name { display: block; overflow: hidden; color: #E5EAF4; font-size: 11px; font-weight: 610; text-overflow: ellipsis; white-space: nowrap; }
.lead-service { display: block; overflow: hidden; margin-top: 2px; color: #8794AC; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.lead-next { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.channel-line { overflow: hidden; color: #BAC4D6; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.channel-line span { margin-right: 4px; color: #7786A1; }
.next-line { overflow: hidden; color: #8794AC; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.next-line time { color: #AEB8CB; }
.lead-amount { color: #DDE3EF; font-size: 10px; font-weight: 630; letter-spacing: -.02em; white-space: nowrap; }
.status-select { width: 100%; min-width: 0; height: 28px; padding: 0 21px 0 8px; appearance: none; border: 1px solid #36445F; border-radius: 6px; outline: 0; background-color: #18233A; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='m2 3.5 3 3 3-3' fill='none' stroke='%238D9AB3' stroke-width='1.2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 7px center; color: #BFC8D9; font-size: 9px; cursor: pointer; }
.status-select:focus { border-color: #818CF8; box-shadow: 0 0 0 2px rgba(129, 140, 248, .14); }
.status-select[data-status="Nuevo"] { border-color: #3B5277; color: #AFC9FF; }
.status-select[data-status="Cotizado"] { border-color: #62523A; color: #E9C98E; }
.status-select[data-status="Cerrado"] { border-color: #2E6757; color: #7EE2BB; }
.status-select option { background: #131C31; color: #E8ECF6; }
.row-open-hint { display: none; }
.empty-state { min-height: 145px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px dashed #2B3852; border-radius: 8px; color: #7D8AA3; text-align: center; }
.empty-state:not([hidden]) { display: flex; }
.empty-icon { color: #A5ACFF; font-size: 24px; line-height: 1; }
.empty-state strong { margin-top: 4px; color: #C9D1E0; font-size: 11px; }
.empty-state span:last-child { font-size: 10px; }

.workspace-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 24px; padding: 12px 1px 0; border-top: 1px solid rgba(54, 68, 95, .55); color: #63718A; font-size: 9px; }
.workspace-footer > span:last-child { display: inline-flex; align-items: center; gap: 6px; }
.footer-sep { padding: 0 4px; color: #46536D; }
.footer-dot { width: 5px; height: 5px; }

.metrics-view .section-heading { margin-bottom: 18px; }
.live-label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px; border: 1px solid #275643; border-radius: 5px; background: rgba(24, 71, 57, .25); color: #73D9B1; font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.live-dot { width: 5px; height: 5px; }
.metrics-panels { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 11px; }
.metric-panel { min-width: 0; min-height: 278px; padding: 16px; border: 1px solid var(--border); border-radius: 9px; background: linear-gradient(145deg, rgba(23, 34, 57, .82), rgba(19, 28, 49, .98)); }
.panel-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.panel-kicker { display: block; color: #75829C; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.panel-title-row h3 { margin-top: 4px; color: #E0E6F2; font-size: 12px; font-weight: 600; }
.panel-icon { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #34415D; border-radius: 7px; background: #1B2740; color: #A5ADFF; font-size: 16px; }
.stage-list { display: flex; flex-direction: column; gap: 18px; margin-top: 25px; }
.stage-row { display: grid; grid-template-columns: 76px minmax(40px, 1fr) 37px 70px; align-items: center; gap: 9px; }
.stage-name { color: #A6B2C8; font-size: 10px; }
.stage-track, .channel-track { height: 5px; overflow: hidden; border-radius: 10px; background: #26324A; }
.stage-fill, .channel-fill { height: 100%; display: block; border-radius: inherit; background: var(--bar-color, #818CF8); box-shadow: 0 0 9px color-mix(in srgb, var(--bar-color, #818CF8) 42%, transparent); transition: width .24s ease; }
.stage-count { color: #D4DCE9; font-size: 10px; font-weight: 600; text-align: right; }
.stage-value { overflow: hidden; color: #8D9AB1; font-size: 9px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.panel-footnote { margin-top: 25px; padding-top: 10px; border-top: 1px solid #26324A; color: #65738C; font-size: 9px; }
.channel-list { display: flex; flex-direction: column; gap: 15px; margin-top: 23px; }
.channel-row { display: grid; grid-template-columns: 69px minmax(35px, 1fr) 21px; align-items: center; gap: 8px; }
.channel-name { overflow: hidden; color: #A6B2C8; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.channel-count { color: #D4DCE9; font-size: 9px; text-align: right; }
.channel-fill { background: #6F7CE9; }
.channel-row:nth-child(2) .channel-fill { background: #47B99A; }
.channel-row:nth-child(3) .channel-fill { background: #9D78E8; }
.channel-row:nth-child(4) .channel-fill { background: #C69155; }
.channel-highlight { display: flex; align-items: center; gap: 9px; margin-top: 22px; padding: 9px 10px; border: 1px solid #2C3A53; border-radius: 7px; background: #111B2D; }
.highlight-mark { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 6px; background: rgba(52, 211, 153, .1); color: #56D8A8; font-size: 13px; }
.channel-highlight strong, .channel-highlight small { display: block; }
.channel-highlight strong { color: #C4CDDD; font-size: 9px; font-weight: 600; }
.channel-highlight small { margin-top: 1px; color: #74819A; font-size: 8px; }
.metrics-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 1px solid #293650; border-radius: 7px; background: rgba(17, 26, 43, .7); color: #8B98AF; font-size: 9px; }
.note-mark { width: 14px; height: 14px; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid #6673C6; border-radius: 50%; color: #AAB2FF; font: 600 9px/1 Georgia, serif; }

.detail-drawer { min-width: 0; align-self: start; padding: 15px; border: 1px solid #303C59; border-radius: 10px; background: linear-gradient(155deg, #18243C, #121B2E 76%); box-shadow: 0 14px 36px rgba(1, 5, 13, .24); animation: drawer-in .2s ease both; }
@keyframes drawer-in { from { opacity: .4; transform: translateX(7px); } to { opacity: 1; transform: translateX(0); } }
.drawer-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.icon-button { width: 25px; height: 25px; display: grid; place-items: center; padding: 0; border: 1px solid #34415D; border-radius: 6px; background: #1B2740; color: #9BA8BE; font-size: 18px; line-height: 1; cursor: pointer; }
.icon-button:hover { border-color: #59678A; color: #E8ECF6; }
.drawer-grab { display: none; }
.drawer-identity { display: flex; align-items: center; gap: 11px; margin-top: 17px; }
.avatar { width: 38px; height: 38px; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid rgba(129, 140, 248, .25); border-radius: 11px; background: linear-gradient(145deg, #333D6D, #242D50); color: #C4C9FF; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.identity-copy { min-width: 0; }
.identity-copy h2 { overflow: hidden; color: #EFF2FA; font-size: 15px; font-weight: 640; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.identity-copy p { overflow: hidden; margin-top: 3px; color: #8996AD; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-status { margin-top: 12px; }
.status-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px; border: 1px solid var(--status-border, #3B5277); border-radius: 5px; background: var(--status-bg, rgba(72, 107, 161, .16)); color: var(--status-color, #AFC9FF); font-size: 9px; font-weight: 600; }
.status-tag::before { width: 5px; height: 5px; content: ""; border-radius: 50%; background: currentColor; }
.detail-value-block { margin-top: 16px; padding: 12px 0 13px; border-top: 1px solid #2B3851; border-bottom: 1px solid #2B3851; }
.detail-value-block span, .detail-facts > div > span { display: block; color: #75829A; font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.detail-value-block strong { display: block; margin-top: 4px; color: #DDE2FF; font-size: 22px; font-weight: 650; letter-spacing: -.04em; }
.next-action-card { display: flex; align-items: flex-start; gap: 9px; margin-top: 13px; padding: 10px; border: 1px solid #34415C; border-radius: 7px; background: rgba(30, 42, 68, .7); }
.next-action-icon { width: 23px; height: 23px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 6px; background: rgba(129, 140, 248, .12); color: #AAB1FF; font-size: 13px; }
.next-action-card > div { min-width: 0; }
.action-label { display: block; color: #8793AB; font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.next-action-card strong { display: block; margin-top: 3px; color: #E1E6F0; font-size: 10px; font-weight: 570; }
.next-action-card time { display: block; margin-top: 3px; color: #A6B1C5; font-size: 9px; }
.detail-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.detail-facts > div { min-width: 0; }
.detail-facts strong { display: block; overflow: hidden; margin-top: 4px; color: #C5CEDD; font-size: 9px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.timeline-section { margin-top: 18px; }
.timeline-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.timeline-heading h3 { color: #DDE3EF; font-size: 11px; font-weight: 600; }
.timeline-count { min-width: 18px; padding: 1px 5px; border: 1px solid #34415A; border-radius: 5px; color: #8D9AB1; font-size: 8px; text-align: center; }
.timeline { position: relative; display: flex; flex-direction: column; gap: 14px; margin: 14px 0 0; padding: 0; list-style: none; }
.timeline::before { position: absolute; top: 4px; bottom: 6px; left: 4px; width: 1px; content: ""; background: #35425D; }
.timeline-item { position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 8px; }
.timeline-dot { z-index: 1; width: 9px; height: 9px; margin-top: 3px; border: 2px solid #18243C; border-radius: 50%; background: #818CF8; box-shadow: 0 0 0 1px #6873D4; }
.timeline-item:first-child .timeline-dot { background: #34D399; box-shadow: 0 0 0 1px #34D399; }
.timeline-copy { min-width: 0; }
.timeline-copy p { color: #AEB9CC; font-size: 9px; line-height: 1.45; }
.timeline-copy time { display: block; margin-top: 3px; color: #707E97; font-size: 8px; }
.drawer-footer { display: flex; align-items: center; gap: 6px; margin-top: 19px; padding-top: 10px; border-top: 1px solid #2B3851; color: #66748D; font-size: 8px; }
.drawer-lock { color: #7F8CF1; font-size: 10px; }
.drawer-backdrop { display: none; }

.toast { position: fixed; z-index: 20; right: 24px; bottom: 20px; display: flex; align-items: center; gap: 9px; max-width: calc(100vw - 28px); min-height: 42px; padding: 6px 9px 6px 11px; border: 1px solid #354760; border-radius: 8px; background: #19253B; box-shadow: 0 12px 34px rgba(0, 0, 0, .38); color: #E5EBF5; animation: toast-in .18s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.toast-check { width: 19px; height: 19px; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid rgba(52, 211, 153, .35); border-radius: 50%; background: rgba(52, 211, 153, .1); color: #68DDB3; font-size: 11px; }
.toast-message { overflow: hidden; color: #C8D2E2; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.toast button { border: 0; background: transparent; color: #AEB5FF; font-size: 10px; font-weight: 650; cursor: pointer; }
.toast button:hover { color: #D9DCFF; }
.toast .toast-dismiss { width: 22px; height: 23px; padding: 0; color: #8491A7; font-size: 16px; font-weight: 400; }

.opscrm-app :focus-visible { outline: 2px solid #A4ABFF; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 1080px) and (min-width: 721px) {
  .workspace.with-drawer { display: block; }
  .detail-drawer { position: fixed; z-index: 12; top: 64px; right: 0; bottom: 0; width: min(360px, 43vw); overflow: auto; border-radius: 10px 0 0 10px; }
  .drawer-backdrop:not([hidden]) { position: fixed; z-index: 11; inset: 64px 0 0; display: block; border: 0; background: rgba(3, 7, 15, .55); }
}

@media (max-width: 900px) {
  .opscrm-app { padding-right: 17px; padding-left: 17px; }
  .app-frame { grid-template-columns: 126px minmax(0, 1fr); }
  .mini-sidebar { padding-right: 10px; }
  .workspace { padding-left: 18px; }
  .workspace.with-drawer { grid-template-columns: minmax(0, 1fr) 270px; gap: 14px; }
  .list-head, .lead-row { grid-template-columns: minmax(145px, 1.25fr) minmax(125px, 1fr) 82px 99px; gap: 7px; }
  .lead-row { padding-right: 9px; padding-left: 9px; }
  .lead-primary { gap: 7px; }
  .lead-avatar { width: 27px; height: 27px; }
  .status-select { padding-left: 6px; font-size: 8px; }
  .kpi-card { padding-right: 11px; padding-left: 11px; }
  .metrics-panels { grid-template-columns: 1fr; }
  .metric-panel { min-height: auto; }
}

@media (max-width: 720px) {
  .opscrm-app { padding: 0 14px 17px; }
  .topbar { min-height: 57px; }
  .topbar-actions { gap: 9px; }
  .demo-badge { font-size: 9px; }
  .reset-button { min-height: 29px; padding: 0 7px; font-size: 10px; }
  .app-frame { min-height: calc(100vh - 74px); grid-template-columns: minmax(0, 1fr); }
  .mini-sidebar { flex-direction: row; align-items: center; gap: 5px; padding: 10px 0 8px; border-right: 0; border-bottom: 1px solid rgba(62, 76, 105, .42); }
  .sidebar-label { padding: 0 7px 0 1px; }
  .nav-item { min-height: 31px; gap: 6px; padding: 0 8px; font-size: 10px; }
  .nav-item svg { width: 14px; height: 14px; }
  .nav-item.is-active { box-shadow: inset 0 -2px #818CF8; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: 0; font-size: 9px; }
  .workspace, .workspace.with-drawer { display: block; padding: 20px 0 0; }
  .view-heading { margin-bottom: 16px; }
  .kpi-grid { gap: 6px; margin-bottom: 23px; }
  .kpi-card { min-height: 88px; padding: 10px 9px 9px; border-radius: 7px; }
  .kpi-label { font-size: 9px; }
  .kpi-glyph { width: 16px; height: 16px; font-size: 11px; }
  .kpi-value { margin-top: 8px; font-size: clamp(16px, 5vw, 21px); }
  .kpi-foot { gap: 4px; margin-top: 6px; font-size: 8px; }
  .toolbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .search-box { width: 100%; }
  .filter-pills { justify-content: flex-start; }
  .list-head { display: none; }
  .lead-list { gap: 7px; }
  .lead-row { grid-template-columns: minmax(0, 1fr) 94px; gap: 8px 10px; min-height: 0; padding: 10px; border-radius: 8px; }
  .lead-primary { grid-column: 1; grid-row: 1; }
  .lead-next { grid-column: 1; grid-row: 2; padding-left: 37px; }
  .lead-amount { grid-column: 2; grid-row: 1; align-self: start; padding-top: 4px; text-align: right; }
  .lead-status { grid-column: 2; grid-row: 2; align-self: end; }
  .lead-name { font-size: 10px; }
  .lead-service { font-size: 9px; }
  .channel-line, .next-line { font-size: 8px; }
  .status-select { height: 27px; font-size: 9px; }
  .workspace-footer { margin-top: 19px; }
  .detail-drawer { position: fixed; z-index: 12; right: 0; bottom: 0; left: 0; max-height: min(82vh, 680px); overflow: auto; padding: 12px 17px max(18px, env(safe-area-inset-bottom)); border-radius: 17px 17px 0 0; border-bottom: 0; background: linear-gradient(155deg, #1A2741, #111A2C 78%); box-shadow: 0 -16px 48px rgba(1, 5, 13, .48); animation: sheet-in .22s ease both; }
  @keyframes sheet-in { from { opacity: .5; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
  .drawer-grab { width: 34px; height: 3px; display: block; margin: 0 auto 12px; border-radius: 3px; background: #586783; }
  .drawer-backdrop:not([hidden]) { position: fixed; z-index: 11; inset: 0; display: block; border: 0; background: rgba(3, 7, 15, .66); }
  .toast { right: 10px; bottom: 10px; }
  .metrics-panels { grid-template-columns: 1fr; }
  .metric-panel { padding: 13px; }
}

@media (max-width: 390px) {
  .opscrm-app { padding-right: 10px; padding-left: 10px; font-size: 12px; }
  .brand { gap: 7px; font-size: 11px; }
  .brand-mark { width: 20px; height: 20px; }
  .topbar-actions { gap: 6px; }
  .demo-badge { gap: 5px; font-size: 8px; }
  .reset-button { gap: 4px; padding: 0 6px; font-size: 9px; }
  .reset-button svg { width: 12px; height: 12px; }
  .app-frame { min-height: calc(100vh - 68px); }
  .sidebar-label { font-size: 8px; }
  .nav-item { padding: 0 6px; font-size: 9px; }
  .view-heading { align-items: flex-start; }
  .view-heading h1 { font-size: 22px; }
  .page-subtitle { max-width: 225px; font-size: 9px; }
  .heading-date time { font-size: 8px; }
  .eyebrow { font-size: 8px; }
  .kpi-card { padding-right: 7px; padding-left: 7px; }
  .kpi-label { font-size: 8px; }
  .kpi-foot { font-size: 7px; }
  .kpi-value { font-size: clamp(15px, 5vw, 18px); }
  .section-heading h2 { font-size: 14px; }
  .filter-pill { min-height: 25px; padding: 0 7px; font-size: 8px; }
  .lead-row { grid-template-columns: minmax(0, 1fr) 83px; gap: 7px; padding: 9px 8px; }
  .lead-avatar { width: 25px; height: 25px; }
  .lead-next { padding-left: 32px; }
  .lead-amount { font-size: 9px; }
  .status-select { padding-right: 16px; background-position: right 4px center; font-size: 8px; }
  .workspace-footer { font-size: 8px; }
  .stage-row { grid-template-columns: 64px minmax(30px, 1fr) 23px 61px; gap: 6px; }
  .channel-row { grid-template-columns: 60px minmax(25px, 1fr) 18px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.topbar-actions { min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.interaction-hint { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid rgba(129, 140, 248, .24); border-radius: 999px; background: rgba(129, 140, 248, .08); color: #C4CAFF; font-size: 9px; font-weight: 600; white-space: nowrap; }
.interaction-hint span { font-size: 10px; }
.reset-button { transition: border-color .16s, background .16s, color .16s, box-shadow .16s, transform .16s; }
.reset-button:hover { transform: translateY(-2px); border-color: #6574A0; box-shadow: 0 5px 12px rgba(1, 5, 13, .25); }
.reset-button:active { transform: translateY(0); box-shadow: 0 0 0 3px rgba(129, 140, 248, .2); }
.nav-item:hover { transform: translateY(-1px); border-color: rgba(129, 140, 248, .24); background: rgba(129, 140, 248, .09); }
.nav-item:active { transform: translateY(0); box-shadow: 0 0 0 3px rgba(129, 140, 248, .16); }
.nav-item.is-active { border-color: rgba(129, 140, 248, .38); box-shadow: inset 2px 0 #818CF8, 0 0 0 1px rgba(129, 140, 248, .12); }
.kpi-value.value-flash { animation: kpi-flash 430ms ease-out; }
@keyframes kpi-flash { 0% { filter: brightness(1.65); transform: scale(1.045); text-shadow: 0 0 15px rgba(164, 172, 255, .5); } 45% { filter: brightness(1.28); } 100% { filter: brightness(1); transform: scale(1); text-shadow: none; } }
.filter-pill { border-color: #2E3A54; background: #10192A; transition: border-color .14s, background .14s, box-shadow .14s, color .14s, transform .14s; }
.filter-pill:hover { transform: translateY(-2px); border-color: #6574A0; background: #17223A; color: #E0E5F1; box-shadow: 0 4px 10px rgba(1, 5, 13, .2); }
.filter-pill:active { transform: translateY(0); box-shadow: 0 0 0 3px rgba(129, 140, 248, .18); }
.filter-pill.is-active { border-color: #5868A4; box-shadow: 0 0 0 2px rgba(129, 140, 248, .17); }
.lead-row { transition: border-color .16s, background .16s, box-shadow .16s, transform .16s; }
.lead-row:hover, .lead-row:focus-within { transform: translateY(-2px); border-color: #6272A1; box-shadow: 0 6px 14px rgba(1, 5, 13, .25), 0 0 0 2px rgba(129, 140, 248, .1); }
.lead-row:active { transform: translateY(0); box-shadow: 0 0 0 3px rgba(129, 140, 248, .2); }
.row-open-hint { width: 19px; height: 19px; display: grid; flex: 0 0 auto; place-items: center; margin-left: auto; border: 1px solid #354363; border-radius: 50%; background: #18233A; color: #8492B4; font-size: 17px; line-height: 1; transition: border-color .16s, background .16s, color .16s, transform .16s; }
.lead-row:hover .row-open-hint, .lead-row:focus-within .row-open-hint { transform: translateX(2px); border-color: #7B87CE; background: rgba(129, 140, 248, .14); color: #D5D9FF; }
.status-select { transition: border-color .14s, box-shadow .14s, background-color .14s; }
.status-select:hover { border-color: #7582B5; }
.status-select:focus { border-color: #A4ABFF; box-shadow: 0 0 0 3px rgba(129, 140, 248, .22); }
.status-select:active { box-shadow: 0 0 0 3px rgba(129, 140, 248, .25); }
.icon-button { transition: border-color .14s, color .14s, box-shadow .14s, transform .14s; }
.icon-button:hover { transform: translateY(-1px); border-color: #7181AB; box-shadow: 0 0 0 2px rgba(129, 140, 248, .12); }
.icon-button:active { transform: translateY(0); box-shadow: 0 0 0 3px rgba(129, 140, 248, .2); }
.toast button:hover { text-decoration: underline; text-underline-offset: 3px; }
.toast button:active { color: #FFFFFF; text-shadow: 0 0 9px rgba(174, 181, 255, .55); }

@media (max-width: 720px) {
  .topbar-actions { gap: 7px; }
  .interaction-hint { padding: 3px 7px; font-size: 8px; }
  .nav-item.is-active { box-shadow: inset 0 -2px #818CF8, 0 0 0 1px rgba(129, 140, 248, .12); }
}

@media (max-width: 390px) {
  .topbar-actions { gap: 6px; }
  .interaction-hint { padding: 3px 6px; font-size: 7px; }
}
