/* =========================================================
   BARISTA - TRANSACTIONS
   Barang Masuk & Barang Keluar
   ========================================================= */

.transaction-page {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* =========================================================
   PAGE HEADER
   ========================================================= */

.transaction-page .page-header {
    margin-bottom: 22px;
}

.transaction-page .page-header h1 {
    margin: 0 0 5px;
    color: #242424;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.35;
}

.transaction-page .page-header p {
    margin: 0;
    color: #777777;
    font-size: 13px;
    line-height: 1.5;
}

/* =========================================================
   ALERT
   ========================================================= */

.transaction-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    border: 0;
    border-radius: 10px;
}

.transaction-alert > i {
    flex-shrink: 0;
    margin-top: 1px;
}

.transaction-alert ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.transaction-alert li {
    margin-bottom: 2px;
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.transaction-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    align-items: start;
}

.transaction-main-card,
.transaction-side-card {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.transaction-main-card {
    min-width: 0;
    overflow: hidden;
}

/* =========================================================
   BREADCRUMB
   ========================================================= */
.transaction-page .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    padding: 0;
    background: transparent;
    color: #96a0af;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}
.transaction-page .breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #737e8e;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
}

.transaction-page .breadcrumb a:hover {
    color: #596474;
}

.transaction-page .breadcrumb a i {
    color: #8b95a3;
    font-size: 13px;
    line-height: 1;
}

.transaction-page .breadcrumb > i {
    color: #b9c0ca;
    font-size: 9px;
    line-height: 1;
}

.transaction-page .breadcrumb > span {
    color: #96a0af;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

/* =========================================================
   CARD HEADER
   ========================================================= */

.transaction-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #eeeeee;
}

.transaction-card-header h2 {
    margin: 0 0 4px;
    color: #242424;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.transaction-card-header p {
    margin: 0;
    color: #777777;
    font-size: 12px;
    line-height: 1.5;
}

.transaction-header-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 11px;
    background: #f1f7f3;
    color: #287a4b;
    font-size: 18px;
}

.outgoing-header-icon {
    background: #fff1f1;
    color: #c44747;
}

/* =========================================================
   FORM BODY
   ========================================================= */

.transaction-form-body {
    padding: 20px;
}

.form-section {
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid #eeeeee;
}

.form-section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.form-section-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.section-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: #f2f5f3;
    color: #287a4b;
    font-size: 12px;
    font-weight: 700;
}

.form-section-title > div:last-child {
    min-width: 0;
}

.form-section-title h3 {
    margin: 1px 0 3px;
    color: #252525;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.form-section-title p {
    margin: 0;
    color: #888888;
    font-size: 11px;
    line-height: 1.5;
}

/* =========================================================
   SOURCE OPTION - BARANG MASUK
   ========================================================= */

.source-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.source-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 82px;
    padding: 13px;
    border: 1px solid #dedede;
    border-radius: 11px;
    background: #ffffff;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.source-option:hover {
    border-color: #b8cdbf;
    background: #fafcfb;
}

.source-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.source-option:has(input:checked) {
    border-color: #287a4b;
    background: #f7fbf8;
    box-shadow: 0 0 0 2px rgba(40, 122, 75, 0.08);
}

.source-option-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.source-option-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9px;
    font-size: 17px;
}

.source-icon-request {
    background: #edf6f0;
    color: #287a4b;
}

.source-icon-urgent {
    background: #fff5df;
    color: #bd7910;
}

.source-option-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.source-option-text strong {
    color: #292929;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.source-option-text small {
    color: #888888;
    font-size: 10px;
    line-height: 1.5;
}

.source-option-check {
    display: none;
    flex-shrink: 0;
    color: #287a4b;
    font-size: 17px;
}

.source-option:has(input:checked) .source-option-check {
    display: block;
}

/* =========================================================
   FORM GROUP
   ========================================================= */

.form-group {
    margin-bottom: 14px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #333333;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.required {
    color: #d94841;
}

.form-control {
    width: 100%;
    min-height: 41px;
    padding: 8px 11px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    outline: none;
    background: #ffffff;
    color: #333333;
    font-size: 12px;
    line-height: 1.5;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.form-control:focus {
    border-color: #287a4b;
    box-shadow: 0 0 0 3px rgba(40, 122, 75, 0.1);
}

.form-control:disabled {
    background: #f6f6f6;
    color: #777777;
    cursor: not-allowed;
}

.form-control.auto-filled {
    border-color: #d6e5da;
    background: #f5f8f6;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.08);
}

.invalid-feedback {
    display: block;
    margin-top: 5px;
    color: #dc3545;
    font-size: 10px;
    line-height: 1.5;
}

/* =========================================================
   FORM ROW
   ========================================================= */

.form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 14px;
}

.form-group-wide {
    min-width: 0;
}

/* =========================================================
   QUANTITY
   ========================================================= */

.quantity-group {
    max-width: 100%;
}

.quantity-input-wrapper {
    position: relative;
}

.quantity-input-wrapper .form-control {
    padding-right: 65px;
}

.quantity-unit {
    position: absolute;
    top: 50%;
    right: 13px;
    transform: translateY(-50%);
    color: #888888;
    font-size: 10px;
    pointer-events: none;
}

/* =========================================================
   REQUEST INFO
   ========================================================= */

.request-info {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    margin-top: 4px;
    border-radius: 9px;
    background: #f5f8f6;
    color: #555555;
}

.request-info-icon {
    color: #287a4b;
    font-size: 14px;
    line-height: 1.4;
}

.request-info > div:last-child {
    min-width: 0;
}

.request-info strong {
    display: block;
    margin-bottom: 2px;
    color: #333333;
    font-size: 11px;
    line-height: 1.4;
}

.request-info p {
    margin: 0;
    color: #777777;
    font-size: 10px;
    line-height: 1.5;
}

.hidden-section {
    display: none !important;
}

/* =========================================================
   STOCK PREVIEW - GENERAL
   ========================================================= */

.stock-preview {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    margin-top: 4px;
    border: 1px solid #e2e8e4;
    border-radius: 10px;
    background: #f8faf9;
}

.stock-preview.show {
    display: flex;
}

.stock-preview-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9px;
    background: #edf6f0;
    color: #287a4b;
    font-size: 14px;
}

.outgoing-preview-icon {
    background: #fff1f1;
    color: #c44747;
}

.stock-preview-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 90px;
}

.stock-preview-content span {
    color: #888888;
    font-size: 9px;
    line-height: 1.4;
}

.stock-preview-content strong {
    color: #333333;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.stock-preview-arrow {
    color: #aaaaaa;
    font-size: 13px;
}

/* =========================================================
   SELECTED ITEM INFO - BARANG KELUAR
   ========================================================= */

.selected-item-info {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-top: 10px;
    border: 1px solid #eeeeee;
    border-radius: 10px;
    background: #fafafa;
}

.selected-item-info.show {
    display: flex;
}

.selected-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9px;
    background: #fff1f1;
    color: #c44747;
    font-size: 14px;
}

.selected-item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.selected-item-content span,
.selected-item-stock span {
    color: #888888;
    font-size: 9px;
    line-height: 1.4;
}

.selected-item-content strong {
    overflow: hidden;
    color: #333333;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-item-stock {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 14px;
    border-left: 1px solid #e5e5e5;
}

.selected-item-stock strong {
    color: #333333;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

/* =========================================================
   QUANTITY WARNING - BARANG KELUAR
   ========================================================= */

.quantity-warning {
    display: none;
    align-items: center;
    gap: 7px;
    margin-top: 6px;
    color: #c44747;
    font-size: 10px;
    line-height: 1.5;
}

.quantity-warning.show {
    display: flex;
}

.quantity-warning i {
    flex-shrink: 0;
    font-size: 11px;
}

/* =========================================================
   TRANSACTION NOTE
   ========================================================= */

.transaction-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    border: 1px solid #f0e2c5;
    border-radius: 9px;
    background: #fffbf3;
}

.transaction-note-icon {
    color: #bd7910;
    font-size: 14px;
    line-height: 1.4;
}

.transaction-note > div:last-child {
    min-width: 0;
}

.transaction-note strong {
    display: block;
    margin-bottom: 2px;
    color: #6e531f;
    font-size: 11px;
    line-height: 1.4;
}

.transaction-note p {
    margin: 0;
    color: #8a754d;
    font-size: 10px;
    line-height: 1.5;
}

/* =========================================================
   FORM FOOTER
   ========================================================= */

.transaction-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #eeeeee;
    background: #fcfcfc;
}

.transaction-form-footer .btn {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.transaction-form-footer .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    background: #287a4b;
    color: #ffffff;
}

.transaction-form-footer .btn-primary:hover {
    background: #21663e;
    color: #ffffff;
}

.transaction-form-footer .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.transaction-form-footer .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    background: #c44747;
    color: #ffffff;
}

.transaction-form-footer .btn-danger:hover {
    background: #ad3c3c;
    color: #ffffff;
}

.transaction-form-footer .btn-danger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.transaction-form-footer .btn-light {
    border: 1px solid #dddddd;
    background: #ffffff;
    color: #555555;
}

.transaction-form-footer .btn-light:hover {
    background: #f5f5f5;
    color: #444444;
}

/* =========================================================
   SIDE CARD
   ========================================================= */

.transaction-side-card {
    padding: 18px;
}

.side-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 16px;
}

.side-card-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9px;
    background: #f2f5f3;
    color: #287a4b;
    font-size: 16px;
}

.outgoing-side-icon {
    background: #fff1f1;
    color: #c44747;
}

.side-card-header > div:last-child {
    min-width: 0;
}

.side-card-header h3 {
    margin: 0 0 2px;
    color: #292929;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.side-card-header p {
    margin: 0;
    color: #888888;
    font-size: 10px;
    line-height: 1.5;
}

/* =========================================================
   TRANSACTION NAVIGATION
   ========================================================= */

.transaction-navigation {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.transaction-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #555555;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.transaction-nav-item:hover {
    background: #f8f9f8;
    color: #333333;
}

.transaction-nav-item.active {
    border-color: #dce9df;
    background: #f4f9f5;
    color: #287a4b;
}

.transaction-nav-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    font-size: 14px;
}

.transaction-nav-icon.incoming {
    background: #edf6f0;
    color: #287a4b;
}

.transaction-nav-icon.outgoing {
    background: #fff0f0;
    color: #c44747;
}

.transaction-nav-item > span:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.transaction-nav-item strong {
    color: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.transaction-nav-item small {
    color: #999999;
    font-size: 9px;
    line-height: 1.4;
}

.transaction-nav-item > i {
    flex-shrink: 0;
    color: #aaaaaa;
    font-size: 10px;
}

.side-card-divider {
    height: 1px;
    margin: 16px 0;
    background: #eeeeee;
}

/* =========================================================
   GUIDE
   ========================================================= */

.source-guide h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    color: #333333;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.source-guide h4 i {
    color: #c28a2c;
}

.guide-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.guide-item:last-child {
    margin-bottom: 0;
}

.guide-badge {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 7px;
    font-size: 11px;
}

.guide-badge.request {
    background: #edf6f0;
    color: #287a4b;
}

.guide-badge.urgent {
    background: #fff5df;
    color: #bd7910;
}

.guide-badge.outgoing {
    background: #fff1f1;
    color: #c44747;
}

.guide-badge.warning {
    background: #fff5df;
    color: #bd7910;
}

.guide-item p {
    margin: 0;
    color: #777777;
    font-size: 9px;
    line-height: 1.6;
}

.guide-item p strong {
    display: block;
    margin-bottom: 2px;
    color: #444444;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
}

/* =========================================================
   RESPONSIVE - TABLET
   ========================================================= */

@media (max-width: 1100px) {
    .transaction-layout {
        grid-template-columns: 1fr;
    }

    .transaction-side-card {
        order: 2;
    }

    .transaction-navigation {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
   RESPONSIVE - MOBILE TABLET
   ========================================================= */

@media (max-width: 768px) {
    .transaction-card-header {
        padding: 18px 20px;
    }

    .transaction-form-body {
        padding: 20px;
    }

    .transaction-form-footer {
        padding: 14px 20px;
    }

    .source-options {
        grid-template-columns: 1fr;
    }

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

    .transaction-side-card {
        padding: 18px;
    }

    .stock-preview {
        flex-wrap: wrap;
    }
}

/* =========================================================
   RESPONSIVE - MOBILE
   ========================================================= */

@media (max-width: 576px) {
    .transaction-page .page-header {
        margin-bottom: 18px;
    }

    .transaction-page .page-header h1 {
        font-size: 21px;
    }

    .transaction-page .page-header p {
        font-size: 12px;
    }

    .transaction-card-header {
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }

    .transaction-card-header h2 {
        font-size: 16px;
    }

    .transaction-card-header p {
        font-size: 11px;
    }

    .transaction-header-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .transaction-form-body {
        padding: 16px;
    }

    .transaction-form-footer {
        flex-direction: column-reverse;
        align-items: stretch;
        padding: 13px 16px;
    }

    .transaction-form-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .transaction-navigation {
        grid-template-columns: 1fr;
    }

    .stock-preview {
        gap: 9px;
    }

    .stock-preview-arrow {
        transform: rotate(90deg);
    }

    .selected-item-info {
        align-items: flex-start;
    }

    .selected-item-content {
        min-width: 0;
    }

    .selected-item-stock {
        padding-left: 10px;
    }

    .source-option {
        min-height: 80px;
        padding: 12px;
    }

    .source-option-icon {
        width: 36px;
        height: 36px;
    }

    .source-option-text small {
        font-size: 9px;
    }

    .transaction-note {
        padding: 11px;
    }

    .form-section {
        padding-bottom: 18px;
        margin-bottom: 18px;
    }

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

/* =========================================================
   HISTORY
   ========================================================= */

.history-card {
    width: 100%;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.history-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #eeeeee;
}

.history-card-header h2 {
    margin: 0 0 3px;
    color: #252525;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.history-card-header p {
    margin: 0;
    color: #888888;
    font-size: 11px;
    line-height: 1.5;
}

.history-header-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
    background: #f2f5f3;
    color: #287a4b;
    font-size: 17px;
}

/* =========================================================
   HISTORY FILTER
   ========================================================= */

.history-filter {
    display: grid;
    grid-template-columns:
        minmax(180px, 1.5fr) repeat(4, minmax(130px, 1fr))
        auto;
    gap: 10px;
    align-items: end;
    padding: 16px 20px;
    border-bottom: 1px solid #eeeeee;
    background: #fcfcfc;
}

.history-filter-group {
    min-width: 0;
}

.history-filter-group label {
    display: block;
    margin-bottom: 5px;
    color: #555555;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
}

.history-search-wrapper {
    position: relative;
}

.history-search-wrapper i {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: #999999;
    font-size: 11px;
    pointer-events: none;
}

.history-search-wrapper input,
.history-filter-group select,
.history-filter-group > input {
    width: 100%;
    height: 36px;
    padding: 6px 9px;
    border: 1px solid #dddddd;
    border-radius: 8px;
    outline: none;
    background: #ffffff;
    color: #444444;
    font-size: 10px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.history-search-wrapper input {
    padding-left: 29px;
}

.history-search-wrapper input:focus,
.history-filter-group select:focus,
.history-filter-group > input:focus {
    border-color: #287a4b;
    box-shadow: 0 0 0 3px rgba(40, 122, 75, 0.08);
}

.history-filter-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-history-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 36px;
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    background: #287a4b;
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-history-filter:hover {
    background: #21663e;
    color: #ffffff;
}

.btn-history-reset {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dddddd;
    border-radius: 8px;
    background: #ffffff;
    color: #777777;
    font-size: 12px;
    text-decoration: none;
}

.btn-history-reset:hover {
    background: #f5f5f5;
    color: #444444;
}

/* =========================================================
   HISTORY SUMMARY
   ========================================================= */

.history-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    border-bottom: 1px solid #eeeeee;
}

.history-summary-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.history-summary-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f2f5f3;
    color: #287a4b;
    font-size: 12px;
}

.history-summary-left > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-summary-left strong {
    color: #333333;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.history-summary-left span {
    color: #999999;
    font-size: 9px;
    line-height: 1.4;
}

/* =========================================================
   HISTORY TABLE
   ========================================================= */

.history-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.history-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
}

.history-table th {
    padding: 10px 12px;
    border-bottom: 1px solid #e8e8e8;
    background: #fafafa;
    color: #7d8692;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.history-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #eeeeee;
    color: #555555;
    font-size: 10px;
    vertical-align: middle;
}

.history-table tbody tr {
    transition: background-color 0.15s ease;
}

.history-table tbody tr:hover {
    background: #fafcfb;
}

.history-table tbody tr:last-child td {
    border-bottom: 0;
}

.history-number {
    color: #999999 !important;
    font-size: 10px !important;
    text-align: center;
}

/* =========================================================
   HISTORY ITEM
   ========================================================= */

.history-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 180px;
}

.history-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    background: #f2f5f3;
    color: #287a4b;
    font-size: 13px;
}

.history-item > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.history-item strong {
    overflow: hidden;
    max-width: 190px;
    color: #333333;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item span {
    color: #999999;
    font-size: 9px;
    line-height: 1.4;
}

/* =========================================================
   TRANSACTION BADGE
   ========================================================= */

.transaction-badge,
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.transaction-badge.incoming {
    background: #edf6f0;
    color: #287a4b;
}

.transaction-badge.outgoing {
    background: #fff0f0;
    color: #c44747;
}

.transaction-badge i,
.source-badge i {
    font-size: 9px;
}

/* =========================================================
   SOURCE
   ========================================================= */

.source-badge.request {
    background: #edf6f0;
    color: #287a4b;
}

.source-badge.urgent {
    background: #fff5df;
    color: #bd7910;
}

.source-reference {
    display: block;
    margin-top: 3px;
    color: #999999;
    font-size: 8px;
    line-height: 1.3;
}

.source-empty {
    color: #b0b0b0;
    font-size: 10px;
}

/* =========================================================
   QUANTITY
   ========================================================= */

.history-quantity {
    display: flex;
    align-items: baseline;
    gap: 3px;
    white-space: nowrap;
}

.history-quantity strong {
    font-size: 11px;
    font-weight: 700;
}

.history-quantity span {
    color: #999999;
    font-size: 8px;
}

.quantity-incoming strong {
    color: #287a4b;
}

.quantity-outgoing strong {
    color: #c44747;
}

/* =========================================================
   STOCK
   ========================================================= */

.history-stock {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.history-stock span {
    color: #888888;
    font-size: 9px;
}

.history-stock i {
    color: #b5b5b5;
    font-size: 8px;
}

.history-stock strong {
    color: #333333;
    font-size: 10px;
    font-weight: 700;
}

/* =========================================================
   USER
   ========================================================= */

.history-user {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.history-user-avatar {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: #edf6f0;
    color: #287a4b;
    font-size: 9px;
    font-weight: 700;
}

.history-user span {
    color: #555555;
    font-size: 9px;
    font-weight: 500;
}

/* =========================================================
   DATE
   ========================================================= */

.history-date {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;
}

.history-date strong {
    color: #555555;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.4;
}

.history-date span {
    color: #999999;
    font-size: 8px;
    line-height: 1.4;
}

/* =========================================================
   EMPTY
   ========================================================= */

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 35px 20px;
    text-align: center;
}

.history-empty-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 13px;
    background: #f3f5f4;
    color: #8b968e;
    font-size: 21px;
}

.history-empty strong {
    margin-bottom: 4px;
    color: #444444;
    font-size: 12px;
    font-weight: 700;
}

.history-empty span {
    max-width: 350px;
    color: #999999;
    font-size: 10px;
    line-height: 1.5;
}

/* =========================================================
   PAGINATION
   ========================================================= */

.history-pagination {
    display: flex;
    justify-content: flex-end;
    padding: 13px 20px;
    border-top: 1px solid #eeeeee;
}

.history-pagination .pagination {
    margin: 0;
    gap: 3px;
}

.history-pagination .page-link {
    min-width: 29px;
    height: 29px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 7px;
    border: 1px solid #dddddd;
    border-radius: 7px !important;
    color: #666666;
    font-size: 9px;
}

.history-pagination .page-link:hover {
    background: #f5f8f6;
    border-color: #cbdace;
    color: #287a4b;
}

.history-pagination .page-item.active .page-link {
    border-color: #287a4b;
    background: #287a4b;
    color: #ffffff;
}

.history-pagination .page-item.disabled .page-link {
    color: #bbbbbb;
    background: #fafafa;
}

/* =========================================================
   RESPONSIVE - HISTORY
   ========================================================= */

@media (max-width: 1200px) {
    .history-filter {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .history-search-group {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .history-card-header {
        padding: 18px 20px;
    }

    .history-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 16px 20px;
    }

    .history-search-group {
        grid-column: span 2;
    }

    .history-summary {
        padding: 13px 20px;
    }

    .history-pagination {
        justify-content: center;
        padding: 13px 20px;
    }
}

@media (max-width: 576px) {
    .history-card-header {
        align-items: flex-start;
    }

    .history-card-header h2 {
        font-size: 16px;
    }

    .history-filter {
        grid-template-columns: 1fr;
    }

    .history-search-group {
        grid-column: auto;
    }

    .history-filter-actions {
        width: 100%;
    }

    .btn-history-filter {
        flex: 1;
    }

    .history-summary {
        align-items: flex-start;
    }
}
