:root {
    --black: #151515;
    --ink: #242424;
    --muted: #707070;
    --line: #e9e5dc;
    --paper: #fffaf0;
    --white: #ffffff;
    --yellow: #ffc928;
    --orange: #f28a16;
    --green: #24a065;
    --red: #d94a3a;
    --shadow: 0 14px 40px rgba(0, 0, 0, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f7f5ef;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

.attendance-main {
    width: 100%;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.attendance-page {
    width: min(860px, 100%);
}

.attendance-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 24px;
    display: grid;
    gap: 18px;
}

.attendance-brand {
    color: var(--ink);
}

.attendance-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.attendance-step {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    display: grid;
    gap: 5px;
    background: #fffdf8;
}

.attendance-step strong,
.attendance-step span,
.attendance-step small {
    display: block;
}

.attendance-step.ok,
.attendance-step.captured {
    border-color: #8bd7b1;
    background: #eefaf3;
}

.attendance-step.failed,
.attendance-step.refused {
    border-color: #f2a59d;
    background: #fff0ed;
}

.attendance-step.skipped {
    border-color: #f0d78d;
    background: #fff8df;
}

.attendance-camera {
    position: relative;
}

.attendance-camera video,
.attendance-camera canvas {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--black);
}

.face-guide {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    color: var(--white);
    text-align: center;
}

.face-guide-box {
    width: min(230px, 44vw);
    aspect-ratio: 1;
    border: 3px solid var(--yellow);
    border-radius: 8px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, .22), 0 0 24px rgba(255, 201, 40, .45);
}

.face-guide span {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, .7);
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 700;
}

.attendance-start {
    min-height: 52px;
}

.presence-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, .45);
}

.presence-popup-card {
    width: min(420px, 100%);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
    padding: 24px;
}

.presence-popup-card h2 {
    margin: 0 0 10px;
}

.presence-popup-card p {
    margin: 0 0 18px;
    font-size: 18px;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 260px;
    background: var(--black);
    color: var(--white);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 118px;
    height: auto;
    display: block;
    flex: 0 0 auto;
    background: var(--white);
    border-radius: 6px;
    padding: 4px;
}

.login-logo {
    width: 150px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: var(--yellow);
    color: var(--black);
    border-radius: 8px;
    font-weight: 900;
}

.brand strong,
.brand small {
    display: block;
}

.brand small,
.sidebar-user small,
.muted {
    color: var(--muted);
}

.sidebar nav,
.sidebar-nav {
    display: grid;
    gap: 10px;
}

.nav-section,
.nav-group {
    display: grid;
    gap: 5px;
}

.nav-section > span,
.nav-group summary {
    color: var(--yellow);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: 10px 12px;
    border: 1px solid rgba(255, 201, 40, .32);
    border-radius: 8px;
    cursor: pointer;
    list-style: none;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.nav-group summary::after {
    content: "+";
    float: right;
}

.nav-group[open] summary::after {
    content: "-";
}

.sidebar nav a {
    display: block;
    margin-left: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #f6f6f6;
    font-size: 13px;
    line-height: 1.25;
}

.sidebar nav a.active,
.sidebar nav a:hover {
    background: var(--yellow);
    color: var(--black);
}

.sidebar-user {
    margin-top: auto;
    display: grid;
    gap: 4px;
    font-size: 14px;
}

.sidebar-user a {
    color: var(--yellow);
    margin-top: 8px;
}

.main {
    flex: 1;
    padding: 28px;
    min-width: 0;
}

.login-wrap {
    min-height: 100vh;
    width: 100%;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    padding: 24px;
    background: #151515;
}

.login-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../login-koyaa-crc.png") center / cover no-repeat;
    opacity: .72;
}

.login-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, .22) 48%, rgba(0, 0, 0, .52)),
        radial-gradient(circle at center, rgba(255, 201, 40, .10), transparent 45%);
}

.login-card {
    width: min(430px, calc(100vw - 32px));
    position: relative;
    z-index: 1;
    background: var(--white);
    border-radius: 8px;
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 201, 40, .28);
}

.login-brand {
    margin-bottom: 20px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    font-size: 30px;
    margin-bottom: 4px;
}

h2 {
    font-size: 19px;
    margin-bottom: 16px;
}

h3 {
    font-size: 16px;
}

.panel,
.metric {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel {
    padding: 20px;
    margin-bottom: 18px;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.table-toolbar.bottom {
    margin: 14px 0 0;
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.compact {
    padding: 14px 18px;
}

.metrics-grid,
.grid-two,
.grid-three,
.grid-four,
.prospect-layout {
    display: grid;
    gap: 18px;
}

.metrics-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    margin-bottom: 18px;
}

.grid-two {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    font-size: 30px;
    margin-top: 8px;
}

.permission-matrix {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    max-height: 460px;
    overflow: auto;
    background: #fffdf8;
}

.permission-matrix.compact {
    max-height: 220px;
}

.permission-matrix h3 {
    margin: 14px 0 8px;
    font-size: 15px;
}

.permission-matrix h3:first-child {
    margin-top: 0;
}

.permission-matrix small {
    color: var(--muted);
}

.prospect-layout {
    grid-template-columns: minmax(330px, 1fr) minmax(360px, .9fr);
}

.metric {
    padding: 18px;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.metric strong {
    display: block;
    font-size: 30px;
    margin-top: 8px;
}

.btn {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
}

.btn:hover {
    border-color: var(--orange);
}

.btn.primary {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--black);
}

.btn.whatsapp {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

.btn.call {
    background: #0b7f4f;
    color: var(--white);
    border-color: #0b7f4f;
    font-size: 16px;
    min-height: 52px;
}

.btn.direct-call {
    background: var(--yellow);
    color: var(--black);
    border-color: var(--yellow);
    font-size: 16px;
    min-height: 52px;
}

.btn.didlogic {
    background: var(--orange);
    color: var(--black);
    border-color: var(--orange);
}

.btn.email {
    background: #1f6feb;
    color: var(--white);
    border-color: #1f6feb;
}

.btn.sms {
    background: #374151;
    color: var(--white);
    border-color: #374151;
}

.btn.location {
    background: #7b4cc2;
    color: var(--white);
    border-color: #7b4cc2;
}

.btn.small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
}

.btn.danger {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}

.row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.row-actions form {
    margin: 0;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    background: var(--white);
}

textarea {
    resize: vertical;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
    font-size: 14px;
}

.field-block {
    display: grid;
    gap: 8px;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.check-line input {
    width: auto;
}

.form-stack,
.form-grid,
.filters,
.inline-form {
    display: grid;
    gap: 14px;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full,
.form-stack,
.form-grid .full {
    grid-column: 1 / -1;
}

.filters {
    grid-template-columns: minmax(220px, 2fr) repeat(auto-fit, minmax(160px, 1fr));
    align-items: end;
}

.inline-form {
    grid-template-columns: minmax(240px, 360px) auto 1fr;
    align-items: center;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
}

.checkbox input,
.quick-status input {
    width: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
}

td small {
    display: block;
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    background: var(--paper);
    color: var(--black);
    border: 1px solid #f0d78d;
    border-radius: 8px;
    padding: 5px 9px;
    font-size: 13px;
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
    border: 1px solid var(--line);
    text-transform: uppercase;
}

.status-badge.hot {
    background: #e7f7ef;
    border-color: #8ad2ad;
    color: #126b43;
}

.status-badge.warm {
    background: #fff5d2;
    border-color: #f3cf67;
    color: #7b5b00;
}

.status-badge.whatsapp {
    background: #e7f4ff;
    border-color: #9fcdf2;
    color: #115d96;
}

.status-badge.unreachable {
    background: #eeeeee;
    border-color: #d5d5d5;
    color: #303030;
}

.status-badge.lost {
    background: #ffe9e6;
    border-color: #efafa8;
    color: #9a271d;
}

.status-badge.callback {
    background: #f1e7ff;
    border-color: #c7a8ee;
    color: #5f2c91;
}

.status-badge.default {
    background: var(--paper);
    color: var(--black);
}

.flash {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    background: #fff5d2;
    border: 1px solid #f3cf67;
}

.flash.success {
    background: #e7f7ef;
    border-color: #9bd7b8;
}

.flash.error {
    background: #ffe9e6;
    border-color: #efafa8;
}

.script-panel {
    background: #151515;
    color: var(--white);
}

.script-panel h2,
.script-panel h3 {
    color: var(--yellow);
}

.script-block {
    border-top: 1px solid #3a3a3a;
    padding-top: 14px;
    margin-top: 14px;
    font-size: 17px;
}

.objection-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.answer-box {
    margin-top: 14px;
    padding: 16px;
    background: var(--paper);
    border: 1px solid #f0d78d;
    border-radius: 8px;
    font-weight: 700;
}

.history-list,
.simple-list {
    display: grid;
    gap: 12px;
}

.history-item,
.relance-card {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
}

.telephony-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
}

.telephony-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.timer {
    min-width: 92px;
    background: var(--black);
    color: var(--yellow);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 24px;
    font-weight: 900;
    text-align: center;
}

.compact-timer {
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.quick-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.telephony-desk {
    display: grid;
    grid-template-columns: minmax(240px, .8fr) minmax(420px, 1.4fr) minmax(260px, .9fr);
    gap: 14px;
    padding-bottom: 176px;
}

.desk-pane {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 18px;
    min-height: 520px;
}

.script-focus {
    background: var(--black);
    color: var(--white);
}

.script-focus h2,
.script-focus h3 {
    color: var(--yellow);
}

.script-focus .script-block {
    font-size: 21px;
    line-height: 1.6;
}

.prospect-pane h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.desk-status {
    display: inline-flex;
    background: var(--yellow);
    color: var(--black);
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 900;
    margin-bottom: 14px;
}

.prospect-facts {
    display: grid;
    grid-template-columns: 95px 1fr;
    gap: 8px 10px;
    margin: 0 0 18px;
}

.prospect-facts dt {
    color: var(--muted);
    font-weight: 700;
}

.prospect-facts dd {
    margin: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.full-btn {
    width: 100%;
    min-height: 56px;
    font-size: 17px;
}

.call-actions {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}

.call-actions form {
    margin: 0;
}

.call-actions.stacked {
    display: grid;
}

.call-actions .btn {
    min-height: 54px;
}

.app-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 60;
    max-width: min(360px, calc(100vw - 32px));
    padding: 14px 16px;
    border-radius: 8px;
    background: var(--black);
    color: var(--white);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.vertical {
    display: grid;
}

.vertical .btn {
    justify-content: flex-start;
    min-height: 54px;
    white-space: normal;
    text-align: left;
}

.large-answer {
    font-size: 18px;
    line-height: 1.55;
}

.quick-call-bar {
    position: fixed;
    left: 288px;
    right: 28px;
    bottom: 16px;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(130px, .7fr) minmax(300px, 1.4fr) minmax(130px, .6fr) minmax(105px, .5fr) minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
    gap: 10px;
    align-items: end;
    background: #fffdf8;
    border: 2px solid var(--yellow);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
    padding: 14px;
}

.quick-call-bar label {
    font-size: 12px;
}

.quick-call-bar select,
.quick-call-bar input,
.quick-call-bar textarea {
    padding: 9px 10px;
}

.quick-call-bar .btn {
    min-height: 58px;
}

.action-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.advanced-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
    align-items: end;
}

.chart-card {
    min-height: 360px;
}

.chart-card canvas {
    width: 100%;
    height: 280px;
}

.desk-fast-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.desk-fast-status label {
    display: block;
}

.desk-fast-status input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.desk-fast-status span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--white);
    font-weight: 900;
    cursor: pointer;
}

.desk-fast-status input:checked + span {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--black);
}

.relance-card:hover {
    border-color: var(--orange);
}

.quick-status {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.recording-box {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
}

.recording-box audio {
    width: 100%;
}

.compact-recording {
    min-width: 220px;
    align-self: stretch;
}

.record-main {
    background: #b91c1c;
    border-color: #b91c1c;
    color: var(--white);
    min-height: 58px;
    font-size: 14px;
    font-weight: 900;
}

.record-main:hover {
    background: #991b1b;
    border-color: #991b1b;
}

.record-stop {
    background: var(--black);
    border-color: var(--black);
    color: var(--white);
}

.dialer-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 18px;
}

.dialer-panel {
    max-width: 420px;
}

.dialer-number {
    font-size: 28px;
    font-weight: 900;
    min-height: 64px;
    letter-spacing: 0;
}

.dialer-pad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.dialer-key {
    min-height: 64px;
    font-size: 24px;
}

.public-location {
    min-height: calc(100vh - 56px);
    display: grid;
    place-items: center;
    padding: 20px;
}

.location-card {
    width: min(560px, 100%);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.locations-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr);
    gap: 18px;
}

.map-panel {
    position: relative;
}

.kicode-search {
    display: grid;
    grid-template-columns: minmax(160px, 260px) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 800;
}

.legend-dot {
    width: 13px;
    height: 13px;
    display: inline-block;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: -1px;
}

.legend-dot.home,
.location-pin-home span,
.kicode-mini.home {
    background: #1f6feb;
}

.legend-dot.work,
.location-pin-work span,
.kicode-mini.work {
    background: #f28a16;
}

.kicode-search input {
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 0;
}

.kicode-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    border-radius: 8px;
    background: var(--black);
    color: var(--yellow);
    padding: 6px 10px;
    font-weight: 900;
}

.kicode-link:hover {
    border-color: var(--orange);
    color: var(--white);
}

.locations-map {
    min-height: 620px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.location-pin {
    width: 26px;
    height: 26px;
}

.location-pin span {
    width: 22px;
    height: 22px;
    display: block;
    border: 3px solid var(--white);
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
    transform: rotate(-45deg);
}

.location-pin span::after {
    content: "";
    width: 6px;
    height: 6px;
    display: block;
    margin: 5px auto;
    background: var(--white);
    border-radius: 50%;
}

.kicode-mini {
    display: inline-flex;
    border-radius: 8px;
    color: var(--white);
    padding: 6px 9px;
    font-weight: 900;
}

.map-empty {
    position: absolute;
    left: 32px;
    top: 32px;
    z-index: 2;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
}

.location-details {
    position: sticky;
    top: 28px;
    height: fit-content;
}

.popup-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.leaflet-popup-content .btn {
    min-height: 30px;
}

.sales-interest-lane {
    overflow: hidden;
}

.sales-interest-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.sales-interest-head h2 {
    margin-bottom: 4px;
}

.sales-interest-head p {
    margin-bottom: 0;
    color: var(--muted);
}

.sales-interest-head span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 8px;
    background: var(--yellow);
    color: var(--black);
    padding: 7px 10px;
    font-weight: 900;
    white-space: nowrap;
}

.sales-interest-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x proximity;
}

.sales-interest-row .sales-card {
    flex: 0 0 300px;
    max-width: 330px;
    margin-bottom: 0;
    scroll-snap-align: start;
}

.sales-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(260px, 1fr));
    gap: 14px;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 16px;
}

.sales-column {
    min-width: 260px;
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.sales-column header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.sales-column header span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    border-radius: 8px;
    background: var(--yellow);
    color: var(--black);
    font-weight: 900;
}

.sales-card {
    display: grid;
    gap: 10px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .05);
}

.sales-card h3 {
    margin-bottom: 0;
}

.sales-card p {
    margin-bottom: 0;
}

.social-dot {
    width: 11px;
    height: 11px;
    display: inline-block;
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: -1px;
}

.social-preview-card {
    display: grid;
    gap: 12px;
    min-height: 220px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdf8;
    padding: 18px;
}

.social-preview-card p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.social-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    gap: 10px;
    overflow-x: auto;
}

.social-day {
    min-height: 150px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    box-shadow: var(--shadow);
}

.social-day strong {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
}

.social-event {
    display: block;
    margin-top: 7px;
    padding: 7px 8px;
    border-radius: 8px;
    background: var(--paper);
    border: 1px solid #f0d78d;
    font-size: 12px;
    font-weight: 800;
}

.social-event.published {
    background: #e7f7ef;
    border-color: #8ad2ad;
}

.social-event.failed,
.social-event.cancelled {
    background: #ffe9e6;
    border-color: #efafa8;
}

.sales-meta,
.sales-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.sales-meta span {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    border-radius: 8px;
    padding: 5px 8px;
    background: var(--paper);
    border: 1px solid #f0d78d;
    font-size: 12px;
    font-weight: 900;
}

.sales-edit {
    display: grid;
    gap: 8px;
}

.sales-edit input,
.sales-edit textarea {
    padding: 8px 9px;
    font-size: 13px;
}

.sales-actions form {
    margin: 0;
}

.empty-column {
    padding: 12px 4px;
}

@media (max-width: 1100px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-two,
    .grid-three,
    .grid-four,
    .prospect-layout,
    .locations-layout,
    .dialer-layout {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr 1fr;
    }

    .advanced-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .social-calendar {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }

    .telephony-desk {
        grid-template-columns: 1fr;
        padding-bottom: 0;
    }

    .desk-pane {
        min-height: auto;
    }

    .quick-call-bar {
        position: static;
        grid-template-columns: 1fr 1fr;
        margin-top: 16px;
    }
}

@media (max-width: 760px) {
    .attendance-steps {
        grid-template-columns: 1fr;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 16px;
    }

    .sidebar nav:not(.sidebar-nav) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .sidebar-nav .nav-group {
        width: 100%;
    }

    .main {
        padding: 16px;
    }

    .page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .metrics-grid,
    .form-grid,
    .filters,
    .inline-form,
    .advanced-filters {
        grid-template-columns: 1fr;
    }

    .table-panel {
        overflow-x: auto;
    }

    table {
        min-width: 680px;
    }

    .telephony-head {
        flex-direction: column;
        align-items: stretch;
    }

    .telephony-tools {
        align-items: stretch;
    }

    .telephony-tools .btn,
    .telephony-tools form,
    .timer {
        width: 100%;
    }

    .script-focus .script-block {
        font-size: 18px;
    }

    .quick-call-bar {
        grid-template-columns: 1fr;
    }

    .kicode-search {
        grid-template-columns: 1fr;
    }

    .social-calendar {
        grid-template-columns: 1fr;
    }
}

.koyaa-messenger {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9999;
    font-size: 14px;
}

.koyaa-messenger [hidden] {
    display: none !important;
}

.koyaa-messenger.is-minimized {
    right: 22px;
    bottom: 22px;
}

.koyaa-messenger.is-ringing .koyaa-messenger-toggle,
.koyaa-messenger.is-ringing .koyaa-messenger-panel header {
    animation: koyaa-ring-pulse .9s ease-in-out infinite;
}

@keyframes koyaa-ring-pulse {
    0%, 100% {
        box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(255, 201, 40, .34), 0 14px 34px rgba(0, 0, 0, .28);
    }
}

.koyaa-messenger-toggle {
    border: 0;
    border-radius: 999px;
    background: var(--yellow);
    color: var(--black);
    padding: 13px 18px;
    font-weight: 900;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.koyaa-messenger-badge {
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #d31616;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
}

.koyaa-messenger-panel {
    position: absolute;
    right: 0;
    bottom: 58px;
    width: min(760px, calc(100vw - 28px));
    height: min(560px, calc(100vh - 110px));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 88px);
}

.koyaa-messenger.is-fullscreen {
    inset: 0;
    right: 0;
    bottom: 0;
}

.koyaa-messenger.is-fullscreen .koyaa-messenger-toggle {
    display: none;
}

.koyaa-messenger.is-fullscreen .koyaa-messenger-panel {
    position: fixed;
    inset: 12px;
    width: auto;
    height: auto;
    border-radius: 10px;
}

.koyaa-messenger-panel header {
    height: 62px;
    background: #111;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.koyaa-messenger-panel header small {
    display: block;
    color: #cfcfcf;
}

.koyaa-messenger-close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
}

.koyaa-messenger-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.koyaa-messenger-call,
.koyaa-messenger-video,
.koyaa-messenger-conference,
.koyaa-messenger-hangup,
.koyaa-messenger-fullscreen,
.koyaa-messenger-ring-test,
.koyaa-call-accept,
.koyaa-call-reject {
    border: 0;
    border-radius: 8px;
    padding: 9px 12px;
    font-weight: 900;
    cursor: pointer;
}

.koyaa-messenger-call,
.koyaa-messenger-video,
.koyaa-messenger-conference,
.koyaa-call-accept {
    background: #118849;
    color: #fff;
}

.koyaa-messenger-conference {
    background: #f4b400;
    color: #111;
}

.koyaa-messenger-fullscreen {
    background: #2d2d2d;
    color: #fff;
}

.koyaa-messenger-ring-test {
    background: #fff;
    color: #111;
}

.koyaa-messenger-camera {
    width: 180px;
    min-height: 36px;
    padding: 7px 9px;
    border-radius: 8px;
    font-size: 12px;
}

.koyaa-messenger-hangup,
.koyaa-call-reject {
    background: #c91f1f;
    color: #fff;
}

.koyaa-call-strip {
    min-height: 58px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: #fff8df;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    align-items: center;
}

.koyaa-call-strip .koyaa-call-title,
.koyaa-call-strip .koyaa-call-status {
    display: block;
}

.koyaa-call-strip .koyaa-call-status {
    color: var(--muted);
}

.koyaa-call-actions {
    display: flex;
    gap: 8px;
    grid-row: span 2;
}

.koyaa-messenger-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 245px 1fr;
    overflow: hidden;
}

.koyaa-video-stage {
    position: absolute;
    inset: 62px 0 0 245px;
    background: #050505;
    display: grid;
    place-items: center;
    z-index: 2;
}

.koyaa-call-remote-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #050505;
}

.koyaa-call-local-video {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 180px;
    max-width: 28%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border: 3px solid #fff;
    border-radius: 8px;
    background: #111;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .35);
}

.koyaa-messenger-users {
    border-right: 1px solid var(--line);
    padding: 12px;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 10px;
    min-width: 0;
}

.koyaa-messenger-users input {
    width: 100%;
}

.koyaa-messenger-user-list {
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 6px;
}

.koyaa-messenger-user {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 9px 10px;
    text-align: left;
    cursor: pointer;
}

.koyaa-messenger-user.active,
.koyaa-messenger-user:hover {
    border-color: var(--yellow);
    background: #fff8df;
}

.koyaa-messenger-user.has-unread {
    border-color: #ff8a00;
    background: #fff3d7;
    animation: koyaa-message-blink 1s ease-in-out infinite;
}

.koyaa-messenger-user.has-unread small {
    color: #b35300;
    font-weight: 900;
}

@keyframes koyaa-message-blink {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 138, 0, .35);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(255, 138, 0, .18);
    }
}

.koyaa-messenger-user strong,
.koyaa-messenger-user small {
    display: block;
}

.koyaa-messenger-user small {
    color: var(--muted);
}

.koyaa-messenger-chat {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    background: #f7f5ef;
}

.koyaa-messenger-empty {
    padding: 22px;
    color: var(--muted);
}

.koyaa-messenger-thread {
    overflow: auto;
    min-height: 0;
    padding: 14px;
    display: grid;
    gap: 10px;
    align-content: start;
}

.koyaa-message {
    max-width: 78%;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--line);
}

.koyaa-message.me {
    justify-self: end;
    background: #fff1bd;
    border-color: #f2c94c;
}

.koyaa-message small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.koyaa-message a {
    color: #0b5ed7;
    font-weight: 800;
}

.koyaa-messenger-form {
    border-top: 1px solid var(--line);
    background: #fff;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: end;
    flex-shrink: 0;
}

.koyaa-messenger-form textarea {
    resize: none;
    min-height: 44px;
    max-height: 100px;
    overflow: auto;
}

.koyaa-messenger-form button,
.koyaa-file-pill {
    border: 0;
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--yellow);
    color: var(--black);
    font-weight: 900;
    cursor: pointer;
}

.koyaa-file-pill {
    background: #f2f2f2;
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
}

.koyaa-file-pill input {
    display: none;
}

.prospect-vehicles {
    margin-top: 10px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
    display: grid;
    gap: 12px;
}

.prospect-vehicles h3 {
    margin: 0;
}

.vehicle-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #faf8f1;
    display: grid;
    gap: 10px;
}

.vehicle-card h4 {
    margin: 0;
}

.vehicle-doc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 760px) {
    .koyaa-messenger {
        right: 12px;
        bottom: 12px;
    }

    .koyaa-messenger-panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 88px);
    }

    .koyaa-messenger-body {
        grid-template-columns: 1fr;
        grid-template-rows: 150px 1fr;
    }

    .koyaa-video-stage {
        inset: 62px 0 0 0;
    }

    .koyaa-call-local-video {
        width: 120px;
        right: 10px;
        bottom: 10px;
    }

    .koyaa-messenger-users {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .koyaa-messenger-user-list {
        grid-auto-flow: column;
        grid-auto-columns: 190px;
        overflow-x: auto;
    }

    .koyaa-messenger-form {
        grid-template-columns: 1fr;
    }
}
