/* Typography shared by Orchid authentication and admin screens. */
html { font-size: 16px; }
body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.025em;
}
h1, .h1 { font-size: 32px; }
h2, .h2 { font-size: 26px; }
h3, .h3 { font-size: 24px; }
h4, .h4 { font-size: 21px; }
h5, .h5 { font-size: 18px; }
h6, .h6 { font-size: 15px; }
.workspace .fw-light { font-weight: 600 !important; }
small, .small, .form-text, .invalid-feedback { font-size: 13px; line-height: 1.5; }
label, .form-label { font-size: 14px; font-weight: 500; white-space: normal; line-height: 1.5; }
.form-control, .form-select, .ts-control { font-size: 15px; line-height: 1.5; min-height: 42px; }
.btn, .nav-link, .dropdown-item { font-size: 14px; font-weight: 500; line-height: 1.5; }
.table { font-size: 14px; line-height: 1.5; }
.table > thead > tr > th { font-size: 13px; font-weight: 600; }
.table > tbody > tr > td { padding-block: 14px; vertical-align: middle; }
.badge { font-size: 12px; font-weight: 500; line-height: 1.4; text-shadow: none; }
legend { font-size: 18px; font-weight: 600; line-height: 1.4; }
.crm-brand-name { font-size: 20px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.3; }
.crm-brand-caption { font-size: 13px; line-height: 1.5; margin-top: 3px; }
.crm-auth {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 8px;
}
.crm-auth-card {
    width: 100%;
    max-width: 440px;
    padding: 36px;
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgb(20 30 50 / 6%);
}
.crm-auth-brand { display: block; margin-bottom: 28px; }
.crm-auth h1 { font-size: 26px; line-height: 1.25; margin-bottom: 26px !important; }
.crm-auth .form-control { font-size: 16px; min-height: 48px; border-radius: 8px; }
.crm-auth form > .mb-3 { margin-bottom: 22px !important; }
.crm-auth form > .row { gap: 18px; }
.crm-auth form > .row > div { width: 100%; }
.crm-auth #button-login { width: 100%; min-height: 48px; font-size: 15px; font-weight: 600; border-radius: 8px; }
.crm-auth-footer { font-size: 13px; color: #626d7c; margin: 24px 0 0; text-align: center; }
@media (max-width: 767px) {
    .form-control, .form-select, .ts-control { font-size: 16px; }
    h1, .h1 { font-size: 28px; }
    h2, .h2 { font-size: 24px; }
    .crm-auth-card { padding: 28px 24px; }
    .crm-auth h1 { font-size: 24px; }
}

/* Let flex and grid children fit the viewport rather than their text width. */
.crm-platform .workspace,
.crm-platform .workspace .row > *,
.crm-platform .layout,
.crm-platform .crm-page-title,
.crm-platform .crm-page-actions,
.crm-platform .crm-dashboard-intro > *,
.crm-platform [aria-labelledby="follow-ups-title"] .flex-grow-1 {
    min-width: 0;
}
.crm-platform .workspace h1,
.crm-platform .workspace h2,
.crm-platform .workspace h3,
.crm-platform .workspace p,
.crm-platform .workspace legend {
    overflow-wrap: anywhere;
}
.crm-platform .crm-page-header { position: static; }
.crm-platform .crm-page-header .command-bar { margin: 0; padding: 0; }
.crm-platform .crm-page-header .command-bar:empty { display: none !important; }
.crm-platform .crm-metric-value > small { display: block; margin-top: 8px; letter-spacing: normal; }
.crm-platform .table-responsive { max-width: 100%; overscroll-behavior-x: contain; }
.crm-platform .table-responsive .table { min-width: 600px; }
.crm-platform .table-responsive .table th { white-space: nowrap; }
.crm-platform .table-responsive .table td { min-width: 100px; }
.crm-platform .modal-content { min-width: 0; }
.crm-platform .modal-footer { flex-wrap: wrap; }

@media (max-width: 991px) {
    .crm-platform .aside { height: auto; min-height: 76px; }
    .crm-platform:not(.menu-open) .aside-collapse { display: none !important; }
    .crm-platform .aside > header {
        padding: 12px 16px !important;
        margin-top: 0 !important;
        gap: 12px;
        justify-content: space-between;
    }
    .crm-platform .aside .header-brand {
        min-width: 0;
        flex: 1;
        order: 0 !important;
    }
    .crm-platform .crm-brand { gap: 10px !important; padding-block: 0 !important; }
    .crm-platform .crm-brand img { width: 40px; height: 40px; }
    .crm-platform .crm-brand-name { font-size: 18px; overflow-wrap: anywhere; }
    .crm-platform .crm-brand-caption { font-size: 12px; }
    .crm-platform .crm-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex-shrink: 0;
        min-width: 44px;
        min-height: 44px;
        padding: 8px 12px;
        color: #fff;
        background: transparent;
        border: 1px solid rgb(255 255 255 / 25%);
        border-radius: 8px;
        font-size: 14px;
        order: 1;
    }
    .crm-platform .crm-menu-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
    .crm-platform.menu-open .aside { min-height: 100svh; }
    .crm-platform.menu-open .aside-collapse { min-height: calc(100svh - 76px); }
    .crm-platform .aside-collapse .nav-link,
    .crm-platform .aside-collapse .dropdown-item { min-height: 44px; }
    .crm-platform .aside-collapse > footer { padding-bottom: env(safe-area-inset-bottom, 0px); }
    .crm-platform .workspace { height: auto !important; padding-bottom: 24px; }
    .crm-platform .workspace > .row > .col-lg > [aria-labelledby="follow-ups-title"] {
        height: auto !important;
        margin-bottom: 16px !important;
    }
}

@media (max-width: 767px) {
    .crm-platform .workspace { padding-top: 16px !important; }
    .crm-platform .workspace .layout,
    .crm-platform .workspace .p-4,
    .crm-platform .modal-body .p-4 { padding: 16px !important; }
    .crm-platform .workspace .px-4 { padding-inline: 16px !important; }
    .crm-platform .workspace .breadcrumb {
        padding-inline: 4px !important;
        gap: 4px 0;
        flex-wrap: wrap;
        font-size: 13px;
        overflow-wrap: anywhere;
    }
    .crm-platform .crm-page-header .layout { margin-top: 0; border-top: 0; }
    .crm-platform .crm-page-header h1 { font-size: 24px; }
    .crm-platform .crm-page-header small { display: block; margin-top: 6px; }
    .crm-platform .crm-page-header .command-bar {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100%;
        overflow: visible;
        white-space: normal;
        gap: 8px;
        text-align: start;
    }
    .crm-platform .crm-page-header .command-bar > li { max-width: 100%; }
    .crm-platform .crm-page-header .command-bar .btn {
        min-height: 44px;
        padding: 10px 12px;
        border: 1px solid var(--bs-border-color);
        border-radius: 8px;
        white-space: normal;
    }
    .crm-platform .crm-dashboard-intro > .text-end { text-align: start !important; }
    .crm-platform .crm-metrics > * { flex: 0 0 auto; width: 50%; }
    .crm-platform .crm-metric-card { padding: 16px 12px !important; }
    .crm-platform .crm-metric-value { font-size: 23px; overflow-wrap: anywhere; }
    .crm-platform .crm-metric-value > small { font-size: 12px; }
    .crm-platform .workspace fieldset > .col { flex: 0 0 100%; padding-inline: 0 !important; }
    .crm-platform .workspace fieldset > .col > legend { padding-inline: 4px !important; margin-bottom: 16px; }
    .crm-platform .workspace fieldset > .col-md-7 { width: 100%; }
    .crm-platform .form-group.grid { gap: 16px; }
    .crm-platform .form-control,
    .crm-platform .form-select,
    .crm-platform .ts-control { min-height: 44px; max-width: 100%; }
    .crm-platform .input-group, .crm-platform .input-icon { max-width: 100%; }
    .crm-platform .input-icon-addon { min-width: 44px; }
    .crm-platform .form-check { min-height: 32px; }
    .crm-platform .dropdown-menu { max-width: calc(100vw - 32px); }
    .crm-platform [data-controller="filter"] .w-md { width: min(280px, calc(100vw - 48px)); }
    .crm-platform .workspace [data-controller="table"] > footer { gap: 12px; padding-inline: 16px !important; }
    .crm-platform .pagination .page-link { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
    .crm-platform .modal-header,
    .crm-platform .modal-body,
    .crm-platform .modal-footer { padding: 16px; }
    .crm-platform .modal-footer .btn { min-height: 44px; white-space: normal; }
    .crm-platform .crm-auth { padding: 24px 0; }
    .crm-platform .crm-auth-card { padding: 28px 20px; }
    .crm-platform .crm-auth .form-check { display: flex; align-items: center; gap: 8px; }
    .crm-platform .crm-auth .form-check-input { flex-shrink: 0; }
    .crm-platform .crm-auth .row { margin-inline: 0; }
    .crm-platform .crm-auth .row > div { padding-inline: 0; }
}

@media (max-width: 359px) {
    .crm-platform .crm-metrics > * { width: 100%; }
    .crm-platform .crm-menu-toggle span { display: none; }
}

@media (max-height: 600px) and (max-width: 991px) {
    .crm-platform .crm-auth { justify-content: flex-start; }
}

.crm-record-filters { display: flex; flex-wrap: wrap; gap: 16px; }
.crm-record-filters > div { flex: 1 1 180px; min-width: 0; }
.crm-record-filters .crm-filter-search { flex: 2 1 260px; }
.crm-history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.crm-note-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.crm-platform .matrix input { min-width: 0; }
@media (max-width: 767px) {
    .crm-history-grid { grid-template-columns: 1fr; gap: 0; }
    .crm-record-filters > div { flex-basis: 100%; }
    .crm-platform .matrix { display: block; overflow-x: auto; }
    .crm-platform .matrix input[type="email"] { min-width: 190px; }
    .crm-platform .matrix input[type="text"] { min-width: 110px; }
    .crm-platform .matrix .ts-wrapper { min-width: 85px; }
}

.crm-inbox-folders{display:flex;gap:.5rem;flex-wrap:wrap}.crm-inbox-filters{display:flex;gap:.75rem}.crm-discussion-row{display:flex;justify-content:space-between;gap:1rem;padding:1.25rem 0;border-bottom:1px solid #e5e7eb}.crm-discussion-row>div{min-width:0;overflow-wrap:anywhere}.crm-message{padding:1.25rem 0;border-top:1px solid #e5e7eb}.crm-message-note{background:#fffbea;padding:1.25rem;border-radius:.5rem}.crm-message-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65}.crm-mail-frame{width:100%;min-height:24rem;border:1px solid #e5e7eb;margin-top:.75rem}.crm-inbox{min-width:0}@media(max-width:767px){.crm-inbox-filters,.crm-discussion-row{flex-direction:column}.crm-inbox-folders .btn{font-size:.875rem}.crm-message header{font-size:.9375rem}.crm-mail-frame{min-height:18rem}}
