/* ── DRCPL CSS variable overrides ── */
:root {
    --logix-accent:       #0078d4;
    --logix-accent-dark:  #005a9e;
    --logix-accent-light: #93c5fd;
    --logix-header-bg:    #cfe8ff;
    --logix-thead-bg:     #bfdbfe;
    --logix-thead-text:   #1e40af;
    --logix-title:        #1e3a5f;
    --logix-sub:          #2563eb;
    --logix-page-bg:      #f5f6fa;
    --logix-sidebar-bg:   #0f1117;
    --logix-input-border: #93c5fd;
}

/* ── Blazor error boundary ── */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ── Syncfusion grid fixes (Bootstrap 5 theme) ── */
.e-grid .e-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    table-layout: fixed !important;
}

.e-grid .e-rowcell,
.e-grid .e-headercell,
.e-grid .e-filterbarcell {
    border-right: 1px solid #d1d5db !important;
    border-bottom: 1px solid #d1d5db !important;
}

.e-grid .e-rowcell {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ── Grid viewport fill ── */
.e-grid {
    height: calc(100vh - 185px) !important;
}

    .e-grid .e-gridcontent {
        overflow-y: auto !important;
    }

/* ── Form inputs ── */
.form-row input,
.form-row select,
.form-row textarea {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    color: #1a1a1a;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

    .form-row input:focus,
    .form-row select:focus,
    .form-row textarea:focus {
        background: #ffffff;
        border-color: #0078d4;
        box-shadow: 0 0 0 3px rgba(0,120,212,0.12);
        outline: none;
    }

    .form-row input::placeholder,
    .form-row textarea::placeholder {
        color: #b0b7c3;
        font-style: italic;
    }

.form-row .ssi-wrap { width: 100%; }

/* ── Modal header (blue) ── */
.modal-header {
    background: #0078d4;
    border-radius: 10px 10px 0 0;
    padding: 14px 20px;
}

    .modal-header h4 {
        color: #ffffff;
        font-size: 15px;
        font-weight: 500;
        margin: 0;
    }

.modal-close { color: #ffffff; opacity: 0.8; font-size: 18px; }
    .modal-close:hover { opacity: 1; }

.modal-footer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 10px 10px;
    padding: 12px 20px;
}

/* ── Buttons ── */
.btn-primary {
    background: #0078d4;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 24px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

    .btn-primary:hover { background: #005a9e; }
    .btn-primary:disabled { background: #90b8d8; cursor: not-allowed; }

/* ── Validation ── */
input.input-error,
select.input-error,
textarea.input-error {
    border: 1.5px solid #E24B4A !important;
    box-shadow: 0 0 0 3px rgba(226,75,74,.15) !important;
    outline: none;
}

.field-error { font-size: 12px; color: #A32D2D; margin-top: 4px; }

/* ── Status badges ── */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-instock    { background: #dcfce7; color: #166534; }
.badge-intransit  { background: #fef9c3; color: #854d0e; }
.badge-received   { background: #dbeafe; color: #1e40af; }
.badge-pending    { background: #f3f4f6; color: #4b5563; }
.badge-active     { background: #dcfce7; color: #166534; }
.badge-inactive   { background: #fee2e2; color: #991b1b; }

/* ── Lot tag (inline lot number chips) ── */
.lot-tag {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 500;
    margin: 1px 2px;
    font-family: 'Courier New', monospace;
}

/* ── Transaction table (purchase detail / challan detail) ── */
.qt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .qt-table thead tr { background: #eff6ff; }

    .qt-table th {
        padding: 8px;
        text-align: left;
        font-size: 11px;
        font-weight: 600;
        color: #1e3a5f;
        border-bottom: 2px solid #bfdbfe;
        border-right: 1px solid #bfdbfe;
        white-space: nowrap;
    }

        .qt-table th:last-child { border-right: none; }

    .qt-table td {
        padding: 4px 2px;
        border-bottom: 1px solid #f3f4f6;
        border-right: 1px solid #f0f0f0;
        vertical-align: middle;
    }

        .qt-table td:last-child { border-right: none; }

    .qt-table tr:hover td { background: #fafafa; }
    .qt-table tr.qt-active td { background: #f0f9ff; }

.qt-cell {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    font-size: 13px;
    background: #f9fafb;
    box-sizing: border-box;
}

    .qt-cell:focus { background: #fff; outline: none; border-color: #93c5fd; }

.qt-right  { text-align: right; }
.qt-center { text-align: center; }

.btn-add-inline {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #0078d4;
    background: #eff6ff;
    color: #0078d4;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .btn-add-inline:hover { background: #0078d4; color: #fff; }

.btn-del-inline {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
}

/* ── Form shell (transaction pages) ── */
.form-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 32px);
    overflow: hidden;
}

.form-top     { flex-shrink: 0; }
.form-content { flex: 1; overflow-y: auto; padding-bottom: 4px; }

.form-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 10px;
}

.form-3col { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.form-4col { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); gap: 12px; }

/* ── List shell (grid list pages — mirrors form-shell) ── */
.list-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 32px);
    overflow: hidden;
}

.grid-wrapper {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── Bottom bar (transaction save bar) ── */
.bottom-bar {
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-top: 8px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}

.total-label { font-size: 10px; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.total-value { font-size: 15px; font-weight: 500; color: #111827; }

/* ── Icon action buttons in grid ── */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin: 0 2px;
    transition: background 0.15s;
}

.btn-icon-edit   { background: #eff6ff; color: #0078d4; }
.btn-icon-edit:hover { background: #dbeafe; }

.btn-icon-delete { background: #fff0f0; color: #d13438; }
.btn-icon-delete:hover { background: #fde7e9; }

.btn-icon-print  { background: #fefce8; color: #854d0e; }
.btn-icon-print:hover { background: #fef9c3; }

.btn-icon-mail   { background: #f0fdf4; color: #16a34a; }
.btn-icon-mail:hover { background: #dcfce7; }

/* ── Lot selection multi-select in challan ── */
.lot-multi {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    max-height: 130px;
    overflow-y: auto;
    background: #fff;
}

.lot-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    border-bottom: 1px solid #f3f4f6;
}

    .lot-option:last-child { border-bottom: none; }
    .lot-option:hover { background: #f0f4ff; }
    .lot-option.selected { background: #eff6ff; }
    .lot-option input[type=checkbox] { width: 13px; height: 13px; cursor: pointer; }

/* ── Highlight after save ── */
.wo-highlight { background: #fff3cd !important; outline: 2px solid #f7a800 !important; }
    .wo-highlight td { background: #fff3cd !important; }

/* ── Validation message block ── */
.validation-msg {
    color: #d13438;
    font-size: 12px;
    padding: 6px 10px;
    background: #fde7e9;
    border-radius: 5px;
    margin-top: 6px;
}

/* ── Required asterisk ── */
.required { color: #d13438; }
