/* ===== List Card Layout ===== */

.list-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    background: #fff;
    border-radius: 8px 8px 0 0;
}

.list-card-header-flush {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 0 14px 0;
    background: #fff;
}

.list-card-header:only-child {
    border-radius: 8px;
}

.list-card-body:first-child {
    border-radius: 8px;
}

.list-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

    .list-card-title h5 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
        color: #212529;
        white-space: nowrap;
    }

.list-card-icon {
    font-size: 1.3rem;
    color: #6c757d;
    opacity: 0.7;
}

.list-card-filter-summary {
    display: inline;
    margin-top: 2px;
}

    .list-card-filter-summary .text-muted {
        word-break: break-word;
    }

.list-card-filter-clear {
    color: #dc3545;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    margin-left: 4px;
    white-space: nowrap;
}

    .list-card-filter-clear:hover {
        color: #a71d2a;
    }

.list-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.list-card-search {
    min-width: 0;
}

.list-card-actions-separator {
    width: 1px;
    height: 20px;
    background: #dee2e6;
}

.list-card-body {
    padding: 0;
    overflow: visible;
    border-radius: 0 0 8px 8px;
}

.list-card-divider {
    margin: 0;
    border-top: 1px solid #e9ecef;
}

.list-card-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #fff;
    border-radius: 0 0 8px 8px;
}

/* Remove wrapper border/radius inside card – the card provides it */
.list-card-body .grid-enhanced-wrapper {
    border: none;
    border-radius: 0;
}

/* ===== Detail Card Layout (Edit / Insert / Details) ===== */

.detail-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
    border-radius: 8px 8px 0 0;
}

    .detail-card-header:only-child {
        border-radius: 8px;
        border-bottom: none;
    }

.detail-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

    .detail-card-title h5 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
        color: #212529;
    }

.detail-card-subtitle {
    display: block;
    margin-top: 1px;
}

.detail-card-icon {
    font-size: 1.3rem;
    color: #6c757d;
    opacity: 0.7;
}

.detail-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-card-body {
    padding: 16px 18px;
}

/* Scrollable detail card - tab body scrolls, page does not scroll */
.detail-card-scrollable {
    display: flex;
    flex-direction: column;
}

    .detail-card-scrollable .detail-card-body {
        padding: 0;
        overflow: hidden;
    }

    .detail-card-scrollable .tab-content {
        overflow: hidden;
    }

/* Suppress Bootstrap's fade transition on tab panes to prevent layout flash */
.tab-pane-scroll.fade {
    transition: none !important;
    opacity: 1 !important;
}

.tab-pane-scroll {
    display: none;
}

    .tab-pane-scroll.active {
        display: block;
        visibility: hidden;
    }

        .tab-pane-scroll.active.show {
            visibility: visible;
        }

.detail-card-scrollable .tab-content .tab-pane-scroll.active.show {
    max-height: calc(100vh - 340px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 18px;
    box-sizing: border-box;
}

    .detail-card-scrollable .tab-content .tab-pane-scroll.active.show .grid-enhanced-wrapper,
    .detail-card-scrollable .tab-content .tab-pane-scroll.active.show .table-responsive {
        max-height: calc(100vh - 360px);
        overflow-y: auto;
    }

        .detail-card-scrollable .tab-content .tab-pane-scroll.active.show .grid-enhanced-wrapper .table thead th,
        .detail-card-scrollable .tab-content .tab-pane-scroll.active.show .table-responsive .table thead th,
        .tab-pane-scroll.active.show .grid-enhanced-wrapper .table thead th,
        .grid-enhanced-wrapper .table thead th {
            position: sticky;
            top: 0;
            z-index: 2;
            background: #fff;
        }

.detail-card-scrollable .nav-tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    flex-shrink: 0;
    padding: 0 18px;
    border-bottom: 2px solid #e9ecef;
    margin: 0;
}

/* ===== Tab styling inside detail cards ===== */

.detail-card-body .nav-tabs {
    border-bottom: 2px solid #e9ecef;
    padding: 0;
    margin: 0 0 16px 0;
}

    .detail-card-body .nav-tabs .nav-link {
        border: none;
        border-bottom: 2px solid transparent;
        color: #6c757d;
        font-weight: 500;
        font-size: 0.9rem;
        padding: 8px 16px;
        margin-bottom: -2px;
        transition: color 0.15s, border-color 0.15s;
    }

        .detail-card-body .nav-tabs .nav-link:hover {
            color: #495057;
            border-bottom-color: #adb5bd;
        }

        .detail-card-body .nav-tabs .nav-link.active {
            color: #324E76;
            border-bottom-color: #324E76;
            background: transparent;
        }

/* Fix form labels inside tab groups - push right with more space */
.detail-card-body .form-group.row {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    padding: 6px 0;
}

    .detail-card-body .form-group.row .col-form-label {
        padding-left: 4px;
    }

/* ===== Breadcrumb Card ===== */

.breadcrumb-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    padding: 10px 18px;
    margin-bottom: 16px;
}

    .breadcrumb-card .breadcrumb {
        margin: 0;
        padding: 0;
        background: transparent;
    }

.detail-card-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

    .detail-card-table tr {
        border-bottom: 1px solid #f0f0f0;
    }

        .detail-card-table tr:last-child {
            border-bottom: none;
        }

        .detail-card-table tr:hover {
            background: #f8f9fa;
        }

    .detail-card-table td {
        padding: 10px 18px;
        vertical-align: middle;
    }

        .detail-card-table td:first-child {
            font-weight: 500;
            color: #495057;
            white-space: nowrap;
            width: 220px;
            background: rgba(0, 0, 0, 0.01);
        }

.detail-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid #e9ecef;
    background: #fff;
}

/* ===== Button Color Overrides ===== */

.btn-primary {
    background-color: #324E76;
    border-color: #324E76;
}

    .btn-primary:hover,
    .btn-primary:focus,
    .btn-primary:not(:disabled):not(.disabled):active,
    .btn-primary:not(:disabled):not(.disabled).active,
    .show > .btn-primary.dropdown-toggle {
        background-color: #283f5f;
        border-color: #283f5f;
        box-shadow: none;
    }

.btn-success {
    background-color: #3a9d5c;
    border-color: #3a9d5c;
}

    .btn-success:hover,
    .btn-success:focus,
    .btn-success:not(:disabled):not(.disabled):active,
    .btn-success:not(:disabled):not(.disabled).active,
    .show > .btn-success.dropdown-toggle {
        background-color: #328a50;
        border-color: #328a50;
        box-shadow: none;
    }

.btn-danger {
    background-color: #c9444d;
    border-color: #c9444d;
}

    .btn-danger:hover,
    .btn-danger:focus,
    .btn-danger:not(:disabled):not(.disabled):active,
    .btn-danger:not(:disabled):not(.disabled).active,
    .show > .btn-danger.dropdown-toggle {
        background-color: #b33b43;
        border-color: #b33b43;
        box-shadow: none;
    }

.btn-info {
    background-color: #3a8fb5;
    border-color: #3a8fb5;
    color: #fff;
}

    .btn-info:hover,
    .btn-info:focus,
    .btn-info:not(:disabled):not(.disabled):active,
    .btn-info:not(:disabled):not(.disabled).active,
    .show > .btn-info.dropdown-toggle {
        background-color: #327da0;
        border-color: #327da0;
        color: #fff;
        box-shadow: none;
    }

.btn-warning {
    background-color: #c99a2e;
    border-color: #c99a2e;
    color: #fff;
}

    .btn-warning:hover,
    .btn-warning:focus,
    .btn-warning:not(:disabled):not(.disabled):active,
    .btn-warning:not(:disabled):not(.disabled).active,
    .show > .btn-warning.dropdown-toggle {
        background-color: #b38828;
        border-color: #b38828;
        color: #fff;
        box-shadow: none;
    }

.btn-secondary {
    background-color: #5a6473;
    border-color: #5a6473;
}

    .btn-secondary:hover,
    .btn-secondary:focus,
    .btn-secondary:not(:disabled):not(.disabled):active,
    .btn-secondary:not(:disabled):not(.disabled).active,
    .show > .btn-secondary.dropdown-toggle {
        background-color: #4e5766;
        border-color: #4e5766;
        box-shadow: none;
    }

.btn-outline-secondary {
    color: #5a6473;
    border-color: #ced4da;
}

    .btn-outline-secondary:hover,
    .btn-outline-secondary:focus,
    .btn-outline-secondary:not(:disabled):not(.disabled):active,
    .btn-outline-secondary:not(:disabled):not(.disabled).active,
    .show > .btn-outline-secondary.dropdown-toggle {
        background-color: #f0f2f5;
        color: #3d4654;
        border-color: #b8bfc9;
        box-shadow: none;
    }

/* ===== Modal centering in sidebar layout ===== */

/* When sidebar is open (260px wide), offset the modal so it centers on the content area */
@media screen and (min-width: 768px) {
    .page-wrapper.toggled .modal {
        padding-left: 260px;
    }
}

/* ===== Link Color Overrides ===== */

a {
    color: #324E76;
}

    a:hover {
        color: #283f5f;
    }
