/* Shared registry page overrides to match the design
   Used by Entities and Assets pages */

/* Card + filter */
.card.mb-3 { border-radius: 12px; box-shadow: 0 6px 12px rgba(0,0,0,0.06); border: 0; background: #fff; }
.card.mb-3 .card-body { padding: 18px 20px; }

/* Filter inputs */
/* Remove legacy fixed widths that cause overlap in grid layout */
.registry-filter .form-control:not(.form-control-sm), #entityFilterForm .form-control:not(.form-control-sm), #assetFilterForm .form-control:not(.form-control-sm) { height:56px; border-radius:10px; border:1px solid rgba(123,128,154,0.08); background:#fff; padding:.6rem .9rem; box-shadow:none; font-size:0.95rem; }
/* #filter_name, #filter_email, #assetFilterName, #assetFilterEmail { min-width:260px; } */
/* #filter_type, #assetFilterType { min-width:140px; height:auto; border-radius:8px; } */

/* Ensure compact selects inside the .filter-small card match the small inputs */
.filter-small select.form-control.form-control-sm { height:34px; padding:.26rem .5rem; border-radius:8px; background: transparent; border:1px solid rgba(0,0,0,0.06); }

/* Filter card + compact inputs and buttons (User Management style) */
.filter-small { width: 100%; background: #fff; border-radius: 12px; padding: .6rem .9rem; box-shadow: 0 8px 20px rgba(13,22,33,0.06); border: 1px solid rgba(0,0,0,0.03); display:flex; align-items:center; flex-wrap:wrap; gap:.6rem; }

/* compact inputs inside the card */
.filter-small .form-control.form-control-sm { height: 34px; padding: .26rem .5rem; font-size: .80rem; border-radius: 8px; border:1px solid rgba(0,0,0,0.06); background: transparent; }
.filter-small .input-group { max-width: 220px; }
.filter-small .input-group-text { background: transparent; border-right: none; color:#7b809a; }
.filter-small .input-group .form-control { border-left: none; }

/* buttons aligned to the right inside the card */
.filter-small .ms-auto { display:flex; gap:.5rem; align-items:center; }

/* compact, pill-like filter buttons (search + clear) */
.filter-small .btn { font-size: .65rem; padding: .36rem .85rem; min-width: 72px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.filter-small .btn .material-icons { font-size: 16px; margin-right: 8px; vertical-align: middle; }

/* primary search button - stronger shadow and uppercase like User Management */
#filterSearch.btn-primary, #assetFilterSearch.btn-primary { background: linear-gradient(90deg,#ec407a 0%,#d81b60 100%); border-color: transparent; box-shadow: 0 10px 24px rgba(233,30,99,0.18); color:#fff; padding:.45rem .85rem; border-radius:10px; font-weight:700; text-transform:uppercase; font-size: 0.65rem; }
#filterSearch.btn-primary:hover, #assetFilterSearch.btn-primary:hover { transform: translateY(-2px); }

/* clear/outline button */
#filterClear.btn-outline-secondary, #assetFilterClear.btn-outline-secondary { border-radius:10px; padding:.36rem .7rem; border-color: rgba(0,0,0,0.08); background: transparent; box-shadow: 0 6px 16px rgba(0,0,0,0.04); color:#42464e; }
#filterClear.btn-outline-secondary:hover, #assetFilterClear.btn-outline-secondary:hover { background: rgba(0,0,0,0.03); }


/* Ensure small icons align nicely */
.filter-small .material-icons { font-size: 16px; vertical-align: middle; }


/* Card header Add Asset/Entity button */
.card-header .bg-gradient-primary { background: linear-gradient(90deg,#ec407a 0%,#d81b60 100%) !important; color:#fff !important; box-shadow: 0 8px 18px rgba(233,30,99,0.18) !important; border-radius:8px !important; padding:.5rem .8rem !important; text-transform:uppercase; font-weight:700; }

/* Floating small ADD button */
#entityAddBtn, #assetAddBtn { box-shadow: 0 8px 20px rgba(0,0,0,0.2); border-radius:8px; background:#263845; color:#fff; padding:.4rem .7rem; display:inline-block; font-size: .65rem; text-transform: uppercase; font-weight: 700; }

/* Tabs */
.nav-tabs { border-bottom: 1px solid rgba(0,0,0,0.06); padding-left: 8px; }
.nav-tabs .nav-link { color: #e91e63; border: none; border-radius: 8px 8px 0 0; margin-right: 8px; padding: .4rem .6rem; font-weight:600; font-size: 0.75rem; }
.nav-tabs .nav-link.active{ background:#fff; color:#e91e63; box-shadow: 0 6px 12px rgba(0,0,0,0.06); }

/* Table card and rows */
.tab-pane .card { border-radius: 12px; box-shadow: 0 6px 12px rgba(0,0,0,0.06); border: 0; overflow: hidden; margin-top: 6px; }
.tab-pane .card .card-body { padding: 0; }
.table thead th { font-weight:700; color:#6c6f7a; padding:18px; background:#fff; font-size: 0.75rem !important; }
.table td, .table th { vertical-align: middle; color:#7b809a; border-top: 1px solid rgba(0,0,0,0.03); white-space: normal !important; font-size: 0.75rem !important; }
.table tbody td { padding:16px 18px; }
.table img, .entity-logo { width:48px; height:48px; object-fit:cover; border-radius:8px; display:inline-block; }

.entity-empty { min-height:96px; display:flex; align-items:center; color:#7b809a; padding-left:10px; background:#fff; border-radius:8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02); }

/* Action buttons */
.table .btn-group { display:flex; gap:.5rem; align-items:center; justify-content:center; }
.table td .btn-group { width:100%; justify-content:center; }

/* Ensure last column (Actions) is always centered and its buttons are centered in the cell */
.table th:last-child, .table td:last-child { text-align: center !important; }
.table td:last-child .btn-group { justify-content:center; display:flex; }
/* Force a consistent, compact pill for table action buttons. Icon-only buttons (with .btn-icon) are excluded so their sizing remains natural. */
.table .btn-group .btn { border-radius:999px; padding:.18rem .45rem; text-transform:uppercase; font-size:.65rem; font-weight:600; letter-spacing:.02em; transition: all .12s ease; -webkit-appearance: none; appearance: none; display:inline-flex; justify-content:center; align-items:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:72px; max-width:92px; width:88px; }

.table .btn-group .btn.btn-icon { min-width: auto; width: auto; padding:.18rem .4rem; }

/* New themed action buttons (high specificity to override defaults) */
.table .btn.btn-action-view { color:#6c6f7a; border:1px solid rgba(0,0,0,0.06); background:transparent; }
.table .btn.btn-action-view:hover { background: rgba(0,0,0,0.03); color:#4b5563; }
.table .btn.btn-action-view:focus { box-shadow: 0 0 0 4px rgba(76,86,108,0.06); outline: none; }

.table .btn.btn-action-edit { color:#ec407a; border:1px solid #ec407a; background:transparent; }
.table .btn.btn-action-edit:hover { background: linear-gradient(90deg,#ec407a 0%,#d81b60 100%); color:#fff; box-shadow: 0 8px 18px rgba(236,64,122,0.12); }
.table .btn.btn-action-edit:focus { box-shadow: 0 0 0 4px rgba(236,64,122,0.08); outline: none; }

.table .btn.btn-action-owner { color:#2e7d32; border:1px solid #4caf50; background:transparent; }
.table .btn.btn-action-owner:hover { background: linear-gradient(90deg,#66bb6a 0%,#43a047 100%); color:#fff; box-shadow: 0 8px 18px rgba(76,175,80,0.12); }
.table .btn.btn-action-owner:focus { box-shadow: 0 0 0 4px rgba(76,175,80,0.06); outline: none; }

.table .btn.btn-action-delete { color:#f44336; border:1px solid #f44336; background:transparent; }
.table .btn.btn-action-delete:hover { background: linear-gradient(90deg,#ff7043 0%,#f44336 100%); color:#fff; box-shadow: 0 8px 18px rgba(244,67,54,0.12); }
.table .btn.btn-action-delete:focus { box-shadow: 0 0 0 4px rgba(244,67,54,0.06); outline: none; }

/* Ensure consistent small size */
.table .btn-sm { padding:.18rem .45rem; min-width:48px; text-align:center; font-size:.65rem; border-radius:999px; }

/* Ensure all buttons inside tables are small and visually consistent */
.table .btn { padding: .15rem .45rem !important; font-size: .65rem !important; min-width: 42px !important; border-radius: 999px !important; }
.table .btn:not(.btn-action-view):not(.btn-action-edit):not(.btn-action-owner):not(.btn-action-delete):not(.btn-primary) { color:#6c6f7a; border:1px solid rgba(0,0,0,0.06); background:transparent; }

/* Icon alignment inside buttons */
.btn .material-icons { font-size:13px; vertical-align:middle; margin-right:.25rem; display:inline-block; line-height:1; }
.btn .material-icons:last-child { margin-right:0; }

/* App-wide button baseline: unify look and feel across the application */
.btn {
    border-radius: 8px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .02em !important;
    padding: .3rem .6rem !important;
    font-size: .65rem !important;
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease !important;
    box-shadow: none !important;
    vertical-align: middle !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
.btn:focus, .btn:active {
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(0,0,0,0.06) !important;
}
.btn-sm { padding: .2rem .5rem !important; font-size: .65rem !important; min-width: 56px !important; }

/* Primary buttons use the app gradient by default */
.btn-primary {
    background: linear-gradient(90deg,#ec407a 0%,#d81b60 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(233,30,99,0.12) !important;
}
.btn-outline-secondary { background: transparent !important; border: 1px solid rgba(0,0,0,0.08) !important; color: #6c6f7a !important; }
.btn-outline-danger { background: transparent !important; border: 1px solid #f44336 !important; color: #f44336 !important; }

/* Make outline-style buttons have subtle hover fills */
.btn-outline-secondary:hover { background: rgba(0,0,0,0.03) !important; color: #42464e !important; }
.btn-outline-danger:hover { background: linear-gradient(90deg,#ffb4a8 0%,#ff7043 100%) !important; color: #fff !important; }

/* Fallback: ensure btn-action classes get styled even if .table scope doesn't match */
.btn-action-view, .btn-action-edit, .btn-action-owner, .btn-action-delete {
    border-radius: 6px !important;
    padding: .2rem .45rem !important;
    font-weight: 700 !important;
    font-size: 0.65rem !important;
    text-transform: uppercase !important;
    line-height: 1.3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px;
}
.btn-action-view .material-icons, 
.btn-action-edit .material-icons, 
.btn-action-owner .material-icons, 
.btn-action-delete .material-icons {
    font-size: 13px !important;
    margin: 0 !important;
}

.btn-action-view { color:#6c6f7a !important; border:1px solid rgba(0,0,0,0.06) !important; background:transparent !important; }
.btn-action-edit { color:#ec407a !important; border:1px solid #ec407a !important; background:transparent !important; }
.btn-action-owner { color:#2e7d32 !important; border:1px solid #4caf50 !important; background:transparent !important; }
.btn-action-delete { color:#f44336 !important; border:1px solid #f44336 !important; background:transparent !important; }
.btn-action-edit:hover { background: linear-gradient(90deg,#ec407a 0%,#d81b60 100%) !important; color:#fff !important; }
.btn-action-owner:hover { background: linear-gradient(90deg,#66bb6a 0%,#43a047 100%) !important; color:#fff !important; }
.btn-action-delete:hover { background: linear-gradient(90deg,#ff7043 0%,#f44336 100%) !important; color:#fff !important; }

/* Registry 'Add' buttons matching btn-primary-custom metrics */
#entityAddBtn, #assetAddBtn {
    font-size: 0.75rem !important;
    padding: 6px 16px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px){
  #filter_name, #filter_email, #assetFilterName, #assetFilterEmail { min-width: 100px; }
  .nav-tabs .nav-link { padding: 8px 12px; }
}


/* Defensive: hide any tiny (<=2px) black bars immediately following form controls (addresses rogue artifacts) */
select.form-control + *, select.form-control + hr, select.form-control + div {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: none !important;
}
/* Fallback: hide any immediate sibling with explicit black background style */
select.form-control + *[style*="background: #000"],
select.form-control + *[style*="background-color: #000"],
select.form-control + *[style*="background:#000"],
select.form-control + *[style*="background-color: rgb(0, 0, 0)"] {
    display: none !important;
}

/* Ensure transporter selects are visually normal and layered above any artifacts */
select.transporter-select, #assetModal select.transporter-select, #entityModal select.transporter-select {
    background: #fff !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: none !important;
    outline: none !important;
    position: relative !important;
    z-index: 3 !important;
}
#assetModal .modal-body, #entityModal .modal-body { overflow: visible !important; }


/* ============================================
   Global Pagination Styles
   ============================================ */
/* Consistent pagination across all tables */
.pagination-wrapper {
    display: flex;
    justify-content: flex-end;
    padding: 1rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6c6f7a;
    background: transparent;
    border: none;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.15s ease;
}

.pagination .page-item .page-link:hover {
    background: rgba(236, 64, 122, 0.08);
    color: #ec407a;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(90deg, #ec407a 0%, #d81b60 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.25);
}

.pagination .page-item.disabled .page-link {
    color: #c4c4c4;
    pointer-events: none;
    background: transparent;
}

/* Arrow buttons */
.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
    font-size: 1rem;
    color: #8c8c8c;
}

.pagination .page-item:first-child .page-link:hover,
.pagination .page-item:last-child .page-link:hover {
    color: #ec407a;
    background: transparent;
}

/* Ellipsis */
.pagination .page-item .page-link.ellipsis {
    pointer-events: none;
    color: #6c6f7a;
}

/* Override Bootstrap pagination defaults */
.pagination-sm .page-link {
    padding: 0;
    line-height: 32px;
}

/* Table pagination placement */
.table-pagination {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
}

