* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


html,
body {
    width: 100%;
    min-height: 100%;
}


body {
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #f4f6f9;

    color: #172033;

    font-size: 14px;
}




.app {
    display: flex;

    width: 100%;

    min-height: 100vh;
}




.sidebar {
    width: 250px;

    min-width: 250px;

    min-height: 100vh;

    background: #8b1e2d;

    color: white;

    display: flex;

    flex-direction: column;

    padding: 20px 14px;

    position: fixed;

    left: 0;

    top: 0;

    bottom: 0;

    z-index: 100;
}




.brand {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 6px 8px 18px;
}


.brand-icon {
    font-size: 32px;
}


.brand h1 {
    font-size: 20px;

    letter-spacing: .3px;

    color: white;
}


.brand span {
    display: block;

    font-size: 10px;

    margin-top: 2px;

    color: #f8dfe3;
}




.facility-box {
    background: rgba(255,255,255,.10);

    border-radius: 9px;

    padding: 10px 12px;

    margin-bottom: 10px;
}


.facility-box strong {
    display: block;

    font-size: 13px;
}


.facility-box span {
    display: block;

    font-size: 10px;

    margin-top: 3px;

    color: #f6dfe3;
}




.system-status {
    background: rgba(255,255,255,.10);

    border-radius: 8px;

    padding: 10px 12px;

    display: flex;

    align-items: center;

    gap: 8px;

    margin-bottom: 16px;

    font-size: 12px;
}


.status-dot {
    width: 8px;

    height: 8px;

    background: #35e287;

    border-radius: 50%;

    display: inline-block;
}




.navigation {
    display: flex;

    flex-direction: column;

    gap: 4px;
}


.nav-btn {
    width: 100%;

    border: none;

    background: transparent;

    color: white;

    text-align: left;

    padding: 12px 10px;

    border-radius: 8px;

    cursor: pointer;

    display: flex;

    align-items: center;

    gap: 10px;

    font-size: 13px;

    transition: .2s;
}


.nav-btn:hover {
    background: rgba(255,255,255,.12);
}


.nav-btn.active-nav {
    background: white;

    color: #8b1e2d;

    font-weight: 700;
}


.nav-icon {
    width: 16px;

    text-align: center;

    font-size: 14px;
}




.sidebar-footer {
    margin-top: auto;

    padding: 12px 7px 4px;

    display: flex;

    flex-direction: column;

    gap: 3px;

    font-size: 9px;

    color: #f3cfd4;
}


.sidebar-footer strong {
    color: white;

    font-size: 10px;
}




.main {
    margin-left: 250px;

    width: calc(100% - 250px);

    min-width: 0;

    min-height: 100vh;

    background: #f4f6f9;
}




.topbar {
    width: 100%;

    min-height: 74px;

    background: white;

    border-bottom: 1px solid #e2e6eb;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding: 14px 28px;

    position: sticky;

    top: 0;

    z-index: 50;
}


.page-heading h2 {
    font-size: 22px;

    margin-bottom: 3px;
}


.page-heading p {
    color: #68758a;

    font-size: 12px;
}


.topbar-right {
    display: flex;

    align-items: center;

    gap: 18px;

    white-space: nowrap;
}


#currentDate {
    font-size: 12px;

    color: #4d5869;
}


.user-profile {
    display: flex;

    align-items: center;

    gap: 9px;
}


.user-avatar {
    width: 34px;

    height: 34px;

    border-radius: 50%;

    background: #8b1e2d;

    color: white;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 11px;

    font-weight: bold;
}


.user-profile strong {
    display: block;

    font-size: 12px;
}


.user-profile small {
    display: block;

    color: #718096;

    font-size: 10px;

    margin-top: 2px;
}


.logout-btn {
    border: 1px solid #d8dde5;

    background: white;

    border-radius: 6px;

    padding: 7px 11px;

    font-size: 11px;

    cursor: pointer;
}


.logout-btn:hover {
    background: #f6f7f9;
}




.content {
    width: 100%;

    padding: 26px 28px 50px;

    max-width: none;
}




.page {
    display: none;

    width: 100%;
}


.page.active {
    display: block;
}




.section-heading {
    display: flex;

    justify-content: space-between;

    align-items: flex-end;

    gap: 20px;

    margin-bottom: 20px;
}


.section-heading h2 {
    font-size: 21px;

    margin-bottom: 4px;
}


.section-heading p {
    color: #718096;

    font-size: 13px;
}




.dashboard-cards {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 20px;
}


.dashboard-card {
    background: white;

    border: 1px solid #e4e8ed;

    border-radius: 10px;

    padding: 17px;

    box-shadow:
        0 2px 7px rgba(20,30,50,.03);
}


.dashboard-card span {
    display: block;

    color: #68758a;

    font-size: 12px;

    margin-bottom: 8px;
}


.dashboard-card strong {
    display: block;

    font-size: 27px;

    color: #182234;

    margin-bottom: 5px;
}


.dashboard-card small {
    color: #8994a5;

    font-size: 10px;
}


.available-card strong {
    color: #198754;
}


.warning-card strong {
    color: #b77900;
}


.danger-card strong {
    color: #c62828;
}


.pending-card strong {
    color: #b77900;
}


.incompatible-card strong {
    color: #c62828;
}




.dashboard-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 18px;

    margin-bottom: 18px;
}




.panel {
    background: white;

    border: 1px solid #e1e5ea;

    border-radius: 10px;

    margin-bottom: 18px;

    box-shadow:
        0 2px 7px rgba(20,30,50,.03);

    overflow: hidden;
}


.panel-header {
    padding: 16px 18px;

    border-bottom: 1px solid #edf0f3;

    display: flex;

    align-items: center;

    justify-content: space-between;
}


.panel-header h3 {
    font-size: 15px;
}


.panel-header p {
    color: #778398;

    font-size: 11px;

    margin-top: 3px;
}




.alert {
    padding: 12px 14px;

    margin: 10px 18px;

    border-radius: 7px;

    font-size: 12px;

    line-height: 1.5;
}


.alert-success {
    background: #e9f9ef;

    color: #18733b;
}


.alert-warning {
    background: #fff5d9;

    color: #8a6100;
}


.alert-danger {
    background: #fdeaea;

    color: #a51d1d;
}




.component-item {
    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 11px 18px;

    border-bottom: 1px solid #f0f2f5;

    font-size: 12px;
}


.component-item:last-child {
    border-bottom: none;
}


.component-count {
    background: #f2f4f7;

    border-radius: 20px;

    padding: 4px 9px;

    font-size: 11px;
}




.overview-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 1px;

    background: #e8ebef;
}


.overview-grid > div {
    background: white;

    padding: 18px;
}


.overview-grid strong {
    display: block;

    font-size: 11px;

    color: #68758a;
}


.overview-grid p {
    font-size: 23px;

    font-weight: bold;

    margin-top: 8px;
}




.form-card {
    background: white;

    border: 1px solid #e1e5ea;

    border-radius: 10px;

    padding: 22px;

    margin-bottom: 18px;

    box-shadow:
        0 2px 7px rgba(20,30,50,.03);
}


.form-section-title {
    margin-bottom: 20px;
}


.form-section-title h3 {
    font-size: 16px;

    margin-bottom: 4px;
}


.form-section-title p {
    color: #748095;

    font-size: 12px;
}




.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 17px;
}


.form-group {
    display: flex;

    flex-direction: column;

    gap: 7px;
}


.form-group label {
    font-weight: 700;

    font-size: 12px;
}


.form-group small {
    color: #7d8999;

    font-size: 10px;

    line-height: 1.4;
}


input,
select {
    width: 100%;

    min-height: 40px;

    border: 1px solid #d7dce3;

    border-radius: 7px;

    background: white;

    padding: 9px 11px;

    font-size: 12px;

    color: #202a3a;

    outline: none;
}


input:focus,
select:focus {
    border-color: #8b1e2d;

    box-shadow:
        0 0 0 2px rgba(139,30,45,.08);
}


input[readonly] {
    background: #f6f7f9;

    color: #68758a;
}




.barcode-box {
    min-height: 95px;

    border: 1px dashed #cfd5dd;

    border-radius: 7px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #fafbfc;

    position: relative;

    overflow: hidden;
}


#barcodeImage {
    max-width: 100%;

    height: auto;
}


#barcodePlaceholder {
    color: #9aa4b2;

    font-size: 11px;
}




.suggested-location {
    margin-top: 20px;

    padding: 14px;

    background: #f7f8fa;

    border: 1px solid #e5e8ed;

    border-radius: 8px;
}


.suggested-location strong {
    display: block;

    font-size: 12px;

    margin-bottom: 6px;
}


.suggested-location div {
    font-size: 12px;

    color: #526074;
}




.info-box {
    margin: 18px 0;

    background: #fdf3f4;

    border: 1px solid #f1d5d9;

    border-left: 4px solid #8b1e2d;

    border-radius: 7px;

    padding: 13px 15px;
}


.info-box strong {
    font-size: 12px;
}


.info-box p {
    font-size: 11px;

    color: #647084;

    line-height: 1.6;

    margin-top: 5px;
}




.primary-btn {
    border: none;

    background: #8b1e2d;

    color: white;

    padding: 10px 15px;

    border-radius: 7px;

    font-size: 12px;

    font-weight: 700;

    cursor: pointer;

    transition: .2s;
}


.primary-btn:hover {
    background: #711622;
}


.secondary-btn {
    border: 1px solid #d4d9e0;

    background: white;

    color: #344054;

    padding: 9px 13px;

    border-radius: 7px;

    font-size: 11px;

    cursor: pointer;
}


.secondary-btn:hover {
    background: #f6f7f9;
}


.action-btn {
    border: none;

    background: #f2f4f7;

    color: #273246;

    padding: 6px 9px;

    border-radius: 6px;

    font-size: 10px;

    cursor: pointer;

    margin: 2px;
}


.action-btn:hover {
    background: #e5e8ed;
}


.action-btn.danger {
    color: #a51d1d;

    background: #fdeeee;
}


.action-btn.success {
    color: #176b38;

    background: #e9f8ef;
}




.crossmatch-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(280px, .8fr);

    gap: 18px;

    align-items: start;
}


.search-row {
    display: flex;

    gap: 9px;

    margin-bottom: 18px;
}


.search-row input {
    flex: 1;
}


.crossmatch-result {
    border: 1px solid #e2e6eb;

    border-radius: 8px;

    overflow: hidden;
}


.unit-summary {
    padding: 17px;

    background: #fafbfc;

    border-bottom: 1px solid #e6e9ed;
}


.unit-summary h3 {
    font-size: 15px;

    margin-bottom: 12px;
}


.unit-info-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0,1fr));

    gap: 10px;
}


.unit-info {
    background: white;

    border: 1px solid #e5e8ec;

    border-radius: 7px;

    padding: 10px;
}


.unit-info span {
    display: block;

    color: #7b8798;

    font-size: 9px;

    margin-bottom: 5px;

    text-transform: uppercase;
}


.unit-info strong {
    font-size: 12px;
}


.crossmatch-form {
    padding: 18px;
}


.crossmatch-form h4 {
    font-size: 14px;

    margin-bottom: 14px;
}


.crossmatch-actions {
    display: flex;

    gap: 8px;

    margin-top: 16px;

    flex-wrap: wrap;
}




.workflow {
    padding: 17px;
}


.workflow-step {
    display: flex;

    align-items: flex-start;

    gap: 12px;
}


.workflow-step > span {
    width: 27px;

    min-width: 27px;

    height: 27px;

    border-radius: 50%;

    background: #f0f2f5;

    display: flex;

    align-items: center;

    justify-content: center;

    font-weight: bold;

    font-size: 11px;
}


.workflow-step strong {
    display: block;

    font-size: 12px;
}


.workflow-step small {
    display: block;

    color: #7a8698;

    font-size: 10px;

    margin-top: 3px;

    line-height: 1.4;
}


.workflow-line {
    height: 24px;

    border-left: 1px dashed #cfd5dd;

    margin-left: 13px;
}




.empty-state {
    padding: 35px 20px;

    text-align: center;

    background: #fafbfc;

    border: 1px dashed #d6dbe2;

    border-radius: 8px;

    color: #718096;
}


.empty-state strong {
    display: block;

    color: #364152;

    margin-bottom: 5px;

    font-size: 13px;
}


.empty-state span {
    font-size: 11px;
}




.table-container {
    width: 100%;

    overflow-x: auto;

    background: white;

    border: 1px solid #e1e5ea;

    border-radius: 10px;

    box-shadow:
        0 2px 7px rgba(20,30,50,.03);
}


table {
    width: 100%;

    border-collapse: collapse;

    min-width: 950px;
}


th {
    background: #fafbfc;

    color: #516075;

    font-size: 11px;

    font-weight: 700;

    text-align: left;

    padding: 12px;

    border-bottom: 1px solid #e1e5ea;

    white-space: nowrap;
}


td {
    padding: 13px 12px;

    border-bottom: 1px solid #edf0f3;

    font-size: 11px;

    vertical-align: middle;
}


tbody tr:hover {
    background: #fcfcfd;
}


tbody tr:last-child td {
    border-bottom: none;
}




.inventory-controls {
    display: flex;

    gap: 8px;

    width: min(420px, 100%);
}


.inventory-controls input {
    flex: 1;
}


.inventory-controls select {
    width: 145px;
}




.status-badge,
.crossmatch-badge {
    display: inline-block;

    border-radius: 20px;

    padding: 5px 9px;

    font-size: 9px;

    font-weight: 700;

    white-space: nowrap;
}


.status-AVAILABLE,
.crossmatch-COMPATIBLE {
    background: #d9f8e6;

    color: #16733a;
}


.status-RESERVED {
    background: #dceaff;

    color: #1761aa;
}


.status-RELEASED {
    background: #e7e9ed;

    color: #596270;
}


.status-EXPIRED,
.status-INCOMPATIBLE,
.crossmatch-INCOMPATIBLE {
    background: #fde1e1;

    color: #a52121;
}


.status-CROSSMATCH_PENDING,
.crossmatch-PENDING {
    background: #fff0c8;

    color: #8c6200;
}




.scan-layout {
    width: 100%;
}


.scanner-box {
    width: 100%;

    max-width: 600px;

    min-height: 50px;

    margin: 15px auto;

    border-radius: 8px;

    overflow: hidden;
}


.scanner-buttons {
    display: flex;

    gap: 8px;

    margin-bottom: 15px;
}


.result-card {
    background: white;

    border: 1px solid #e1e5ea;

    border-radius: 9px;

    padding: 18px;

    margin-top: 15px;
}


.result-card h3 {
    font-size: 15px;

    margin-bottom: 13px;
}


.result-card p {
    font-size: 12px;

    margin-bottom: 8px;

    line-height: 1.5;
}


.recommended-unit {
    border: 1px solid #e2e6eb;

    border-radius: 8px;

    padding: 14px;

    margin: 10px 0;
}


.recommended-unit h4 {
    font-size: 13px;

    margin-bottom: 7px;
}


.recommended-unit p {
    font-size: 11px;

    margin: 4px 0;
}




.storage-map {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;
}


.storage-shelf {
    background: white;

    border: 1px solid #e1e5ea;

    border-radius: 10px;

    padding: 15px;

    box-shadow:
        0 2px 7px rgba(20,30,50,.03);
}


.storage-shelf h3 {
    font-size: 14px;

    margin-bottom: 12px;
}


.positions {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0,1fr));

    gap: 9px;
}


.storage-position {
    min-height: 115px;

    border-radius: 8px;

    padding: 10px;

    font-size: 10px;

    text-align: center;

    border: 1px solid #e1e5ea;
}


.storage-position.occupied {
    background: #fdf1f3;

    border-color: #e8c5cb;
}


.storage-position.empty {
    background: #f7f8fa;

    color: #7e8999;
}


.storage-position.highlighted {
    outline: 3px solid #8b1e2d;

    outline-offset: 2px;
}


.highlight-message {
    background: #fdf3f4;

    border: 1px solid #efd3d7;

    border-radius: 7px;

    padding: 11px 13px;

    margin-bottom: 17px;

    font-size: 11px;

    color: #73313a;
}




.report-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0,1fr));

    gap: 18px;
}




.activity-list {
    background: white;

    border: 1px solid #e1e5ea;

    border-radius: 10px;

    overflow: hidden;
}


.activity-item {
    padding: 14px 17px;

    border-bottom: 1px solid #edf0f3;

    display: flex;

    justify-content: space-between;

    gap: 20px;

    font-size: 11px;
}


.activity-item:last-child {
    border-bottom: none;
}


.activity-time {
    color: #7c8797;

    white-space: nowrap;
}




@media (max-width: 1200px) {

    .sidebar {
        width: 220px;

        min-width: 220px;
    }


    .main {
        margin-left: 220px;

        width: calc(100% - 220px);
    }


    .dashboard-cards {
        grid-template-columns:
            repeat(3, minmax(0,1fr));
    }


    .crossmatch-layout {
        grid-template-columns:
            1fr;
    }

}


@media (max-width: 900px) {

    .sidebar {
        position: relative;

        width: 210px;

        min-width: 210px;
    }


    .main {
        margin-left: 0;

        width: calc(100% - 210px);
    }


    .dashboard-cards {
        grid-template-columns:
            repeat(2, minmax(0,1fr));
    }


    .dashboard-grid,
    .report-grid {
        grid-template-columns: 1fr;
    }


    .storage-map {
        grid-template-columns:
            repeat(2, minmax(0,1fr));
    }


    .topbar {
        align-items: flex-start;

        flex-direction: column;
    }


    .topbar-right {
        width: 100%;

        justify-content: space-between;
    }

}


@media (max-width: 650px) {

    .app {
        display: block;
    }


    .sidebar {
        width: 100%;

        min-height: auto;

        position: relative;
    }


    .main {
        width: 100%;

        margin-left: 0;
    }


    .navigation {
        display: grid;

        grid-template-columns:
            repeat(2,1fr);
    }


    .dashboard-cards {
        grid-template-columns: 1fr;
    }


    .form-grid {
        grid-template-columns: 1fr;
    }


    .unit-info-grid {
        grid-template-columns: 1fr;
    }


    .storage-map {
        grid-template-columns: 1fr;
    }


    .content {
        padding: 18px 14px 35px;
    }


    .topbar {
        padding: 14px;
    }


    .section-heading {
        align-items: flex-start;

        flex-direction: column;
    }


    .inventory-controls {
        width: 100%;
    }
}


/* =========================================================
   PULSE-INV PROFESSIONAL ENHANCEMENTS
   Existing design preserved
========================================================= */

.inventory-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.inventory-count {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 7px;
    background: #f7f8fa;
    border: 1px solid #e1e5ea;
    color: #68758a;
    font-size: 11px;
    font-weight: 700;
}

.table-subtext {
    display: block;
    margin-top: 4px;
    color: #8994a5;
    font-size: 10px;
    line-height: 1.35;
}

.expiration-warning {
    background: #fff9e8;
}

.compact-empty-state {
    padding: 12px;
}

.compact-empty-state strong,
.compact-empty-state span {
    display: block;
}

.compact-empty-state span {
    margin-top: 3px;
}

.action-btn.danger {
    background: #fff0f0;
    color: #a51d1d;
    border: 1px solid #f1caca;
}

.action-btn.danger:hover {
    background: #fde2e2;
}

@media (max-width: 900px) {
    .inventory-actions {
        justify-content: flex-start;
    }
}
