/*
 * StokHub overrides on top of DreamsPOS style.css
 * - brand tweaks
 * - compatibility shims for legacy Sneat classes still used in older views
 */

:root {
    --sh-primary: #D32F2F;
    --sh-primary-dark: #B02525;
    --sh-primary-soft: #FBECEC;
    --sh-secondary: #092C4C;
    --sh-success: #3EB780;
    --sh-info: #155EEF;
    --sh-warning: #FFCA18;
    --sh-gray-9: #212B36;
    --sh-border: #E6EAED;
}

.swal2-container { z-index: 10001 !important; }
.swal2-styled.swal2-confirm { background-color: var(--sh-primary) !important; }

/* ---------- Sidebar brand ---------- */
.sidebar .sidebar-logo .logo img { max-height: 36px; width: auto; }
.sidebar .sidebar-logo .logo-small img { max-height: 32px; width: auto; }
.header .header-left .logo img { max-height: 36px; width: auto; }
.header .header-left .logo-small img { max-height: 32px; width: auto; }
.sidebar .sidebar-menu > ul > li > ul > li > a.active,
.sidebar .sidebar-menu ul li a.active span { color: var(--sh-primary); }

/* ---------- Legacy buttons ---------- */
.btn-default {
    background-color: var(--sh-primary);
    border: 1px solid var(--sh-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 0.5rem 0.85rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}
.btn-default:hover, .btn-default:focus, .btn-default:active {
    background-color: var(--sh-primary-dark);
    border-color: var(--sh-primary-dark);
    color: #fff;
}

/* ---------- Legacy soft badges (Sneat bg-label-*) ---------- */
.bg-label-primary   { background-color: var(--sh-primary-soft) !important; color: var(--sh-primary) !important; }
.bg-label-secondary { background-color: #EDF0F3 !important; color: #646B72 !important; }
.bg-label-success   { background-color: #EEFAF1 !important; color: var(--sh-success) !important; }
.bg-label-info      { background-color: #EAF1FE !important; color: var(--sh-info) !important; }
.bg-label-warning   { background-color: #FFFAEE !important; color: #E0A800 !important; }
.bg-label-danger    { background-color: #FFEDE9 !important; color: #E04F16 !important; }
.bg-label-dark      { background-color: #E8E9EA !important; color: var(--sh-gray-9) !important; }
.fs-tiny { font-size: 11px !important; }
.text-heading { color: var(--sh-gray-9) !important; }

/* ---------- Cards & tables used by legacy pages ---------- */
.content > .card.mt-4:first-child { margin-top: 0 !important; }
.card > .table-responsive { border-top: 1px solid var(--sh-border); }
.card .table thead th {
    background: #F9FAFB;
    color: var(--sh-gray-9);
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--sh-border);
    text-transform: none;
}
.card .table td { vertical-align: middle; }
.card-header .card-title { font-weight: 700; margin-bottom: 0; }

/* ---------- Action icons (act_edit / act_show / act_delete) ---------- */
.action-table-data .edit-delete-action { display: flex; align-items: center; gap: 6px; }
.list-inline-item .sh-action,
.sh-action {
    width: 30px;
    height: 30px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--sh-border);
    border-radius: 6px;
    color: var(--sh-gray-9) !important;
    background: #fff;
    transition: all .2s ease;
}
.sh-action:hover { background: var(--sh-primary); border-color: var(--sh-primary); color: #fff !important; }
.sh-action.sh-action-danger:hover { background: #E04F16; border-color: #E04F16; }
.sh-action i { font-size: 15px; }

/* ---------- Pagination ---------- */
.sh-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 16px 20px; }
.sh-pagination .pagination { margin: 0; gap: 4px; }
.sh-pagination .page-link {
    border-radius: 6px !important;
    border: 1px solid var(--sh-border);
    color: var(--sh-gray-9);
    min-width: 32px;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
}
.sh-pagination .page-item.active .page-link { background: var(--sh-primary); border-color: var(--sh-primary); color: #fff; }
.sh-pagination .page-item.disabled .page-link { color: #aab0b6; cursor: not-allowed; }

/* ---------- Page header actions ---------- */
.page-header .page-btn .btn + .btn { margin-left: 8px; }
.page-header .page-title h6 { color: #646B72; }

/* ---------- Footer ---------- */
.copyright-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--sh-border);
    background: #fff;
    font-size: 14px;
}

/* ---------- Avatar initials ---------- */
.avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sh-primary-soft);
    color: var(--sh-primary);
    font-weight: 700;
    border-radius: 50%;
}

/* ---------- Loading overlay ---------- */
#global-loader { display: none; }

/* Legacy ".footer" wrapper around pagination inside cards */
.card > .footer { border-top: 1px solid var(--sh-border); padding: 0; width: 100%; }

/* ---------- More legacy Sneat shims (finance / canteen pages) ---------- */
.container-p-y { padding-top: 0 !important; padding-bottom: 0 !important; }
.avatar .avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.card[class*="card-border-shadow-"] { border-bottom: 2px solid transparent !important; transition: all .2s ease; }
.card.card-border-shadow-primary { border-bottom-color: rgba(211, 47, 47, .4) !important; }
.card.card-border-shadow-success { border-bottom-color: rgba(62, 183, 128, .4) !important; }
.card.card-border-shadow-info    { border-bottom-color: rgba(21, 94, 239, .4) !important; }
.card.card-border-shadow-warning { border-bottom-color: rgba(255, 202, 24, .6) !important; }
.card.card-border-shadow-danger  { border-bottom-color: rgba(224, 79, 22, .4) !important; }
.card[class*="card-border-shadow-"]:hover { box-shadow: 0 4px 18px rgba(9, 44, 76, .08) !important; }
.shadow-xs { box-shadow: 0 1px 2px rgba(9, 44, 76, .06) !important; }
.table-border-bottom-0 tr:last-child td { border-bottom-width: 0; }
@media (min-width: 576px) { .modal-md { max-width: 560px; } }

/* ---------- Printing admin pages (reports, finance, canteen) ---------- */
@media print {
    .header, .sidebar, .copyright-footer, .page-header .page-btn, .page-header .table-top-head,
    .sidebar-overlay, #toggle_btn, .no-print { display: none !important; }
    .page-wrapper { margin: 0 !important; padding: 0 !important; }
    .page-wrapper .content { padding: 0 !important; }
    .card { box-shadow: none !important; break-inside: avoid; }
    body { background: #fff !important; }
}

/* DreamsPOS defines .fs-5/.fs-6 as 5px/6px (!important), clashing with Bootstrap's heading-scale
   utilities used across StokHub views. Restore Bootstrap semantics (px sizes stay available as fs-8+). */
.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }

/* Flex children that hold text must be allowed to shrink, or long names push the row wider than the screen. */
.min-w-0 { min-width: 0 !important; }
