/* =========================================================
   ADMIN MASTER BARANG
   INDEX + SHOW
   ========================================================= */

.admin-items-page {
    width: 100%;
    color: #242424;
}

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

.items-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.items-page-header-content {
    min-width: 0;
}

.items-breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px;
    padding: 0;
    color: #96a0af;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.items-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #737e8e;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

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

.items-breadcrumb a i {
    color: #8b95a3;
    font-size: 13px;
}

.items-breadcrumb > i {
    color: #b9c0ca;
    font-size: 9px;
}

.items-breadcrumb > span {
    color: #96a0af;
    font-size: 12px;
    font-weight: 500;
}

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

.items-page-subtitle {
    margin: 0;
    color: #777;
    font-size: 13px;
    line-height: 1.5;
}

.items-page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* =========================================================
   ADD / BACK BUTTON
   ========================================================= */

.items-add-button,
.items-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.items-add-button {
    border: 1px solid var(--layout-primary);
    background: var(--layout-primary);
    color: #ffffff;
}

.items-add-button:hover {
    border-color: var(--layout-primary-dark);
    background: var(--layout-primary-dark);
    color: #ffffff;
}

.items-secondary-button {
    border: 1px solid #e2e5e9;
    background: #fff;
    color: #596474;
}

.items-secondary-button:hover {
    border-color: #d4d8de;
    background: #f8f9fa;
    color: #242424;
}

.items-add-button i,
.items-secondary-button i {
    font-size: 14px;
}

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

.items-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    position: relative;
    margin-bottom: 14px;
    padding: 10px 38px 10px 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 12px;
    line-height: 1.5;
}

.items-alert > i {
    flex: 0 0 auto;
    margin-top: 1px;
    font-size: 14px;
}

.items-alert .btn-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 12px;
    height: 12px;
    padding: 0;
    background-size: 10px;
}

.items-alert-success {
    border-color: #d6eadc;
    background: #f1f9f3;
    color: #3f704d;
}

.items-alert-danger {
    border-color: #efd7d7;
    background: #fff5f5;
    color: #a44d4d;
}

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

.items-filter-card {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.items-filter-form {
    display: grid;
    grid-template-columns: minmax(240px, 1.6fr) minmax(160px, 1fr) minmax(
            150px,
            0.9fr
        ) auto auto;
    align-items: center;
    gap: 9px;
}

.items-search {
    position: relative;
    min-width: 0;
}

.items-search > i {
    position: absolute;
    top: 50%;
    left: 11px;
    z-index: 1;
    color: #929aa5;
    font-size: 13px;
    transform: translateY(-50%);
}

.items-search input {
    width: 100%;
    height: 38px;
    padding: 8px 11px 8px 33px;
    border: 1px solid #dfe3e8;
    border-radius: 7px;
    outline: none;
    background: #fff;
    color: #34383f;
    font-size: 12px;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.items-search input::placeholder {
    color: #a1a8b1;
}

.items-search input:focus {
    border-color: #aeb5bf;
    box-shadow: 0 0 0 3px rgba(36, 36, 36, 0.05);
}

.items-filter-select {
    min-width: 0;
}

.items-filter-select select {
    width: 100%;
    height: 38px;
    padding: 8px 30px 8px 11px;
    border: 1px solid #dfe3e8;
    border-radius: 7px;
    outline: none;
    background-color: #fff;
    color: #596270;
    font-size: 12px;
    cursor: pointer;
}

.items-filter-select select:focus {
    border-color: #aeb5bf;
    box-shadow: 0 0 0 3px rgba(36, 36, 36, 0.05);
}

.items-filter-button,
.items-filter-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.items-filter-button {
    border: 1px solid var(--layout-primary);
    background: var(--layout-primary);
    color: #ffffff;
    cursor: pointer;
}

.items-filter-button:hover {
    border-color: var(--layout-primary-dark);
    background: var(--layout-primary-dark);
    color: #ffffff;
}

.items-filter-reset {
    border: 1px solid #e0e3e7;
    background: #fff;
    color: #697382;
}

.items-filter-reset:hover {
    background: #f7f8f9;
    color: #34383f;
}

/* =========================================================
   TABLE CARD
   ========================================================= */

.items-card {
    overflow: visible;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

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

.items-card-header h2 {
    margin: 0 0 3px;
    color: #30343b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.items-card-header p {
    margin: 0;
    color: #8a929d;
    font-size: 12px;
    line-height: 1.45;
}

.items-card-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 27px;
    padding: 4px 9px;
    border-radius: 6px;
    background: #f4f5f6;
    color: #626b78;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

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

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

.items-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.items-table thead th {
    padding: 10px 13px;
    border-bottom: 1px solid #e9ebee;
    background: #fafbfc;
    color: #737c89;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.items-table tbody td {
    padding: 11px 13px;
    border-bottom: 1px solid #f0f1f3;
    color: #626b78;
    font-size: 12px;
    line-height: 1.4;
    vertical-align: middle;
}

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

.items-table tbody tr:hover {
    background: #fcfcfd;
}

.items-table .item-row-inactive {
    background: #fcfcfc;
}

.items-table .item-row-inactive:hover {
    background: #fafafa;
}

/* =========================================================
   NUMBER
   ========================================================= */

.items-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    color: #929aa6;
    font-size: 11px;
}

/* =========================================================
   ITEM NAME
   ========================================================= */

.item-name-wrapper {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 190px;
}

.item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 7px;
    background: #f4f5f6;
    color: #68717e;
    font-size: 14px;
}

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

.item-name-content strong {
    overflow: hidden;
    color: #34383f;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-low-stock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #9a6b14;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.3;
}

.item-low-stock i {
    font-size: 9px;
}

/* =========================================================
   CATEGORY / UNIT
   ========================================================= */

.item-category {
    color: #626b78;
    font-size: 12px;
}

.items-table tbody td:nth-child(4) {
    color: #626b78;
    font-size: 12px;
}

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

.items-table tbody td strong {
    color: #34383f;
    font-size: 12px;
    font-weight: 600;
}

.items-table tbody td strong.stock-low {
    color: #a16d16;
}

.items-table tbody td:nth-child(6) {
    color: #737c89;
    font-size: 12px;
}

/* =========================================================
   STATUS
   ========================================================= */

.item-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.item-status i {
    font-size: 10px;
}

.item-status-active {
    background: #edf7f0;
    color: #36744a;
}

.item-status-inactive {
    background: #f3f4f5;
    color: #7b838d;
}

/* =========================================================
   ACTION
   ========================================================= */

.item-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #7b8490;
    cursor: pointer;
    transition: all 0.15s ease;
}

.item-action-button:hover,
.item-action-button[aria-expanded="true"] {
    border-color: #e3e6e9;
    background: #f7f8f9;
    color: #34383f;
}

.item-action-button i {
    font-size: 15px;
}

/* =========================================================
   GLOBAL ACTION MENU
   ========================================================= */

.items-global-action-menu {
    position: fixed;
    z-index: 1080;
    width: 175px;
    padding: 5px;
    border: 1px solid #e3e6e9;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}

.items-global-action-menu[hidden] {
    display: none !important;
}

.items-global-action-menu a,
.items-global-action-menu button {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
    padding: 8px 9px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #4f5865;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.items-global-action-menu a:hover,
.items-global-action-menu button:hover {
    background: #f5f6f7;
    color: #242424;
}

.items-global-action-menu i {
    width: 15px;
    color: #7d8692;
    font-size: 13px;
    text-align: center;
}

.items-global-action-menu .warning {
    color: #946a1c;
}

.items-global-action-menu .warning i {
    color: #946a1c;
}

.items-global-action-menu .warning:hover {
    background: #fff9ed;
    color: #805b12;
}

.items-global-action-menu .success {
    color: #3f754f;
}

.items-global-action-menu .success i {
    color: #3f754f;
}

.items-global-action-menu .success:hover {
    background: #f1f9f3;
    color: #32633f;
}

.items-global-action-menu .danger {
    color: #b44b4b;
}

.items-global-action-menu .danger i {
    color: #b44b4b;
}

.items-global-action-menu .danger:hover {
    background: #fff5f5;
    color: #a43f3f;
}

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

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

.items-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 11px;
    border-radius: 9px;
    background: #f5f6f7;
    color: #8a929d;
    font-size: 19px;
}

.items-empty h6 {
    margin: 0 0 5px;
    color: #454b54;
    font-size: 14px;
    font-weight: 700;
}

.items-empty p {
    max-width: 360px;
    margin: 0;
    color: #8b939e;
    font-size: 12px;
    line-height: 1.5;
}

.items-empty-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    min-height: 35px;
    padding: 7px 12px;
    border: 1px solid #e0e3e7;
    border-radius: 7px;
    background: #fff;
    color: #596474;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.items-empty-button:hover {
    background: #f7f8f9;
    color: #242424;
}

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

.items-pagination {
    display: flex;
    justify-content: flex-end;
    padding: 12px 20px;
    border-top: 1px solid #eef0f2;
}

.items-pagination .pagination {
    margin: 0;
}

.items-pagination .page-link {
    min-width: 30px;
    height: 30px;
    padding: 5px 8px;
    border-color: #e4e7eb;
    color: #68717e;
    font-size: 11px;
    text-align: center;
}

.items-pagination .page-item.active .page-link {
    border-color: #242424;
    background: #242424;
    color: #fff;
}

.items-pagination .page-link:hover {
    background: #f5f6f7;
    color: #242424;
}

/* =========================================================
   MODAL
   ========================================================= */

.items-modal {
    border: 0;
    border-radius: 10px;
    box-shadow: 0 15px 40px rgba(16, 24, 40, 0.16);
}

.items-modal .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 17px 20px;
    border-bottom: 1px solid #edf0f2;
}

.items-modal .modal-header h5 {
    margin: 0 0 3px;
    color: #30343b;
    font-size: 15px;
    font-weight: 700;
}

.items-modal .modal-header p {
    margin: 0;
    color: #8a929d;
    font-size: 11px;
    line-height: 1.4;
}

.items-modal .modal-body {
    padding: 20px;
}

.items-modal .modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    padding: 13px 20px;
    border-top: 1px solid #edf0f2;
}

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

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

.items-form-group label {
    display: block;
    margin-bottom: 6px;
    color: #596270;
    font-size: 12px;
    font-weight: 600;
}

.items-form-group .form-control,
.items-form-group .form-select {
    min-height: 38px;
    border-color: #dfe3e8;
    border-radius: 7px;
    font-size: 12px;
}

.items-form-group .form-control:focus,
.items-form-group .form-select:focus {
    border-color: #aeb5bf;
    box-shadow: 0 0 0 3px rgba(36, 36, 36, 0.05);
}

.items-form-group small {
    display: block;
    margin-top: 5px;
    color: #969da7;
    font-size: 10px;
    line-height: 1.4;
}

.items-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.items-stock-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 15px;
    padding: 10px 11px;
    border: 1px solid #e2e7ec;
    border-radius: 7px;
    background: #f8fafb;
    color: #68717e;
    font-size: 11px;
    line-height: 1.45;
}

.items-stock-info i {
    flex: 0 0 auto;
    margin-top: 1px;
    color: #7b8794;
    font-size: 13px;
}

/* =========================================================
   SHOW PAGE
   ========================================================= */

.item-show-page .items-page-header {
    margin-bottom: 20px;
}

.item-show-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 16px;
    align-items: start;
}

/* =========================================================
   DETAIL CARD
   ========================================================= */

.item-detail-card {
    overflow: hidden;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.item-detail-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 20px;
    border-bottom: 1px solid #eef0f2;
}

.item-detail-label {
    display: block;
    margin-bottom: 4px;
    color: #929aa5;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.3;
}

.item-detail-title {
    margin: 0;
    color: #30343b;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.item-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.item-status-badge.active {
    background: #edf7f0;
    color: #36744a;
}

.item-status-badge.inactive {
    background: #f3f4f5;
    color: #7b838d;
}

.item-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 8px;
    background: #f4f5f6;
    color: #68717e;
    font-size: 15px;
}

.item-detail-body {
    padding: 4px 20px 18px;
}

/* =========================================================
   ITEM INFO
   ========================================================= */

.item-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f1f3;
}

.item-info-row:last-child {
    border-bottom: 0;
}

.item-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 33px;
    height: 33px;
    flex: 0 0 33px;
    border-radius: 7px;
    background: #f5f6f7;
    color: #707985;
    font-size: 14px;
}

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

.item-info-content span {
    color: #8b939e;
    font-size: 11px;
    line-height: 1.4;
}

.item-info-content strong {
    color: #34383f;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

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

.item-stock-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 11px;
    border: 1px solid #f0dfb9;
    border-radius: 7px;
    background: #fffaf0;
    color: #8a651c;
    font-size: 11px;
    line-height: 1.45;
}

.item-stock-warning i {
    flex: 0 0 auto;
    margin-top: 1px;
    font-size: 13px;
}

/* =========================================================
   ACTIVITY
   ========================================================= */

.item-activity-list {
    padding: 4px 20px 18px;
}

.item-activity-row {
    display: flex;
    gap: 11px;
    padding: 13px 0;
    border-bottom: 1px solid #f0f1f3;
}

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

.item-activity-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 7px;
    font-size: 12px;
}

.item-activity-icon.created {
    background: #edf7f0;
    color: #36744a;
}

.item-activity-icon.updated {
    background: #eef4fb;
    color: #4c6f99;
}

.item-activity-icon.deleted {
    background: #fff0f0;
    color: #b44b4b;
}

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

.item-activity-content strong {
    color: #3e444d;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.item-activity-content span {
    color: #707985;
    font-size: 11px;
    line-height: 1.4;
}

.item-activity-content small {
    color: #969da7;
    font-size: 10px;
    line-height: 1.4;
}

.item-empty-activity {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 30px 20px;
    color: #929aa5;
    text-align: center;
}

.item-empty-activity i {
    margin-bottom: 9px;
    font-size: 22px;
}

.item-empty-activity span {
    font-size: 12px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
    .items-filter-form {
        grid-template-columns: minmax(220px, 1fr) minmax(150px, 1fr);
    }

    .items-filter-button,
    .items-filter-reset {
        width: 100%;
    }

    .item-show-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .items-page-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .items-page-header-actions {
        width: 100%;
    }

    .items-add-button,
    .items-secondary-button {
        width: 100%;
    }

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

    .items-table {
        min-width: 760px;
    }

    .items-card-header {
        align-items: flex-start;
        padding: 15px 16px;
    }

    .items-filter-card {
        padding: 12px;
    }

    .items-pagination {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .items-page-title {
        font-size: 21px;
    }

    .items-page-subtitle {
        font-size: 12px;
    }

    .items-breadcrumb {
        font-size: 11px;
    }

    .items-breadcrumb a {
        font-size: 11px;
    }

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

    .items-modal .modal-body {
        padding: 16px;
    }

    .items-modal .modal-header {
        padding: 15px 16px;
    }

    .items-modal .modal-footer {
        padding: 12px 16px;
    }

    .item-detail-card-header {
        align-items: flex-start;
        padding: 15px 16px;
    }

    .item-detail-body,
    .item-activity-list {
        padding-left: 16px;
        padding-right: 16px;
    }

    .item-detail-title {
        font-size: 14px;
    }
}
