/* Custom application styles — loaded after the Flacto theme */

/* Flacto's core.css shrinks Bootstrap's default grid gutter to 10px of column
   padding each side (20px total between columns). That's fine for dense table/tile
   layouts, but reads as cramped for side-by-side form fields - restore Bootstrap's
   standard 15px/side gutter (30px total) specifically within forms, without
   touching the tighter gutter used elsewhere (tables, dashboard tiles, etc.). */
.form-horizontal .row {
    margin-left: -15px;
    margin-right: -15px;
}

.form-horizontal .row > [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
}

/* Flacto's menu.css sets #topnav .topbar-main .nav > li > a to white text on the
   white topbar background, making the account/login link in _LoginPartial invisible.
   Override with the same dark color the rest of the top nav (.navigation-menu) uses. */
#topnav .topbar-main .menu-extras .nav > li > a {
    color: #435966 !important;
}

/* Flacto's menu.css floats .logo (or, on the auth pages, sets float:none) but never
   established a layout for an icon alongside the wordmark. inline-flex keeps .logo
   an inline-level box either way, so it still floats correctly in the topbar/sidebar
   and still centers correctly via .logo-alt-box's text-align:center on auth pages. */
.logo {
    display: inline-flex !important;
    align-items: center;
}

.logo-mark {
    width: 28px;
    height: 28px;
    margin-right: 8px;
}

.logo-alt-box .logo-mark-lg {
    width: 40px;
    height: 40px;
}

/* Left-hand sidebar navigation (desktop).
   Reuses the same _NavMenu partial as the mobile dropdown in #topnav, which
   stays untouched below the 1025px breakpoint (Flacto's own responsive menu). */
#sidebar-menu {
    display: none;
}

@media (min-width: 1025px) {

    /* Hide the old horizontal top menu; the sidebar replaces it. The slim
       top bar still carries the login/account link on the right. */
    #topnav .topbar-left,
    #topnav .navbar-custom {
        display: none;
    }

    #topnav {
        left: 240px;
    }

    #topnav .container {
        width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }

    #sidebar-menu {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 240px;
        overflow-y: auto;
        background-color: #ffffff;
        box-shadow: 0 1px 2px rgba(67, 89, 102, 0.05);
        z-index: 1030;
    }

    #sidebar-menu .logo {
        display: block;
        float: none;
        margin: 0;
        padding: 20px;
        border-bottom: 1px solid rgba(67, 89, 102, 0.1);
    }

    #sidebar-menu .navigation-menu {
        list-style: none;
        margin: 0;
        padding: 10px 0;
    }

    #sidebar-menu .navigation-menu > li {
        display: block;
        float: none;
    }

    #sidebar-menu .navigation-menu > li > a {
        display: block;
        padding: 12px 20px;
        margin: 0;
        color: #435966;
        border-left: 3px solid transparent;
        transition: all .3s ease;
    }

    #sidebar-menu .navigation-menu > li > a i {
        font-size: 18px;
        margin-right: 10px;
        color: rgba(67, 89, 102, 0.8);
        vertical-align: middle;
    }

    #sidebar-menu .navigation-menu > li > a:hover,
    #sidebar-menu .navigation-menu > li > a:focus {
        color: #57c5a5;
        background-color: rgba(87, 197, 165, 0.08);
        border-left-color: #57c5a5;
    }

    #sidebar-menu .navigation-menu > li > a:hover i,
    #sidebar-menu .navigation-menu > li > a:focus i {
        color: #57c5a5;
    }

    .wrapper {
        margin-left: 240px;
    }

    .footer {
        left: 240px;
    }
}

/* ---------------------------------------------------------------------------
   Forms
   Shared look for admin data-entry forms: labeled sections, compact rows,
   chip-style checkboxes/radios, Select2 multi-selects, tag inputs, and a
   sticky Save/Cancel bar. See wwwroot/js/forms.js for the matching behavior.
   --------------------------------------------------------------------------- */

.form-section {
    padding-bottom: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(67, 89, 102, 0.1);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #435966;
    margin: 0 0 4px;
}

.form-section-hint {
    color: #98a6ad;
    font-size: 13px;
    margin: 0 0 16px;
}

.form-horizontal .form-group > label,
.form-horizontal .form-group > .control-label-text {
    display: block;
    font-weight: 600;
    color: #435966;
    margin-bottom: 6px;
}

.form-horizontal .form-group > label.required::after,
.form-horizontal .form-group > .control-label-text.required::after {
    content: " *";
    color: #f05050;
}

.form-help {
    display: block;
    color: #98a6ad;
    font-size: 12px;
    margin-top: 4px;
}

/* Flacto keeps inputs grey even while focused (background !important) - make
   the field being typed in stand out, using the theme's accent color. */
.form-horizontal .form-control:focus {
    background-color: #ffffff !important;
    border-color: #57c5a5;
    box-shadow: 0 0 0 3px rgba(87, 197, 165, 0.15);
}

.form-horizontal .input-group-addon {
    background-color: #eef1f3;
    border-color: #cfcfcf;
    color: #6c7a83;
}

/* Field errors show next to their field; the top summary only appears for errors that
   don't belong to a single field (asp-validation-summary="ModelOnly"). */
.validation-summary-valid {
    display: none;
}

.field-validation-error {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

.input-validation-error,
.input-validation-error:focus {
    border-color: #f05050 !important;
}

/* Chip checkboxes/radios - a one-click alternative to Ctrl+click multi-selects
   for short, fixed option lists (platforms, deliverable types). */
.chip-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-group input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip-group label {
    margin: 0;
    padding: 7px 14px;
    border: 1px solid #cfcfcf;
    border-radius: 20px;
    background-color: #f5f5f5;
    color: #565656;
    font-weight: 400;
    cursor: pointer;
    user-select: none;
    transition: all .15s ease;
}

.chip-group label:hover {
    border-color: #57c5a5;
}

.chip-group input:checked + label {
    background-color: rgba(87, 197, 165, 0.15);
    border-color: #57c5a5;
    color: #2f8f73;
    font-weight: 600;
}

.chip-group input:focus-visible + label {
    box-shadow: 0 0 0 3px rgba(87, 197, 165, 0.3);
}

/* Select2 4.0.1 (bundled with Flacto) - match .form-control's size and colors. */
.select2-container--default .select2-selection--multiple {
    min-height: 38px;
    padding: 2px 6px;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
    background-color: #f5f5f5;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    background-color: #ffffff;
    border: 1px solid #57c5a5;
    box-shadow: 0 0 0 3px rgba(87, 197, 165, 0.15);
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin: 4px 4px 0 0;
    padding: 3px 10px;
    border: 1px solid #57c5a5;
    border-radius: 14px;
    background-color: rgba(87, 197, 165, 0.15);
    color: #2f8f73;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    margin-right: 6px;
    color: #2f8f73;
}

.select2-container--default .select2-search--inline .select2-search__field {
    margin-top: 6px;
    color: #565656;
}

.select2-dropdown {
    border-color: #57c5a5;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #57c5a5;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: rgba(87, 197, 165, 0.15);
}

/* bootstrap-tagsinput - same idea, for free-text lists (cities, ZIPs). */
.bootstrap-tagsinput {
    display: block;
    width: 100%;
    min-height: 38px;
    padding: 4px 6px;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
    background-color: #f5f5f5;
    box-shadow: none;
}

.bootstrap-tagsinput.focus {
    background-color: #ffffff;
    border-color: #57c5a5;
    box-shadow: 0 0 0 3px rgba(87, 197, 165, 0.15);
}

.bootstrap-tagsinput input {
    width: 8em;
    padding: 4px 2px;
}

.bootstrap-tagsinput .tag {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 4px 10px;
    border: 1px solid #57c5a5;
    border-radius: 14px;
    background-color: rgba(87, 197, 165, 0.15);
    color: #2f8f73;
    font-size: 13px;
    font-weight: 400;
}

.bootstrap-tagsinput .tag [data-role="remove"] {
    margin-left: 6px;
    cursor: pointer;
}

.bootstrap-tagsinput .tag [data-role="remove"]::after {
    content: "\00d7";
}

/* "Show more" toggle for rarely-needed fields (e.g. lat/long overrides). */
.form-toggle {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 13px;
    color: #57c5a5;
    cursor: pointer;
}

/* Save/Cancel stay reachable at the bottom of the screen on long forms. */
.form-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin: 24px -20px -20px;
    padding: 12px 20px;
    border-top: 1px solid rgba(67, 89, 102, 0.1);
    border-radius: 0 0 5px 5px;
    background-color: #ffffff;
}

.form-actions .form-actions-secondary {
    margin-right: auto;
}

.form-actions .form-actions-secondary form {
    display: inline;
}

/* Global search in the top bar (Views/Shared/_GlobalSearch.cshtml, wwwroot/js/search.js). */
.global-search {
    position: relative;
    float: left;
    margin: 15px 0 15px 10px;
}

.global-search .zmdi-search {
    position: absolute;
    left: 12px;
    top: 8px;
    color: rgba(67, 89, 102, 0.6);
    pointer-events: none;
}

.global-search .form-control {
    width: 320px;
    height: 32px;
    padding-left: 32px;
    border-radius: 16px;
    background: #f5f5f5;
    box-shadow: none;
    font-size: 13px;
}

.global-search .form-control:focus {
    background: #ffffff;
}

.global-search-results {
    position: absolute;
    top: 38px;
    left: 0;
    width: 460px;
    max-height: 70vh;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e3e8eb;
    border-radius: 4px;
    box-shadow: 0 6px 20px rgba(67, 89, 102, 0.15);
    z-index: 1050;
    padding: 6px 0;
}

.global-search-group {
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #98a6ad;
}

.global-search-item {
    display: block;
    padding: 6px 14px;
    color: #435966;
}

.global-search-item:hover,
.global-search-item:focus,
.global-search-item.active {
    background: #f1f5f7;
    color: #435966;
    text-decoration: none;
}

.global-search-title {
    display: block;
    font-weight: 600;
}

.global-search-subtitle {
    display: block;
    font-size: 12px;
    color: #98a6ad;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-all,
.global-search-empty {
    display: block;
    padding: 8px 14px;
    border-top: 1px solid #eef1f3;
    margin-top: 6px;
    font-size: 13px;
}

.global-search-empty {
    border-top: none;
    margin-top: 0;
    color: #98a6ad;
}

@media (max-width: 1024px) {
    /* One row below the desktop sidebar breakpoint: logo mark (no wordmark), search, account, menu. A taller top bar would
       cover the page heading - #topnav is fixed and the page below assumes its normal height. */
    #topnav .topbar-left .logo > span {
        display: none;
    }

    .global-search {
        margin: 14px 0 14px 8px;
    }

    .global-search .form-control {
        width: calc(100vw - 205px);
        max-width: 260px;
    }

    .global-search-results {
        position: fixed;
        top: 60px;
        left: 8px;
        right: 8px;
        width: auto;
    }
}

/* Record pages (Brand first): a header with the name, status, key facts, and main action; the
   details and key contact in a right-hand rail; everything else in tabs (forms.js data-record-tabs).
   On a phone the rail stacks above the tabs and the tabs scroll sideways. */
.record-header {
    margin-bottom: 20px;
}

.record-back {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    color: #98a6ad;
}

.record-back:hover {
    color: #435966;
}

.record-header-main {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px 20px;
}

.record-header .page-title {
    margin: 4px 0 8px;
    line-height: 1.3;
}

.record-header .page-title .label {
    font-size: 11px;
    vertical-align: middle;
    margin-left: 6px;
}

.record-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    font-size: 13px;
    color: #6c7a80;
}

.record-facts a {
    color: #435966;
}

.record-facts .zmdi {
    margin-right: 4px;
}

.record-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.record-alert {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    background: #fff4e0;
    color: #9a5b00;
    font-size: 12px;
    font-weight: 600;
}

a.record-alert:hover {
    background: #ffe9c2;
    color: #9a5b00;
}

.record-alert-danger {
    background: #fdecea;
    color: #b3261e;
}

.record-actions {
    padding-top: 4px;
}

.record-card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.record-card-title .header-title {
    margin-bottom: 0;
}

.record-description {
    color: #435966;
    margin-bottom: 12px;
}

.record-fields {
    margin-bottom: 0;
}

.record-fields dt {
    margin-top: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #98a6ad;
}

.record-fields dt:first-child {
    margin-top: 0;
}

.record-fields dd {
    margin: 2px 0 0;
    color: #435966;
}

.record-links a,
.record-links span {
    margin-right: 12px;
}

/* Bootstrap's yellow is too light on the grey card for text like "Not signed". */
.record-fields .text-warning {
    color: #9a5b00;
}

.record-edit {
    border-top: 3px solid #4fc6a7;
}

.record-edit,
.record-tabs {
    scroll-margin-top: 80px;
}

/* The active tab joins the pane's card - one frame, not Flacto's tab box around a card. */
.record-tabs .nav-tabs {
    border-bottom: none;
}

.record-tabs .nav-tabs > li {
    margin-bottom: -1px;
}

.record-tabs .nav-tabs > li > a {
    margin-right: 2px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 5px 5px 0 0;
    color: #6c7a80;
}

.record-tabs .nav-tabs > li.active > a,
.record-tabs .nav-tabs > li.active > a:hover,
.record-tabs .nav-tabs > li.active > a:focus {
    background: #f5f5f5;
    color: #435966;
    font-weight: 600;
    border: 1px solid #dcdcdc;
    border-bottom-color: #f5f5f5;
}

.record-tabs .tab-content {
    padding: 0;
    border: none;
}

.record-tabs .badge {
    background: #e3e8eb;
    color: #435966;
    font-weight: 600;
    margin-left: 2px;
}

.record-tabs .badge-attention {
    background: #f5a623;
    color: #ffffff;
}

.record-tabs .tab-pane > .card-box {
    border-top-left-radius: 0;
}

/* The tab already says what the pane is; its own heading would repeat it (its buttons stay). */
.record-tabs .tab-pane[data-hide-title] > .card-box .header-title:first-of-type {
    display: none;
}

@media (max-width: 767px) {
    .record-tabs .nav-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .record-tabs .nav-tabs > li {
        float: none;
    }

    .record-actions {
        width: 100%;
    }
}

/* The Opportunity board (CampaignOpportunities/Edit): the Brand, then each Store with its Creators.
   Every party carries a Lead / Store / Creator tag and whether they've agreed. */
.board-party {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.board-party-kind {
    flex: 0 0 56px;
    padding-top: 2px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #98a6ad;
}

.board-party-main {
    flex: 1 1 auto;
    min-width: 0;
}

.board-party-name {
    font-weight: 600;
    font-size: 15px;
    margin-right: 4px;
}

.board-party-meta {
    font-size: 13px;
    margin-top: 2px;
}

.board-party-actions {
    flex: 0 0 auto;
    text-align: right;
}

.board-store {
    border-top: 1px solid #e3e8eb;
    margin-top: 16px;
    padding-top: 16px;
}

.board-dropped {
    opacity: 0.6;
}

.board-why,
.board-form,
.board-creators,
.board-add {
    margin: 10px 0 0 68px;
}

.board-creators {
    width: calc(100% - 68px);
}

.board-creators .label {
    font-size: 10px;
}

.board-creators input[name=estimatedRate] {
    min-width: 64px;
}

.opportunity-todo {
    padding-left: 18px;
    margin-bottom: 12px;
}

.opportunity-todo li {
    margin-bottom: 4px;
}

/* The Campaign Brief's Creator lists have no header row, so drop the rule above the first one. */
.brief-people > tbody > tr:first-child > td {
    border-top: 0;
}

@media (max-width: 767px) {
    .board-party {
        flex-wrap: wrap;
    }

    .board-party-kind {
        flex-basis: 100%;
    }

    .board-why,
    .board-form,
    .board-creators,
    .board-add {
        margin-left: 0;
    }

    .board-creators {
        width: 100%;
        display: block;
        overflow-x: auto;
    }
}

/* AisleProcessor's log (Processor/_Live, Processor/_JobLog): one line per entry, newest kept in view. */
.processor-log {
    max-height: 420px;
    overflow-y: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.6;
    word-break: break-word;
}

.processor-log .label {
    font-family: inherit;
    font-weight: normal;
}

/* ---------------------------------------------------------------------------
   Shared UI: the menu's sections, page intros, the list toolbar and pager (_ListToolbar, _ListPager), the
   dashboard's "Needs you", research panels, the Creators tab, edit modals (forms.js), and small helpers.
   --------------------------------------------------------------------------- */

/* The menu: section headings, and the page you're on. */
.navigation-menu > li.nav-section {
    padding: 14px 20px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #98a6ad;
}

@media (min-width: 1025px) {
    #sidebar-menu .navigation-menu > li.active > a {
        color: #57c5a5;
        background-color: rgba(87, 197, 165, 0.1);
        border-left-color: #57c5a5;
        font-weight: 600;
    }

    #sidebar-menu .navigation-menu > li.active > a i {
        color: #57c5a5;
    }

    #sidebar-menu .navigation-menu > li > a {
        padding-top: 9px;
        padding-bottom: 9px;
    }
}

@media (max-width: 1024px) {
    #topnav .navigation-menu > li.nav-section {
        padding: 10px 20px 2px;
    }

    #topnav .navigation-menu > li.active > a {
        color: #57c5a5;
    }
}

/* What the last action did (_Flash). */
.alert-flash {
    white-space: pre-line;
}

.page-intro {
    max-width: 900px;
    margin: -6px 0 16px;
}

/* Lists: toolbar, count, sortable headings, pager. */
.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.list-toolbar-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.list-toolbar-form .form-control {
    width: auto;
}

.list-search {
    position: relative;
}

.list-search .zmdi-search {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #98a6ad;
    pointer-events: none;
}

.list-toolbar-form .list-search .form-control {
    width: 300px;
    padding-left: 30px;
}

.list-count {
    margin: 4px 0 12px;
    font-size: 13px;
}

.list-sort,
.list-sort:hover,
.list-sort:focus {
    color: inherit;
    white-space: nowrap;
}

.list-sort.is-sorted {
    color: #57c5a5;
}

.list-table > tbody > tr > td {
    vertical-align: middle;
}

.list-pager {
    margin: 10px 0 0;
}

@media (max-width: 767px) {
    .list-toolbar,
    .list-toolbar-form,
    .list-search {
        width: 100%;
    }

    .list-toolbar-form .list-search .form-control,
    .list-toolbar-form select.form-control {
        width: 100%;
    }
}

/* The dashboard: "Needs you" first, then the counts. */
.needs-you {
    list-style: none;
    margin: 0;
    padding: 0;
}

.needs-you > li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid rgba(67, 89, 102, 0.08);
}

.needs-you > li:first-child {
    border-top: none;
    padding-top: 0;
}

.needs-you-icon {
    font-size: 18px;
    width: 20px;
    color: #98a6ad;
    margin-top: 2px;
}

.needs-you-body {
    flex: 1;
    min-width: 0;
}

.needs-you-body .label {
    margin-right: 4px;
}

.needs-you-when {
    font-size: 12px;
    white-space: nowrap;
}

.dashboard-tile {
    display: block;
    text-align: center;
}

.dashboard-tile h2 {
    margin: 0;
}

.dashboard-tile p {
    margin: 0;
}

/* Research panels (Brand, Store Lead, Creator Lead, Creators tab): title and status on the left, the run's
   action on the right. */
.research-panel-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px 16px;
    margin-bottom: 12px;
}

.research-panel-head .header-title {
    margin-bottom: 4px;
}

.research-panel-head .header-title small {
    font-size: 13px;
    font-weight: normal;
    text-transform: none;
}

.research-panel-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.inline-form {
    display: inline;
}

.finding-quote {
    margin-bottom: 5px;
    padding: 4px 10px;
    font-size: 13px;
    word-break: break-word;
}

/* The Creators tab's lower half. */
.nearby-section + .nearby-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(67, 89, 102, 0.08);
}

.nearby-section h5 {
    margin-top: 0;
    font-weight: 600;
}

.radius-input {
    width: 70px !important;
}

.found-for > li + li {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(67, 89, 102, 0.08);
}

/* The Opportunity board: one next step per Store, the rest in its menu. */
.board-menu .dropdown-form-button {
    display: block;
    width: 100%;
    padding: 3px 20px;
    border: 0;
    background: none;
    text-align: left;
    white-space: nowrap;
}

.board-menu .dropdown-form-button:hover,
.board-menu .dropdown-form-button:focus {
    background-color: #f5f5f5;
}

.board-creators .col-creator { width: 28%; }
.board-creators .col-rate { width: 11%; }
.board-creators .col-agreed { width: 10%; }
.board-creators .col-actions { width: 13%; }

/* Field widths, instead of inline styles. */
.input-wide {
    width: 100%;
    max-width: 360px;
}

.input-medium {
    width: 100%;
    max-width: 280px;
}

.input-fee {
    width: 80px !important;
}

.pre-line {
    white-space: pre-line;
}

.pre-wrap {
    white-space: pre-wrap;
}

.nowrap {
    white-space: nowrap;
}

/* A record's edit form, in a modal (forms.js builds it around [data-edit-panel]): the page stays where it was, a
   long form scrolls inside it, and Save stays in view at the bottom. */
.record-edit-modal .modal-content {
    border-top: 3px solid #4fc6a7;
}

.record-edit-modal .modal-body {
    max-height: calc(100vh - 210px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* The panel's own padding balances the form rows' negative margins (as the card it was). */
.record-edit-modal .record-edit {
    border-top: none;
    margin: 0;
    padding: 0 15px;
    box-shadow: none;
}

.record-edit-modal .modal-footer .form-actions {
    position: static;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}

@media (max-width: 767px) {
    .record-edit-modal .modal-dialog {
        margin: 0;
    }

    .record-edit-modal .modal-content {
        border-radius: 0;
    }

    .record-edit-modal .modal-body {
        max-height: calc(100vh - 150px);
    }
}

/* On a phone, any table in a card scrolls sideways rather than squeezing its columns or the page. */
@media (max-width: 767px) {
    .card-box table.table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
}

/* Record tabs stay one row at every width - a page with many (a Brand's seven) scrolls them sideways rather than
   wrapping a second row under the first. */
.record-tabs .nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
}

.record-tabs .nav-tabs > li {
    float: none;
    flex: 0 0 auto;
}

.record-tabs .nav-tabs > li > a {
    padding: 10px 13px;
}

.record-tabs .nav-tabs .badge-zero {
    display: none;
}


/* Summaries: written updates, like emails - one card each, opening to its text. */
.summary {
    border-left: 3px solid #4fc6a7;
    padding-top: 14px;
    padding-bottom: 14px;
}

.summary-claude {
    border-left-color: #8b6bd6;
}

.summary-chatgpt {
    border-left-color: #10a37f;
}

.summary-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 16px;
    cursor: pointer;
}

.summary-subject {
    font-weight: 600;
    color: #435966;
}

.summary-meta {
    font-size: 12px;
}

.summary-body {
    margin-top: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    color: #435966;
}

/* A Creator Lead's social accounts. */
.social-accounts > li {
    padding: 4px 0;
}

.social-accounts .label {
    margin-left: 4px;
}

/* How many need attention, on the menu (NavAttention). */
.navigation-menu .nav-count {
    display: inline-block;
    min-width: 20px;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 10px;
    background: #f5a623;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    vertical-align: middle;
}

@media (min-width: 1025px) {
    #sidebar-menu .navigation-menu > li > a {
        position: relative;
    }

    #sidebar-menu .navigation-menu .nav-count {
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
    }
}

/* Discovery Jobs: a row being approved or deleted, and the note that says what happened. */
.job-working {
    opacity: .5;
}

.job-note {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1050;
    max-width: 360px;
    padding: 10px 14px;
    border-radius: 6px;
    background: #435966;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}

.job-note-failed {
    background: #f05050;
}

/* Scores (_ScoreCard, and the badges on lists and the Opportunity board). */
.score-total {
    margin-bottom: 12px;
}

.score-number {
    font-size: 32px;
    font-weight: 600;
    color: #435966;
    line-height: 1;
}

.score-parts > li + li {
    margin-top: 10px;
}

.score-part-head {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.score-part-points {
    color: #6c7a80;
    white-space: nowrap;
}

.score-bar {
    height: 4px;
    margin: 3px 0 2px;
    border-radius: 2px;
    background: rgba(67, 89, 102, 0.1);
}

.score-bar > span {
    display: block;
    height: 100%;
    border-radius: 2px;
    background: #4fc6a7;
}

.score-badge {
    display: inline-block;
    min-width: 28px;
    text-align: center;
}

.score-strong { background: #4fc6a7; }
.score-good { background: #5d9cec; }
.score-fair { background: #f5a623; }
.score-weak { background: #98a6ad; }

a.score-badge,
a.score-badge:hover,
a.score-badge:focus {
    color: #ffffff;
}

.board-suggest {
    display: block;
    white-space: nowrap;
}

/* Discovery Jobs: tick rows, then approve or delete them together. */
.job-pick { width: 32px; }
.job-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 10px; border-radius: 4px; background: #f3f6f9; }
.job-bulk[hidden] { display: none; }
.job-bulk-count { font-weight: 600; margin-right: 4px; }

/* ===== App on a phone (specs/03-features/mobile-app/spec.md) =====
   The update bar, the bottom tab bar, the Today page, and phone-sized touch targets. Desktop is unchanged. */
.app-update { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 1100;
              display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
              border-radius: 10px; background: #2b3d51; color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.app-update[hidden] { display: none; }
.app-update .btn { font-weight: 600; }
.app-tabs { display: none; }

@media (max-width: 767px) {
    body.has-app-tabs { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    body.has-app-tabs .app-update { bottom: calc(76px + env(safe-area-inset-bottom)); }
    body.has-app-tabs .footer { display: none; }

    .app-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; background: #fff;
                border-top: 1px solid #e3e8ed; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0,0,0,.05); }
    .app-tabs > a, .app-tabs > button { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
                min-height: 58px; padding: 6px 2px; border: 0; background: none; color: #7b8a99; font-size: 11px; text-decoration: none; }
    .app-tabs i { font-size: 22px; line-height: 1; margin-bottom: 3px; }
    .app-tabs > a.active { color: #57c5a5; font-weight: 600; }
    .app-tab-count { position: absolute; top: 4px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px;
                     border-radius: 9px; background: #f9a825; color: #fff; font-size: 10px; font-weight: 700; line-height: 18px; text-align: center; }

    /* Thumb-sized controls. */
    .btn { min-height: 40px; }
    .btn-sm, .btn-xs { min-height: 34px; }
    .form-control { min-height: 42px; font-size: 16px; } /* 16px keeps iOS from zooming into a field */
    .record-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
    .record-actions > .btn, .record-actions > a.btn { flex: 1 1 45%; }
}

/* Today */
.today { max-width: 640px; margin: 0 auto; }
.today-head { display: flex; align-items: baseline; justify-content: space-between; }
.today-desktop-link { font-size: 13px; }
.today-search { position: relative; margin: 6px 0 16px; }
.today-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #98a6ad; font-size: 18px; }
.today-search .form-control { height: 48px; padding-left: 40px; border-radius: 24px; font-size: 16px; }
.today-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.today-actions a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
                   min-height: 84px; padding: 10px 6px; border-radius: 12px; background: #fff; border: 1px solid #e8edf1;
                   color: #435966; font-size: 13px; text-align: center; text-decoration: none; }
.today-actions a:active { background: #eef8f5; }
.today-actions i { font-size: 24px; color: #57c5a5; }
.today-action-count { position: absolute; top: 8px; right: 8px; font-style: normal; font-size: 11px; font-weight: 700;
                      background: #f9a825; color: #fff; border-radius: 9px; padding: 1px 6px; }
.today-section { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #98a6ad; }
.today-empty { color: #98a6ad; margin-bottom: 22px; }
.today-list { background: #fff; border: 1px solid #e8edf1; border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
.today-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; color: #435966; text-decoration: none; }
.today-row + .today-row { border-top: 1px solid #eef2f5; }
a.today-row:active, .today-row-main:active { background: #f3f8f6; }
.today-row-icon { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center;
                  border-radius: 50%; background: #eef8f5; color: #57c5a5; font-size: 16px; }
.today-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.today-row-body strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-row-body small { color: #98a6ad; }
.today-row-go { color: #c2ccd4; font-size: 20px; }
.today-row-split { padding: 0; }
.today-row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: #435966; text-decoration: none; }
.today-row-call { flex: none; display: flex; align-items: center; justify-content: center; width: 56px; align-self: stretch;
                  border-left: 1px solid #eef2f5; color: #57c5a5; font-size: 20px; }

/* Social accounts card - the same on every record page (ViewComponents/SocialAccountsViewComponent). */
.social-list { margin: 0; }
.social-row { padding: 8px 0; border-bottom: 1px solid #eef2f5; }
.social-row:last-child { border-bottom: 0; }
.social-row-main { display: flex; align-items: flex-start; gap: 10px; }
.social-icon { font-size: 20px; width: 22px; text-align: center; color: #57c5a5; margin-top: 2px; }
.social-row-body { flex: 1; min-width: 0; word-break: break-word; }
.social-platform { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: #98a6ad; }
.social-edit { margin-left: 32px; }
.social-edit > summary, .social-add > summary { list-style: none; cursor: pointer; display: inline-block; }
.social-edit > summary::-webkit-details-marker, .social-add > summary::-webkit-details-marker { display: none; }
.social-edit[open] > summary { color: #98a6ad; }
.social-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.social-form .form-control { flex: 1 1 140px; width: auto; }
.social-form input[type=number] { flex: 0 1 110px; }
.social-add { margin-top: 8px; }

/* Opportunity board: "Find any creator" next to the nearby list. */
.board-add-any { margin-top: 6px; }
.board-add-any-pick { display: inline-block; width: 320px; max-width: 100%; vertical-align: middle; }
@media (max-width: 767px) { .board-add-any-pick { width: 100%; margin-bottom: 6px; } }

/* What a menu number means, on the list it opens (_AttentionNote). */
.attention-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 12px;
                  border-radius: 6px; background: #fff8e6; border: 1px solid #f9e2a7; color: #6b5a2a; }
.attention-note-on { background: #fff3d6; }
.attention-note i { color: #f9a825; font-size: 18px; }
.attention-note-link { margin-left: auto; font-weight: 600; white-space: nowrap; }
.attention-row { margin-left: 4px; font-weight: 500; }
.list-note { margin: -4px 0 10px; }

/* Maps on record pages (_Map, map.js). */
.record-map { height: 220px; border-radius: 6px; overflow: hidden; background: #e8eef2; z-index: 0; }
.map-pin { color: #e8505b; font-size: 28px; line-height: 28px; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
@media (max-width: 767px) { .record-map { height: 200px; } }

.record-map-tall { height: 340px; }
@media (max-width: 767px) { .record-map-tall { height: 260px; } }

/* Phone: quick actions under a record's name, and the work (tabs) before the side panel. */
.phone-actions { display: none; }
.score-more > summary { display: none; }
@media (max-width: 767px) {
    .phone-actions { display: flex; gap: 8px; overflow-x: auto; margin: 4px -4px 14px; padding: 2px 4px 6px;
                     scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .phone-actions::-webkit-scrollbar { display: none; }
    .phone-action { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
                    min-width: 72px; min-height: 64px; padding: 8px 10px; border-radius: 12px; background: #fff; border: 1px solid #e8edf1;
                    color: #435966; font-size: 12px; text-decoration: none; }
    .phone-action:active { background: #eef8f5; }
    .phone-action i { font-size: 22px; color: #57c5a5; }

    /* The tabs (Activity, Opportunities...) come first; the score, details, map, and accounts follow. */
    .row-tasks { display: flex; flex-direction: column; }
    .row-tasks > .record-rail { order: 2; }
    .row-tasks > [class*="col-lg-8"] { order: 1; }

    /* Record header actions: the phone buttons cover them; keep the main one. */
    .record-header .record-actions > .btn-default { display: none; }

    .score-more > summary { display: list-item; cursor: pointer; color: #57c5a5; margin-top: 6px; }
}

/* Opportunity board on a phone: each creator a card (name, then rate and agreed side by side, then Save/Remove),
   and the add forms one tidy block. */
@media (max-width: 767px) {
    .board-creators thead { display: none; }
    .board-creators, .board-creators tbody { display: block; width: 100%; }
    .board-creators tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 10px 0; border-top: 1px solid #eef2f5; }
    .board-creators td { display: block; border: 0 !important; padding: 0 !important; }
    .board-creators td.hidden-xs { display: none; }
    .board-creators td:nth-child(1) { grid-column: 1 / -1; }
    .board-creators td:nth-child(3)::before { content: "Rate"; display: block; font-size: 11px; color: #98a6ad; text-transform: uppercase; }
    .board-creators td:nth-child(4)::before { content: "Agreed"; display: block; font-size: 11px; color: #98a6ad; text-transform: uppercase; }
    .board-creators td:nth-child(5) { grid-column: 1 / -1; text-align: left !important; }
    .board-creators td:nth-child(5) .btn { min-height: 36px; padding: 6px 14px; }
    .board-creators td:nth-child(5) .btn-default { min-width: 96px; }

    .board-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    .board-add > select, .board-add-any-pick { flex: 1 1 100%; width: 100% !important; margin: 0 !important; }
    .board-add .input-group { flex: 1 1 45%; width: auto; }
    .board-add > label { margin: 0 !important; }
    .board-add > .btn { margin: 0 !important; min-width: 72px; }
}

/* An Open Opportunity's stage (_OpportunityStage). */
.stage-label { font-weight: 600; }
.stage-discovery { background: #eef2f5; color: #5b6b78; }
.stage-call { background: #fff3d6; color: #8a6d1d; }
.stage-ready { background: #57c5a5; color: #fff; }

/* "Install app" - the Today card and the iPhone instructions (pwa.js). */
.install-card { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; padding: 12px; border-radius: 12px;
                background: #fff; border: 1px solid #cfeee4; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.install-card[hidden] { display: none; }
.install-card img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.install-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.install-card-body small { color: #98a6ad; }
.install-card-close { border: 0; background: none; font-size: 22px; line-height: 1; color: #98a6ad; padding: 0 4px; }
.install-help { position: fixed; inset: 0; z-index: 1200; background: rgba(20,30,40,.45); display: flex; align-items: flex-end; justify-content: center; }
.install-help[hidden] { display: none; }
.install-help-sheet { width: 100%; max-width: 480px; background: #fff; border-radius: 16px 16px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
.install-help-sheet ol { padding-left: 20px; line-height: 1.6; }
.install-share { display: inline-flex; vertical-align: middle; color: #2f80ed; }
@media (min-width: 768px) { .install-help { align-items: center; } .install-help-sheet { border-radius: 16px; } }

.navigation-menu li[data-install][hidden] { display: none !important; }

/* Phone menu: it drops down from the fixed top bar, so it has to scroll itself - otherwise the bottom of the list
   (System: AisleProcessor, Discovery Jobs, ...) runs off the screen, under the tab bar, out of reach. */
@media (max-width: 1024px) {
    #navigation.open, #navigation[style*="block"] {
        max-height: calc(100vh - 65px);
        max-height: calc(100dvh - 65px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}
@media (max-width: 767px) {
    body.has-app-tabs #navigation.open, body.has-app-tabs #navigation[style*="block"] {
        max-height: calc(100vh - 65px - 64px - env(safe-area-inset-bottom));
        max-height: calc(100dvh - 65px - 64px - env(safe-area-inset-bottom));
        padding-bottom: 8px;
    }
}

/* The longest tab label fits on narrow phones. */
@media (max-width: 767px) { .app-tab-long { font-size: 10px; letter-spacing: -.01em; white-space: nowrap; } }
@media (max-width: 360px) { .app-tab-long { font-size: 9px; } }

/* Discovery Jobs: search and filters on the Store Lead check list. */
.job-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.job-filter input[type=search] { flex: 1 1 220px; width: auto; }
.job-filter select { flex: 0 1 170px; width: auto; }
@media (max-width: 767px) { .job-filter select { flex: 1 1 45%; } }

/* Store Lead: "Real and open" confidence (StoreLeadOpenness) and "Found something yourself?". */
.openness { border-radius: 8px; padding: 10px 12px; margin: 4px 0 12px; border: 1px solid #e3e8ed; background: #f8fafb; }
.openness-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.openness-verdict { font-weight: 700; font-size: 15px; }
.openness-total { font-size: 20px; font-weight: 700; }
.openness-total small { font-size: 12px; color: #98a6ad; font-weight: 400; }
.openness-open { border-color: #bfe8da; background: #f1faf6; } .openness-open .openness-verdict { color: #2f9c7d; }
.openness-likely { border-color: #d6ecf7; background: #f3f9fd; } .openness-likely .openness-verdict { color: #3a8dbd; }
.openness-unclear .openness-verdict { color: #8a6d1d; }
.openness-closed { border-color: #f3c8cb; background: #fdf3f4; } .openness-closed .openness-verdict { color: #c8434d; }
.openness-why > summary, .found-more > summary { cursor: pointer; color: #57c5a5; }
.openness-why li { margin-top: 6px; }
.openness-why li span { color: #5b6b78; }

/* A lead that became a Store or Creator: kept for reference, read-only (_ConvertedNote; the server refuses changes too). */
.converted-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; padding: 12px 14px;
                  border-radius: 8px; background: #eef4f8; border: 1px solid #d3e2ec; color: #3d5566; }
.converted-note > i { font-size: 20px; color: #5b87a4; }
.converted-note > div { flex: 1 1 260px; }
.record-readonly .wrapper form:not([role="search"]),
.record-readonly [data-edit-open],
.record-readonly .record-edit,
.record-readonly .social-edit,
.record-readonly .social-add,
.record-readonly .found-more,
.record-readonly .phone-actions [data-phone-log],
.record-readonly .record-header .record-actions { display: none !important; }

/* Dashboard: "I want to..." (_IWantTo) - one wide tile per action, two across on a desk, stacked on a phone. */
.iwant-title { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.iwant-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.iwant-tile { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; margin-bottom: 20px; border-left: 3px solid #57c5a5; }
.iwant-text { margin: 0; font-weight: 600; font-size: 15px; }
.iwant-text .zmdi { color: #57c5a5; margin-right: 4px; }
.iwant-controls { display: flex; align-items: center; gap: 8px; }
.iwant-kind { width: auto; flex: 0 0 auto; }
.iwant-pick { flex: 1 1 auto; min-width: 0; }
.iwant-controls .btn { flex: 0 0 auto; }
@media (max-width: 991px) {
    .iwant-tiles { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
    .iwant-controls { flex-wrap: wrap; }
    .iwant-kind { flex: 1 1 100%; }
    .iwant-pick { flex: 1 1 100%; }
    .iwant-controls .btn { width: 100%; }
}
@media (max-width: 767px) {
    /* The name picker as tall as the thumb-sized select beside it. */
    .iwant .select2-container .select2-selection--single { height: 42px; }
    .iwant .select2-container .select2-selection--single .select2-selection__rendered { line-height: 40px; font-size: 16px; }
    .iwant .select2-container .select2-selection--single .select2-selection__arrow { height: 40px; }
}
