﻿/* ===============================
   INDEX HEADER STRIP (GLOBAL)
   Used by Inward / Outward / Booking
   =============================== */

.index-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    background: linear-gradient(180deg, #326492 0%, #285680 100%);
    color: #fff;
    border: 1px solid #244e75;
    border-radius: 6px 6px 0 0;
    padding: 6px 14px;
    box-shadow: 0 1px 2px rgba(15, 45, 70, .18);
}

    /* Title (left side) */
    .index-strip .index-title {
        margin-right: auto;
        font-size: 16px;
        font-weight: 600;
        white-space: nowrap;
    }

    /* Search textbox */
    .index-strip .index-search {
        width: min(320px, 32vw);
        max-width: 320px;
        height: 34px;
        font-size: 13px;
        border: 1px solid #c8d1dc;
        border-radius: 6px;
    }

    /* Date picker */
    .index-strip .index-date {
        height: 34px;
        font-size: 13px;
        border: 1px solid #c8d1dc;
        border-radius: 6px;
    }

    /* Buttons */
    .index-strip .btn {
        height: 34px;
        font-size: 13px;
        padding: 0 13px;
        border-radius: 6px;
    }

    /* Push right-side items (date) */
    .index-strip .push-right {
        margin-left: 0;
        display: flex;
        align-items: center;
        gap: 5px;
    }

/* ===============================
   GRID CONTAINER (INDEX PAGES)
   =============================== */

.index-grid {
    padding: 10px 0 0;
}

    .index-grid table {
        margin-bottom: 0;
    }

    /* Empty grid row */
    .index-grid .empty-row {
        text-align: center;
        font-weight: 500;
        color: #6c757d;
    }
.grid-wrapper {
    max-width: 1000px; /* SAFE for 1024x768 */
    margin: 0 auto; /* Center on large monitors */
    overflow-x: auto; /* Safety net */
}
.table {
    font-size: 13px;
}

    .table th,
    .table td {
        padding: 6px 8px;
    }

/* Grid Header */
.table thead th {
    background: linear-gradient(180deg, #effaf8 0%, #c6e5e1 100%);
    color: #073b42;
    font-weight: 500;
    text-align: left;
    vertical-align: middle;
    border: 1px solid #b9d7d4;
    border-bottom: 1px solid #a9ccc8;
    white-space: nowrap;
}
    .table thead th a {
        color: #073b42 !important;
        text-decoration: none;
    }

        .table thead th a:hover {
            text-decoration: underline;
        }

.table tbody td {
    vertical-align: middle;
    white-space: nowrap;
    background-color: rgba(255, 255, 255, .94);
    border-color: #d9dee3;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: #ffffff;
    color: inherit;
}

.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: #eef7f6;
    color: inherit;
}

/* =============================== */
/* PAGINATION (GLOBAL STANDARD)    */
/* =============================== */

.index-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin: 14px 0 6px;
}

.index-pagination .small {
    order: -1;
    margin-right: auto;
}

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

.index-pagination .page-link {
    color: #315b82;
    background: #f4f5f6;
    border-color: #d5dbe1;
}

.index-pagination .page-item.active .page-link {
    color: #fff;
    background: #0d6efd;
    border-color: #0d6efd;
}

@media (max-width: 600px) {
    .index-strip {
        flex-wrap: wrap;
        padding: 8px;
    }

    .index-strip .index-title {
        flex: 1 0 100%;
    }

    .index-strip .index-search {
        width: 100%;
        max-width: none;
        flex: 1 1 190px;
    }

    .index-strip .push-right {
        margin-left: 0;
    }

    .index-pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

    .index-pagination .small {
        flex: 1 0 100%;
        margin-right: 0;
        text-align: center;
    }
}

.btn-create {
    height: 36px;
    padding: 0 14px; /* ⭐ fixes square */
    min-width: 90px; /* ⭐ consistent width */
    white-space: nowrap;
}

.filter-bar {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.text-ellipsis {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.table th,
.table td {
    white-space: nowrap;
}
.action-buttons .btn {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 5px;
}

/* ======================================================
   ISoftErpAio visual compatibility for legacy ReMeBox pages
   Older pages use their own header classes or inline cyan.
   Keep them aligned with the shared navy/soft-teal design.
   ====================================================== */
.list-header-bar,
.inward-toolbar {
    min-height: 46px !important;
    height: auto !important;
    padding: 6px 14px !important;
    background: linear-gradient(180deg, #326492 0%, #285680 100%) !important;
    color: #fff !important;
    border: 1px solid #244e75 !important;
    border-radius: 6px 6px 0 0 !important;
    box-shadow: 0 1px 2px rgba(15, 45, 70, .18) !important;
}

.list-header-bar .list-title,
.inward-toolbar .toolbar-left {
    color: #fff !important;
    font-weight: 600 !important;
    text-shadow: none !important;
}

.master-index-toolbar .list-actions {
    margin-left: auto;
}

.master-index-toolbar .search-group {
    width: min(320px, 30vw);
    flex-wrap: nowrap;
}

.master-index-toolbar .search-box {
    width: auto;
    min-width: 180px;
    flex: 1 1 auto;
}

.master-index-toolbar .master-search-btn {
    width: 38px;
    min-width: 38px;
    padding: 0;
    flex: 0 0 38px;
}

.master-index-toolbar .master-page-size {
    width: 82px;
    height: 30px;
}

.master-index-toolbar .master-clear-btn {
    color: #17212b;
    background: #fff;
    border-color: #e0e4e8;
}

.master-index-old-header {
    display: none !important;
}

@media (max-width: 600px) {
    .master-index-toolbar .list-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
    }

    .master-index-toolbar .list-actions > *,
    .master-index-toolbar .search-group {
        width: 100%;
        max-width: none;
        flex: 0 0 auto;
    }

    .master-index-toolbar .search-box {
        width: auto;
        min-width: 0;
    }

    .master-index-toolbar .master-page-size {
        width: 100%;
    }
}

.template-table-box thead th,
.template-table-wrapper thead th,
.grid-area thead th,
.inward-grid thead th,
.table-header th {
    background: linear-gradient(180deg, #effaf8 0%, #c6e5e1 100%) !important;
    color: #073b42 !important;
    border-color: #b9d7d4 !important;
    border-bottom-color: #a9ccc8 !important;
    text-shadow: none !important;
}

.template-table-box tbody td,
.template-table-wrapper tbody td,
.index-grid tbody td {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    line-height: 1.15rem !important;
}

.template-table-box .btn,
.template-table-wrapper .btn,
.index-grid .btn {
    min-height: 26px !important;
    height: 26px;
    padding: 2px 7px !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
}

.template-table-box thead th:first-child {
    background: linear-gradient(180deg, #effaf8 0%, #c6e5e1 100%) !important;
    color: #073b42 !important;
}

.table thead th *,
.template-table-box thead th *,
.template-table-wrapper thead th * {
    color: inherit !important;
}

.booking-header,
.form-header,
.master-card-header,
.erp-modal-header,
.header-strip {
    background: linear-gradient(180deg, #326492 0%, #285680 100%) !important;
    color: #fff !important;
    border-color: #244e75 !important;
}

.form-container [style*="background-color:deepskyblue"],
.form-container [style*="background-color: deepskyblue"],
.master-card [style*="background-color:deepskyblue"],
.master-card [style*="background-color: deepskyblue"],
.template-table-box [style*="background-color:deepskyblue"],
.template-table-box [style*="background-color: deepskyblue"] {
    background-color: #315f8c !important;
    background-image: linear-gradient(180deg, #326492 0%, #285680 100%) !important;
    color: #fff !important;
}

.form-container > .bg-primary,
.master-card > .bg-primary,
.form-container > .card-header.bg-primary,
.master-card > .card-header.bg-primary {
    background: linear-gradient(180deg, #326492 0%, #285680 100%) !important;
    border-color: #244e75 !important;
}

.index-grid,
.template-table-box,
.template-table-wrapper {
    scrollbar-color: #8296a8 #edf1f3;
}
