/* ==========================================================================
   Client Request List styles.
   Not in ClientRequestList.razor.css (scoped CSS) because Blazor CSS
   isolation + ::deep does not reliably reach elements rendered by
   third-party Havit.Blazor components (HxGrid, etc.).
   ========================================================================== */
.cr-table-fixed {
    table-layout: fixed;
}

.cr-table-fixed th .hx-grid-header-cell-template {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    min-height: 2.6em;
}

.cr-table-fixed tbody tr {
    height: auto;
}

.cr-table-fixed tbody td {
    vertical-align: middle;
}

.cr-col-date {
    width: 82px;
    white-space: normal;
}

.cr-col-delete {
    width: 37px;
    text-align: center;
}

.cr-col-status {
    width: 115px;
    white-space: normal;
}

.cr-col-status .badge {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    text-align: left;
}

.cr-col-pos {
    width: 80px;
    white-space: normal;
}

.cr-col-tid {
    width: 95px;
    white-space: normal;
}

.cr-col-idno {
    width: 115px;
}

span.cr-col-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td.cr-col-name-td,
td.cr-col-comment,
td.cr-col-partner {
    max-width: 200px;
    width: 200px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

td.cr-col-comment span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cr-col-actions {
    width: 120px;
    white-space: nowrap;
}

/* Client Request List — Split-button category filters */
.cr-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.cr-split-pill .btn {
    border: 1px solid var(--bs-primary);
    background: transparent;
    color: var(--bs-primary);
    font-size: 0.8rem;
    line-height: 1.4;
    padding: 0.2rem 0.5rem;
    transition: background-color 0.15s, color 0.15s;
}

.cr-split-pill .cr-tab-pill-main {
    border-radius: 50rem 0 0 50rem;
    padding-left: 0.6rem;
    cursor: pointer;
    white-space: nowrap;
}

.cr-split-pill .cr-tab-pill-split {
    border-radius: 0 50rem 50rem 0;
    padding: 0.2rem 0.35rem;
    border-left: none;
    cursor: pointer;
}

.cr-split-pill .btn:hover {
    background-color: var(--bs-primary);
    color: #fff;
    opacity: 0.85;
}

.cr-split-pill .btn.active {
    background-color: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}

.cr-split-pill .btn.active + .cr-tab-pill-split {
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.cr-split-pill .dropdown-toggle-split::after {
    vertical-align: 0.2em;
}

/* Dropdown menu */
.cr-split-dropdown {
    font-size: 0.85rem;
    min-width: 10rem;
}

.cr-split-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
}

.cr-split-dropdown .dropdown-item.active,
.cr-split-dropdown .dropdown-item:active {
    background-color: var(--bs-primary);
    color: #fff;
}

/* Status color dot in dropdown */
.cr-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.cr-split-dropdown .dropdown-item.active .cr-dot {
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.cr-partner-filter {
    min-width: 160px;
    max-width: 220px;
}

.two-lines-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal !important;
    word-break: break-word;
    min-height: 3rem;
    max-height: 3rem;
    line-height: 1.5rem;
}

/* ==========================================================================
   Client Request Object Form — vertical side labels, white cards, grey bg
   ========================================================================== */

.dashboard-form {
    background-color: #F0F1F3;
    margin: -1rem;
    margin-top: 0;
    padding: 0.75rem;
    padding-top: 0.5rem;
    flex-grow: 1;
}

.cr-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.cr-card-label {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 6px;
    padding: 0 0 0 4px;
}

.cr-card-body {
    flex: 1;
    background-color: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-left: 3px solid #00bcd4;
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 0;
}

/* Journal table headers — exact match of .form-label from Havit bootstrap.css */
.cr-th-label {
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    color: #6c757d !important;
    background-color: transparent !important;
    border-top: none !important;
    border-bottom: none !important;
    padding: 0.25rem 0.5rem;
}

/* Journal data cells — match form-control value appearance */
.cr-journal-val {
    font-size: 1rem;
    font-weight: 400;
    color: var(--bs-body-color);
    line-height: 1.5;
}

/* Large switch — match form-control height, centered */
.cr-switch-lg {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.cr-switch-lg .form-check {
    min-height: calc(1.5em + 0.75rem + 2px); /* same as .form-control */
    display: flex;
    align-items: center;
}

.cr-switch-lg .form-check-input {
    width: 3em;
    height: 1.5em;
    margin-top: 0;
}

/* Textarea resize */
.cr-resize-vertical {
    resize: vertical;
}

/* Partner field highlight */
.cr-highlight-field .form-control,
.cr-highlight-field .form-select {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
    animation: cr-pulse 1.5s ease-in-out 3;
}

@keyframes cr-pulse {
    0%, 100% { box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25); }
    50% { box-shadow: 0 0 0 0.35rem rgba(255, 193, 7, 0.4); }
}

/* Excel diff highlight */
.excel-diff-changed {
    background-color: #fff3cd;
    border-radius: 4px;
    padding: 2px 4px;
}

/* ==========================================================================
   Status badge colours
   ========================================================================== */
.cr-status-new {
    background-color: transparent;
    color: #212529;
    border: 1px solid #dee2e6;
}

.cr-status-inprogress {
    background-color: #F3E7BF;
    color: #212529;
}

.cr-status-atclient {
    background-color: #B5E51D;
    color: #212529;
}

.cr-status-sentctif {
    background-color: #97D9E9;
    color: #212529;
}

.cr-status-ctifpayment {
    background-color: #00A0E6;
    color: #fff;
}

.cr-status-fiscalized {
    background-color: #28B453;
    color: #fff;
}

.cr-status-onhold {
    background-color: #FEB0C0;
    color: #212529;
}

.cr-status-cancelled {
    background-color: #E8899A;
    color: #212529;
}
