:root {
    --app-bg: #f5f8fa;
    --app-border: #cbd6e2;
    --app-ink: #33475b;
    --app-muted: #6a7e90;
    --app-green: #0091ae;
    --app-green-dark: #007a8c;
    --app-green-soft: #e5f5f8;
    --app-amber: #a85b00;
    --app-amber-soft: #fff3df;
    --bs-primary: #0091ae;
    --bs-primary-rgb: 0, 145, 174;
    --bs-success: #0091ae;
    --bs-success-rgb: 0, 145, 174;
    --bs-body-color: #33475b;
    --bs-body-bg: #f5f8fa;
    --bs-border-color: #cbd6e2;
    --bs-border-radius: 0.375rem;
    --bs-border-radius-lg: 0.5rem;
}

[v-cloak] {
    display: none;
}

body {
    min-width: 320px;
    min-height: 100vh;
    background: var(--app-bg);
    color: var(--app-ink);
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    letter-spacing: 0;
}

.app-shell {
    max-width: 1760px;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1020;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-mark {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--app-green);
    color: #ffffff;
}

.brand-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.brand-status {
    color: var(--app-muted);
    font-size: 0.75rem;
}

.status-dot {
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    margin-right: 0.25rem;
    border-radius: 50%;
    background: #22a06b;
}

.status-dot.is-loading {
    background: #d4870d;
}

.status-dot.is-error {
    background: #c23b3b;
}

.app-icon {
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    stroke-width: 2;
    vertical-align: -0.15em;
}

.app-command {
    display: inline-flex;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.header-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--app-border);
    border-radius: 0.35rem;
    background: #f5f8fa;
}

.header-tab {
    display: inline-flex;
    min-height: 2.25rem;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border: 0;
    border-radius: 0.25rem;
    background: transparent;
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.header-tab:hover,
.header-tab:focus-visible {
    background: #ffffff;
    color: var(--app-green-dark);
}

.header-tab.is-active {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(51, 71, 91, 0.12);
    color: var(--app-ink);
}

.header-tab-count {
    display: inline-flex;
    min-width: 1.2rem;
    height: 1.2rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--app-green-soft);
    color: var(--app-green-dark);
    font-size: 0.64rem;
}

.search-wrap {
    position: relative;
}

.search-input {
    height: 2.75rem;
    padding-left: 2.6rem;
    padding-right: 2.75rem;
    background: #f8faf9;
}

.search-input:focus {
    border-color: #00a4bd;
    background: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(0, 145, 174, 0.12);
}

.search-input::-webkit-search-cancel-button {
    display: none;
    appearance: none;
}

.search-leading {
    position: absolute;
    top: 0.86rem;
    left: 0.9rem;
    z-index: 2;
    color: var(--app-muted);
    pointer-events: none;
}

.search-clear {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    z-index: 2;
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.search-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    left: 0;
    z-index: 1050;
    max-height: min(65vh, 34rem);
    overflow-y: auto;
    border: 1px solid var(--app-border);
    border-radius: 0.375rem;
    background: #ffffff;
    box-shadow: 0 0.75rem 2rem rgba(32, 38, 34, 0.14);
}

.search-heading {
    padding: 0.7rem 1rem 0.4rem;
    color: var(--app-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.search-result {
    display: flex;
    width: 100%;
    min-height: 3.25rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border: 0;
    border-top: 1px solid #edf0ee;
    background: #ffffff;
    color: inherit;
    text-align: left;
}

.search-result:hover,
.search-result:focus-visible {
    background: var(--app-green-soft);
    outline: 0;
}

.search-result-copy {
    min-width: 0;
    flex: 1;
}

.search-result-title,
.search-result-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.search-result-meta {
    color: var(--app-muted);
    font-size: 0.76rem;
}

.workspace {
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 0.25rem;
    background: #ffffff;
    box-shadow: 0 0.125rem 0.5rem rgba(51, 71, 91, 0.05);
}

.call-list-builder {
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 0.25rem;
    background: #ffffff;
    box-shadow: 0 0.125rem 0.5rem rgba(51, 71, 91, 0.05);
}

.call-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--app-border);
}

.call-list-title {
    margin: 0;
    color: var(--app-ink);
    font-size: 1.25rem;
    font-weight: 700;
}

.call-list-subtitle {
    margin: 0.3rem 0 0;
    color: var(--app-muted);
    font-size: 0.8rem;
}

.call-list-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.call-list-filters {
    display: grid;
    grid-template-columns: minmax(14rem, 1.5fr) repeat(3, minmax(10rem, 1fr)) minmax(13rem, 1fr);
    gap: 0.65rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--app-border);
    background: #f8fbfc;
}

.call-list-search {
    position: relative;
}

.call-list-search .app-icon {
    position: absolute;
    top: 0.72rem;
    left: 0.75rem;
    z-index: 1;
    color: var(--app-muted);
    pointer-events: none;
}

.call-list-search .form-control {
    padding-left: 2.25rem;
}

.call-list-sort {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.45rem;
    gap: 0.35rem;
}

.call-list-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1.5rem;
    border-bottom: 1px solid #e6edf2;
    color: var(--app-muted);
    font-size: 0.72rem;
}

.call-list-loading,
.call-list-empty {
    display: flex;
    min-height: 18rem;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--app-muted);
    font-size: 0.82rem;
}

.call-list-table-wrap {
    max-height: calc(100vh - 20rem);
    overflow: auto;
}

.call-list-table {
    width: 100%;
    min-width: 62rem;
    border-collapse: collapse;
    font-size: 0.76rem;
}

.call-list-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--app-border);
    background: #f5f8fa;
    color: var(--app-muted);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: left;
    text-transform: uppercase;
}

.call-list-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid #e6edf2;
    color: var(--app-ink);
    vertical-align: middle;
}

.call-list-table tbody tr:hover {
    background: #fbfeff;
}

.call-list-check {
    width: 2.75rem;
    text-align: center !important;
}

.call-list-company {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--app-green-dark);
    font-weight: 700;
    text-align: left;
}

.call-list-company:hover,
.call-list-company:focus-visible {
    text-decoration: underline;
}

.call-list-muted {
    margin-top: 0.15rem;
    color: var(--app-muted);
    font-size: 0.68rem;
}

.call-list-status {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.12rem 0.35rem;
    border-radius: 999px;
    background: #edf2f5;
    color: var(--app-muted);
    font-size: 0.6rem;
    font-weight: 700;
}

.call-list-status.is-due,
.is-due-date {
    color: #b64a00 !important;
}

.call-list-status.is-due {
    background: #fff0e6;
}

.call-list-status.is-scheduled {
    background: var(--app-green-soft);
    color: var(--app-green-dark);
}

.call-list-status.is-new {
    background: #eaf2ff;
    color: #315b96;
}

.workspace-main,
.workspace-side {
    min-width: 0;
}

.workspace-side {
    border-left: 1px solid var(--app-border);
    background: #fbfcfb;
}

.company-profile {
    padding: 1.5rem;
}

.company-title {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.25;
}

.company-industry {
    margin-top: 0.3rem;
    color: var(--app-muted);
    font-size: 0.9rem;
}

.company-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.5rem;
    margin-top: 1.25rem;
}

.meta-item {
    min-width: 8rem;
}

.meta-label {
    margin-bottom: 0.15rem;
    color: var(--app-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.meta-value {
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.call-button {
    display: inline-flex;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.contacts-heading,
.panel-heading {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.contacts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid var(--app-border);
    border-bottom: 1px solid var(--app-border);
    background: #f8faf9;
}

.contact-row {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #edf0ee;
}

.contact-row:last-child {
    border-bottom: 0;
}

.contact-row.is-selected {
    box-shadow: inset 3px 0 0 var(--app-green);
    background: #fbfdfc;
}

.contact-name {
    font-size: 0.95rem;
    font-weight: 650;
}

.contact-detail {
    margin-top: 0.2rem;
    color: var(--app-muted);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.contact-actions .btn {
    max-width: 13rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-panel,
.call-controls-panel,
.history-panel {
    padding: 1.25rem;
}

.call-controls-panel,
.call-panel {
    border-bottom: 1px solid var(--app-border);
}

.call-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.call-controls-number {
    overflow: hidden;
    color: var(--app-muted);
    font-size: 0.8rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dialpad {
    display: grid;
    max-width: 18rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0 auto 1rem;
}

.dialpad-button {
    min-height: 2.75rem;
    font-size: 1rem;
    font-weight: 650;
}

.hangup-button {
    display: flex;
    width: 100%;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.form-label {
    color: #4f5953;
    font-size: 0.78rem;
    font-weight: 650;
}

.form-control,
.form-select {
    border-color: #cfd6d2;
}

.form-control:focus,
.form-select:focus {
    border-color: #84ad9c;
    box-shadow: 0 0 0 0.2rem rgba(23, 107, 77, 0.12);
}

.note-textarea {
    min-height: 8rem;
    resize: vertical;
}

.history-list {
    margin-top: 1rem;
}

.history-item {
    position: relative;
    padding: 0 0 1.15rem 1rem;
    border-left: 2px solid #dfe4e1;
}

.history-item:last-child {
    padding-bottom: 0;
}

.history-item::before {
    position: absolute;
    top: 0.25rem;
    left: -0.34rem;
    width: 0.55rem;
    height: 0.55rem;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: var(--app-green);
    content: "";
}

.history-meta {
    color: var(--app-muted);
    font-size: 0.73rem;
}

.history-note {
    margin: 0.4rem 0 0;
    font-size: 0.86rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.disposition-badge {
    display: inline-block;
    margin-right: 0.35rem;
    padding: 0.18rem 0.4rem;
    border-radius: 0.25rem;
    background: var(--app-amber-soft);
    color: var(--app-amber);
    font-size: 0.68rem;
    font-weight: 700;
}

.loading-state,
.empty-state {
    display: flex;
    min-height: 28rem;
    align-items: center;
    justify-content: center;
}

.empty-state {
    flex-direction: column;
    padding: 3rem 1.5rem;
    color: var(--app-muted);
    text-align: center;
}

.empty-icon {
    display: inline-flex;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: var(--app-green-soft);
    color: var(--app-green);
}

.empty-icon .app-icon {
    width: 1.35rem;
    height: 1.35rem;
}

.empty-title {
    color: var(--app-ink);
    font-size: 1rem;
    font-weight: 700;
}

.empty-message {
    max-width: 26rem;
    margin-top: 0.35rem;
    font-size: 0.86rem;
}

/* Simplified record view */
.workspace-grid {
    display: grid;
    min-height: calc(100vh - 8.25rem);
    grid-template-columns: minmax(15.5rem, 18rem) minmax(32rem, 1fr) minmax(18rem, 22rem);
}

.company-sidebar,
.activity-column,
.contacts-sidebar {
    min-width: 0;
}

.company-sidebar {
    border-right: 1px solid var(--app-border);
    background: #ffffff;
}

.activity-column {
    background: var(--app-bg);
}

.contacts-sidebar {
    border-left: 1px solid var(--app-border);
    background: #ffffff;
}

.section-eyebrow {
    margin-bottom: 0.2rem;
    color: var(--app-muted);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.company-profile {
    padding: 1.5rem 1.25rem 0;
}

.company-avatar {
    display: flex;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border: 1px solid #b6c7d6;
    border-radius: 0.25rem;
    background: #f5f8fa;
    color: var(--app-muted);
}

.company-avatar .app-icon {
    width: 1.4rem;
    height: 1.4rem;
}

.company-title {
    font-size: 1.25rem;
    line-height: 1.3;
}

.company-industry {
    margin-top: 0.25rem;
    font-size: 0.8rem;
}

.company-website {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.65rem;
    color: var(--app-green-dark);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.company-website .app-icon {
    width: 0.75rem;
    height: 0.75rem;
    flex-basis: 0.75rem;
}

.record-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    margin: 1.5rem 0 1.75rem;
}

.record-action {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--app-ink);
    font-size: 0.7rem;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.record-action:hover:not(:disabled),
.record-action:focus-visible:not(:disabled) {
    color: var(--app-green-dark);
}

.record-action:focus-visible {
    border-radius: 0.3rem;
    outline: 2px solid rgba(0, 145, 174, 0.3);
    outline-offset: 0.2rem;
}

.record-action:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.record-action-icon {
    display: inline-flex;
    width: 2.35rem;
    height: 2.35rem;
    align-items: center;
    justify-content: center;
    border: 1px solid #b7cad8;
    border-radius: 50%;
    background: #f2f7fa;
    color: var(--app-green-dark);
}

.record-action:hover:not(:disabled) .record-action-icon {
    border-color: var(--app-green);
    background: var(--app-green-soft);
}

.profile-section {
    margin: 0 -1.25rem;
    padding: 1.1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--app-border);
}

.profile-section-title {
    margin: 0 0 1rem;
    color: var(--app-ink);
    font-size: 0.78rem;
    font-weight: 700;
}

.profile-property + .profile-property {
    margin-top: 0.9rem;
}

.property-label {
    margin-bottom: 0.2rem;
    color: var(--app-muted);
    font-size: 0.7rem;
}

.property-value {
    color: var(--app-ink);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.activity-header {
    display: flex;
    min-height: 4.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--app-border);
    background: #ffffff;
}

.activity-title {
    margin: 0;
    color: var(--app-ink);
    font-size: 1rem;
    font-weight: 700;
}

.activity-count {
    display: inline-flex;
    min-width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--app-border);
    border-radius: 50%;
    background: #ffffff;
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.activity-tools {
    display: grid;
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr) 15rem;
    border-bottom: 1px solid var(--app-border);
    background: #ffffff;
}

.call-controls-panel {
    padding: 1.25rem;
    border-bottom: 0;
    border-left: 1px solid var(--app-border);
    background: #f8fbfc;
}

.call-controls-panel.is-active {
    background: #eef8f7;
}

.call-controls-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
}

.call-status-copy {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--app-ink);
    font-size: 0.76rem;
    font-weight: 650;
}

.call-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #7c98ad;
}

.is-active .call-status-dot {
    background: #00a4bd;
    box-shadow: 0 0 0 0.25rem rgba(0, 164, 189, 0.12);
}

.call-controls-number {
    max-width: 100%;
    font-size: 0.72rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

.active-call-tools {
    display: block;
    margin-top: 1rem;
}

.dialpad {
    display: grid;
    max-width: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin: 0 0 0.75rem;
}

.dialpad-button {
    min-height: 2.35rem;
    padding: 0.3rem;
    background: #ffffff;
    font-size: 0.8rem;
}

.hangup-button {
    width: 100%;
    min-height: 2.35rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
}

.call-panel {
    padding: 1.25rem 1.5rem;
    border-bottom: 0;
    background: #ffffff;
}

.call-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.call-followup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.panel-heading,
.contacts-heading {
    color: var(--app-ink);
    font-size: 0.88rem;
    text-transform: none;
}

.selected-call-target {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid #b7c7d6;
    border-radius: 0.25rem;
    background: #f8fbfc;
}

.selected-call-icon {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--app-green-soft);
    color: var(--app-green-dark);
}

.selected-call-copy {
    min-width: 0;
    flex: 1;
}

.selected-call-label {
    color: var(--app-muted);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.selected-call-name {
    overflow: hidden;
    color: var(--app-ink);
    font-size: 0.82rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-call-phone,
.selected-call-help {
    color: var(--app-muted);
    font-size: 0.7rem;
}

.selected-call-help {
    flex: 0 0 auto;
    text-align: right;
}

.form-label {
    margin-bottom: 0.3rem;
    color: var(--app-muted);
    font-size: 0.7rem;
}

.form-control,
.form-select {
    border-color: #b7c7d6;
    color: var(--app-ink);
    font-size: 0.82rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #00a4bd;
    box-shadow: 0 0 0 0.2rem rgba(0, 145, 174, 0.12);
}

.note-textarea {
    min-height: 5.5rem;
}

.history-panel {
    padding: 1.5rem;
}

.history-list {
    margin: 0;
}

.history-item {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0 0 1rem;
    border: 0;
}

.history-item::before {
    top: 2.25rem;
    bottom: -0.25rem;
    left: 1.08rem;
    width: 1px;
    height: auto;
    border: 0;
    border-radius: 0;
    background: #b7c7d6;
}

.history-item:last-child::before {
    display: none;
}

.history-icon {
    position: relative;
    z-index: 1;
    display: flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border: 1px solid #b7cad8;
    border-radius: 50%;
    background: #ffffff;
    color: var(--app-green-dark);
}

.history-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: 0.25rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(51, 71, 91, 0.04);
}

.history-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.history-title {
    color: var(--app-ink);
    font-size: 0.84rem;
    font-weight: 700;
}

.history-meta,
.history-time {
    color: var(--app-muted);
    font-size: 0.68rem;
}

.history-time {
    flex: 0 0 auto;
}

.history-note {
    margin: 0.75rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid #e6edf2;
    color: var(--app-ink);
    font-size: 0.8rem;
}

.contacts-panel {
    position: sticky;
    top: 5.3rem;
}

.contacts-header {
    min-height: 4.75rem;
    padding: 0.9rem 1.25rem;
    border-top: 0;
    background: #ffffff;
}

.contacts-heading span {
    color: var(--app-muted);
    font-weight: 600;
}

.contacts-list {
    max-height: calc(100vh - 10.5rem);
    padding: 0.85rem;
    overflow-y: auto;
}

.contact-row {
    position: relative;
    padding: 1rem 2.75rem 1rem 1rem;
    border: 1px solid var(--app-border);
    border-radius: 0.25rem;
    background: #ffffff;
}

.contact-row + .contact-row {
    margin-top: 0.75rem;
}

.contact-row:last-child {
    border-bottom: 1px solid var(--app-border);
}

.contact-row.is-selected {
    border-color: #65b9ca;
    box-shadow: inset 3px 0 0 var(--app-green);
    background: #fbfeff;
}

.contact-remove {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0.25rem;
    background: transparent;
    color: #8497a8;
}

.contact-remove:hover:not(:disabled),
.contact-remove:focus-visible:not(:disabled) {
    background: #fdebec;
    color: #c23943;
}

.contact-remove:focus-visible {
    outline: 2px solid rgba(194, 57, 67, 0.25);
    outline-offset: 1px;
}

.contact-remove:disabled {
    cursor: wait;
    opacity: 0.55;
}

.contact-remove .app-icon,
.contact-remove .spinner-border {
    width: 0.82rem;
    height: 0.82rem;
}

.contact-avatar {
    display: flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.65rem;
    border-radius: 50%;
    background: var(--app-green-soft);
    color: var(--app-green-dark);
}

.contact-avatar .app-icon {
    width: 0.85rem;
    height: 0.85rem;
}

.contact-name {
    color: var(--app-green-dark);
    font-size: 0.84rem;
}

.contact-detail {
    font-size: 0.72rem;
    line-height: 1.45;
}

.contact-link {
    display: block;
    color: var(--app-green-dark);
}

.contact-phone-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.65rem;
    margin-top: 0.5rem;
}

.contact-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--app-muted);
    font-size: 0.68rem;
}

.contact-phone .app-icon {
    width: 0.7rem;
    height: 0.7rem;
    flex-basis: 0.7rem;
}

.contact-follow-up {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.45rem;
    color: #b64a00;
    font-size: 0.68rem;
    font-weight: 650;
}

.contact-follow-up .app-icon {
    width: 0.72rem;
    height: 0.72rem;
    flex-basis: 0.72rem;
}

.contact-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 0.85rem;
}

.contact-action {
    display: inline-flex;
    min-width: 0;
    min-height: 2.2rem;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.35rem 0.25rem;
    border: 1px solid #a9c2d1;
    border-radius: 0.25rem;
    background: #ffffff;
    color: var(--app-green-dark);
    font-size: 0.66rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.contact-action:hover:not(:disabled),
.contact-action:focus-visible:not(:disabled) {
    border-color: var(--app-green);
    background: var(--app-green-soft);
    color: var(--app-green-dark);
}

.contact-action:focus-visible {
    outline: 2px solid rgba(0, 145, 174, 0.25);
    outline-offset: 1px;
}

.contact-action:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.contact-action .app-icon {
    width: 0.78rem;
    height: 0.78rem;
    flex-basis: 0.78rem;
}

.btn-success {
    --bs-btn-bg: var(--app-green);
    --bs-btn-border-color: var(--app-green);
    --bs-btn-hover-bg: var(--app-green-dark);
    --bs-btn-hover-border-color: var(--app-green-dark);
    --bs-btn-active-bg: var(--app-green-dark);
    --bs-btn-active-border-color: var(--app-green-dark);
}

.btn-outline-success {
    --bs-btn-color: var(--app-green);
    --bs-btn-border-color: #8fb3a3;
    --bs-btn-hover-bg: var(--app-green);
    --bs-btn-hover-border-color: var(--app-green);
}

@media (max-width: 1199.98px) {
    .call-list-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .call-list-search {
        grid-column: 1 / -1;
    }

    .workspace-grid {
        grid-template-columns: minmax(15rem, 17rem) minmax(0, 1fr);
    }

    .contacts-sidebar {
        grid-column: 1 / -1;
        border-top: 1px solid var(--app-border);
        border-left: 0;
    }

    .contacts-panel {
        position: static;
    }

    .contacts-list {
        display: grid;
        max-height: none;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .contact-row + .contact-row {
        margin-top: 0;
    }
}

@media (max-width: 767.98px) {
    .app-header {
        position: static;
    }

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

    .header-tab {
        justify-content: center;
    }

    .call-list-header {
        align-items: stretch;
        flex-direction: column;
        padding: 1rem;
    }

    .call-list-header-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .call-list-filters {
        grid-template-columns: minmax(0, 1fr);
        padding: 1rem;
    }

    .call-list-search {
        grid-column: auto;
    }

    .call-list-summary {
        align-items: flex-start;
        flex-direction: column;
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .call-list-table-wrap {
        max-height: 32rem;
    }

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

    .company-sidebar,
    .contacts-sidebar {
        border-right: 0;
        border-left: 0;
    }

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

    .call-controls-panel {
        border-top: 1px solid var(--app-border);
        border-left: 0;
    }

    .company-profile,
    .call-panel,
    .call-controls-panel,
    .history-panel,
    .activity-header {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .company-title {
        font-size: 1.2rem;
    }

    .profile-section {
        margin-right: -1rem;
        margin-left: -1rem;
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .selected-call-target {
        align-items: flex-start;
        flex-wrap: wrap;
    }

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

    .selected-call-help {
        width: 100%;
        padding-left: 3rem;
        text-align: left;
    }

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

    .hangup-button {
        width: 100%;
    }

    .history-card-header {
        flex-direction: column;
        gap: 0.25rem;
    }

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