@charset "UTF-8";

:root {
    color-scheme: light;
    --page: #ffffff;
    --panel: #ffffff;
    --section: #f8fafb;
    --line: #dfe5ea;
    --input-line: #c9d1d8;
    --text: #333333;
    --text-soft: #414b56;
    --muted: #6f7c87;
    --link: #2067b0;
    --control-bg: #e1e6e7;
    --control-bg-active: #ced3d4;
    --control-border: #bec3c4;
    --control-text: #656767;
    --green: #00b263;
    --red: #d93025;
    --blue: #2fc6f6;
    --shadow-menu: 0 10px 28px rgba(0, 0, 0, .18);
    --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--text); font: 14px/1.45 var(--font); }
.app-shell { min-height: 100vh; padding: 14px 24px 36px; }
.tabs-row { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; }
.app-tabs { display: flex; flex: 1 1 auto; gap: 8px; min-width: 0; }
.tab { min-height: 34px; border: 0; border-radius: 8px; padding: 0 18px; background: var(--control-bg-active); color: #2c2d2e; font: inherit; cursor: pointer; }
.tabs-status { color: var(--muted); white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; border: 1px solid transparent; border-radius: 8px; padding: 0 15px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn-black { background: #2a2f33; border-color: #2a2f33; color: #fff; }
.btn-gray { background: var(--control-bg); color: var(--control-text); }
.btn-gray:hover { background: var(--control-bg-active); color: #2c2d2e; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 0 0 16px; padding: 0; background: transparent; border: 0; border-radius: 0; }
.filter-field, .settings-body label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.input { min-height: 36px; border: 1px solid var(--input-line); border-radius: 8px; padding: 0 11px; background: #fff; color: var(--text); font: inherit; min-width: 180px; }
.settings-head h2 { margin: 0 0 12px; font-size: 22px; font-weight: 500; line-height: 1.2; }
.sales-feed { display: flex; flex-direction: column; min-height: 0; }
.sales-report { display: grid; gap: 10px; overflow: visible; min-width: 0; min-height: auto; }
.employee-card { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 1px 0 rgba(31, 38, 46, .04); padding: 14px; }
.retail-card { padding: 12px 14px; }
.employee-card-summary { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(420px, 1.4fr); gap: 16px; align-items: center; }
.retail-card-summary { grid-template-columns: minmax(220px, .55fr) minmax(680px, 1.7fr); align-items: start; gap: 12px; }
.sales-card-summary { align-items: center; }
.employee-card-head { display: grid; gap: 0; align-items: center; margin-bottom: 0; }
.sales-title { display: block; align-self: center; }
.employee-card h3 { margin: 0; color: #515c6b; font-size: 15px; font-weight: 500; line-height: 1.25; }
.employee-card p { margin: 3px 0 0; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.25; }
.employee-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.retail-card-metrics { display: grid; grid-template-columns: 1fr; gap: 7px; }
.employee-metrics.retail-card-metrics { grid-template-columns: 1fr; }
.retail-card-metric-row { display: grid; column-gap: 12px; row-gap: 7px; }
.retail-card-metric-row.is-leads { grid-template-columns: repeat(4, minmax(92px, 1fr)); }
.retail-card-metric-row.is-sales { grid-template-columns: repeat(6, minmax(92px, 1fr)); }
.retail-card-metric-row.is-deals { grid-template-columns: repeat(5, minmax(92px, 1fr)); }
.retail-card-metric-row.is-calls { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
.funnel-line { display: grid; grid-template-columns: minmax(150px, .42fr) minmax(520px, 1.58fr); gap: 12px; align-items: start; padding: 0 0 9px; border-bottom: 1px solid var(--line); }
.funnel-line:last-child { padding-bottom: 0; border-bottom: 0; }
.funnel-name { min-width: 0; color: #515c6b; font-size: 14px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.employee-metric { min-width: 0; border: 0; border-radius: 0; background: transparent; padding: 0; text-align: left; font-family: inherit; cursor: pointer; }
.employee-metric:hover { box-shadow: none; }
.employee-metric:hover b { text-decoration: underline; }
.employee-metric span { display: block; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.25; margin-bottom: 3px; letter-spacing: 0; }
.employee-metric b { display: block; color: var(--link); font-size: 15px; font-weight: 400; line-height: 1.25; overflow-wrap: anywhere; word-break: break-word; letter-spacing: 0; }
.employee-metric em { display: block; margin-top: 2px; color: var(--muted); font-style: normal; font-size: 12px; line-height: 1.25; }
.funnels { display: grid; gap: 10px; }
.settings-panel { position: fixed; inset: 0 0 0 auto; z-index: 20; width: min(760px, 100%); background: #fff; border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(0,0,0,.15); padding: 18px; overflow: auto; }
.settings-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.settings-body { display: grid; gap: 22px; }
.settings-body section { display: grid; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.settings-body h3 { margin: 0; font-size: 16px; font-weight: 500; }
.settings-row { display: flex; gap: 10px; align-items: center; }
.settings-dropdown { width: 170px; }
.settings-multi-dropdown { width: min(100%, 420px); }
.stage-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--section); }
.stage-card h4 { margin: 0; font-size: 14px; }
.settings-actions { position: sticky; bottom: 0; padding-top: 12px; background: #fff; }
.detail-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.detail-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.detail-table th, .detail-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.detail-table th { position: sticky; top: 0; background: var(--section); font-weight: 500; }
.install-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--section); }
.install-box { width: min(520px, 100%); padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.install-box h1 { margin: 0 0 8px; font-size: 26px; font-weight: 500; }
.install-message, .status { color: var(--muted); }
.progress { height: 8px; overflow: hidden; border-radius: 8px; background: var(--control-bg); margin: 18px 0 12px; }
.progress span { display: block; width: 8%; height: 100%; background: var(--green); transition: width .35s ease; }
.access-closed { padding: 18px; background: #fff3f3; border: 1px solid #ffd0d0; border-radius: 8px; color: var(--red); }
.filter-dropdown { position: relative; min-width: 0; }
.select-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 5.5px; width: 100%; min-height: 34px; border: 1px solid transparent; border-radius: 8px; background: var(--control-bg); color: var(--control-text); padding: 0 15px; font: inherit; font-size: 14px; font-weight: 400; line-height: 1; cursor: pointer; }
.filter-dropdown.is-open .select-btn, .select-btn:hover { border-color: var(--control-border); background: var(--control-bg-active); color: var(--control-text-active); }
.select-btn span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arrow { display: inline-flex; align-items: center; justify-content: center; width: 9px; height: 5px; overflow: hidden; flex: 0 0 auto; font-size: 0; line-height: 1; transform: translateY(1.5px); }
.arrow::before { content: ""; display: block; width: 9px; height: 5px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg width='9' height='5' viewBox='0 0 9 5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3.5 3L8 1' fill='none' stroke='black' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg width='9' height='5' viewBox='0 0 9 5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3.5 3L8 1' fill='none' stroke='black' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.dropdown-demo { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: max-content; min-width: 220px; max-width: min(360px, calc(100vw - 38px)); max-height: 360px; overflow: auto; padding: 12px 0; border-radius: 18px; background: #fff; box-shadow: var(--shadow-menu); }
.wide-dropdown { min-width: 320px; max-width: min(460px, calc(100vw - 38px)); }
.dropdown-search { width: calc(100% - 38px); min-height: 34px; border: 1px solid var(--input-line); border-radius: 8px; margin: 0 19px 8px; padding: 0 10px; color: #686868; font: inherit; }
.dropdown-search:focus { outline: none; border-color: var(--link); }
.dropdown-actions { display: flex; justify-content: space-between; gap: 8px; margin: 0 19px 4px; }
.dropdown-actions button { border: 0; background: transparent; color: var(--link); cursor: pointer; font: inherit; font-size: 13px; padding: 4px 0; }
.dropdown-item { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-width: 220px; min-height: 44px; padding: 0 19px; border: 0; background: transparent; color: #686868; font: inherit; font-size: 15px; font-weight: 400; line-height: 1.25; white-space: nowrap; cursor: pointer; text-align: left; }
.dropdown-item.checkbox-item { display: flex; }
.check { width: 15px; height: 15px; margin: 0; accent-color: #2067b0; flex: 0 0 auto; }
.dropdown-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dropdown-item:hover, .dropdown-item.selected { background: #f7f7f7; }
.dropdown-item[hidden] { display: none !important; }
.dropdown-empty { display: block; color: var(--muted); padding: 10px 19px; }
.topbar-filters { display: flex; flex: 1 1 auto; align-items: center; gap: 16px; min-width: 0; }
.employee-date-filter { display: grid; grid-template-columns: max-content max-content; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 400; }
.sales-employee-filter { display: grid; grid-template-columns: max-content 260px; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 400; }
.date-preset-control { display: grid; grid-template-columns: 170px; gap: 8px; align-items: center; }
.date-preset-control.is-date-range { grid-template-columns: 170px minmax(360px, max-content); }
.period-range { display: grid; grid-template-columns: repeat(2, 176px); gap: 8px; }
.b24-date-control { position: relative; width: 100%; height: 34px; }
.b24-date-input { width: 100%; height: 34px; border: 1px solid var(--input-line); border-radius: 8px; outline: none; padding: 0 12px 0 35px; background: #fff; color: #404a54; font: 400 14px/34px var(--font); transition: border-color .12s ease; }
.b24-date-input:focus { border-color: #0077ff; box-shadow: none; }
.b24-calendar-trigger { position: absolute; z-index: 2; left: 9px; top: 50%; width: 18px; height: 18px; border: 0; padding: 0; background: transparent; color: #a4afb9; transform: translateY(-50%); cursor: pointer; }
.b24-calendar-trigger::before { content: ""; display: block; width: 16px; height: 16px; border: 1.35px solid currentColor; border-radius: 4px; }
.b24-calendar-trigger::after { content: ""; position: absolute; left: 3px; right: 3px; top: 5px; border-top: 1.35px solid currentColor; }
.b24-date-control.is-open { z-index: 350; }
.b24-date-control.is-open .b24-date-input { border-color: #0077ff; }
.b24-calendar-popover { position: absolute; z-index: 300; top: 42px; left: 0; width: 272px; min-height: 304px; padding: 14px 10px 10px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-menu); color: #333; font-weight: 400; user-select: none; }
.b24-calendar-head { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; height: 30px; margin-bottom: 6px; }
.b24-calendar-title { display: flex; align-items: center; justify-content: center; gap: 4px; color: #323840; font-size: 15px; font-weight: 500; text-align: center; }
.b24-nav-button, .b24-day-button { border: 0; padding: 0; background: transparent; font: inherit; cursor: pointer; }
.b24-nav-button { display: grid; place-items: center; width: 28px; height: 28px; color: #a7adb5; }
.b24-nav-button:hover { color: #505c6a; }
.b24-weekdays, .b24-days-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.b24-weekdays { margin-bottom: 2px; }
.b24-weekdays span { display: grid; place-items: center; height: 24px; color: #b2bbc4; font-size: 12px; font-weight: 400; }
.b24-day-button { justify-self: center; width: 36px; height: 36px; border-radius: 50%; color: #47515b; font-size: 14px; font-weight: 400; line-height: 36px; text-align: center; }
.b24-day-button:hover { background: #d5f5fe; }
.b24-day-button.is-muted { color: #c8cfd6; }
.b24-day-button.is-weekend { color: #d06a76; }
.b24-day-button.is-muted.is-weekend { color: #d8b2b8; }
.b24-day-button.is-today { color: #00c9fb; }
.b24-day-button.is-selected, .b24-day-button.is-selected:hover { color: #fff; background: #00c9fb; }
.employee-detail-modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; background: rgba(34,39,44,.34); }
.employee-detail-modal[hidden] { display: none !important; }
.employee-detail { width: min(1100px, calc(100vw - 64px)); max-height: min(760px, calc(100vh - 64px)); border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 20px 56px rgba(31, 38, 46, .22); overflow: hidden; }
.employee-detail-head { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 12px 0 16px; background: #f6f8fa; border-bottom: 1px solid var(--line); }
.employee-detail-head h3 { margin: 0; color: #525d6b; font-size: 14px; font-weight: 500; }
.employee-detail-body { max-height: calc(min(760px, calc(100vh - 64px)) - 43px); overflow: auto; padding: 12px; }
.employee-detail-list { display: grid; gap: 8px; }
.employee-detail-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; border: 1px solid var(--line); border-radius: 7px; padding: 10px; }
.employee-detail-row span { display: block; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.25; margin-bottom: 3px; }
.employee-detail-row b { display: block; min-width: 0; color: #515c6b; font-size: 15px; font-weight: 400; line-height: 1.25; overflow-wrap: anywhere; }
.employee-detail-wide { grid-column: span 2; }
.crm-link { color: var(--link); text-decoration: none; }
.crm-link:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; min-height: 24px; border-radius: 12px; padding: 0 10px; background: #eef4f8; color: #53616f; font-size: 13px; font-weight: 400; }
.status-pill.success { background: #e7f9ef; color: #00874b; }
.status-pill.danger { background: #fff0f0; color: #c5221f; }
.close-icon-button { position: relative; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.close-icon-button:hover { background: var(--control-bg); }
.close-icon-button::before, .close-icon-button::after { content: ""; position: absolute; left: 8px; right: 8px; top: 13px; border-top: 1.5px solid #6f7c87; }
.close-icon-button::before { transform: rotate(45deg); }
.close-icon-button::after { transform: rotate(-45deg); }
@media (max-width: 900px) {
    .app-shell { padding: 12px; }
    .tabs-row { flex-wrap: wrap; }
    .topbar-filters { flex: 1 1 100%; flex-wrap: wrap; }
    .employee-date-filter, .sales-employee-filter { grid-template-columns: 1fr; width: 100%; }
    .date-preset-control { grid-template-columns: 1fr; }
    .period-range { grid-template-columns: 1fr; }
    .employee-card-summary, .retail-card-summary { grid-template-columns: 1fr; }
    .retail-card-metric-row.is-leads, .retail-card-metric-row.is-sales, .retail-card-metric-row.is-deals, .retail-card-metric-row.is-calls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .funnel-line { grid-template-columns: 1fr; }
}
