/* Self-hosted fonts (assets/vendor/fonts) - no external Google Fonts dependency,
   so the app renders correctly even with no internet access. */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../vendor/fonts/montserrat-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../vendor/fonts/montserrat-latin-500-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../vendor/fonts/montserrat-latin-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../vendor/fonts/montserrat-latin-700-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../vendor/fonts/montserrat-latin-800-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../vendor/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../vendor/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2');
}

:root {
    --brand-teal: #0f766e;
    --brand-teal-dark: #0b5a54;
    --brand-teal-light: #e6f4f3;
    --brand-mint: #14b8a6;
    --brand-accent: #f59e0b;
    --brand-danger: #dc2626;
    --brand-navy: #0b2e33;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --bg-soft: #f4f7f7;
    --border-soft: #e2e8e7;
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg-soft);
    color: #1f2937;
    font-size: 0.925rem;
    overflow-x: hidden;
}

body.sidebar-locked { overflow: hidden; }

.mono { font-family: 'IBM Plex Mono', monospace; }

h1, h2, h3, h4, h5, h6 { font-family: 'Montserrat', sans-serif; font-weight: 700; color: var(--brand-navy); }

a { text-decoration: none; }

/* Brand-colored focus rings everywhere, replacing Bootstrap's default blue */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--brand-mint);
    box-shadow: 0 0 0 .2rem rgba(20, 184, 166, .18);
}
.form-check-input:checked {
    background-color: var(--brand-teal);
    border-color: var(--brand-teal);
}
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--brand-mint);
    outline-offset: 2px;
}

/* Brand-colored pills (used for status filters on batches/prescriptions/purchases pages) */
.nav-pills .nav-link { color: #4b5563; font-weight: 600; font-size: .85rem; }
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--brand-teal);
    color: #fff;
}

/* Consistent soft-badge shape */
.badge-soft-teal, .badge-soft-danger, .badge-soft-warning, .badge-soft-gray {
    border-radius: 6px;
    padding: .35em .6em;
    font-size: .74rem;
}

/* Reusable print-hide utility (also used stand-alone on the receipt page) */
@media print {
    .no-print { display: none !important; }
}

/* ---------- Modals ---------- */
.modal-content { border-radius: 14px; border: none; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal-header { border-bottom: 1px solid var(--border-soft); }
.modal-header .modal-title { font-weight: 700; color: var(--brand-navy); }
.modal-footer { border-top: 1px solid var(--border-soft); }

/* Brand-colored active state for clickable list groups (e.g. Roles & Permissions sidebar) */
.list-group-item-action.active {
    background: var(--brand-teal) !important;
    border-color: var(--brand-teal) !important;
    color: #fff !important;
}

/* ---------- Layout ---------- */
.app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--brand-navy);
    color: #cfe8e6;
    z-index: 1030;
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* the brand header stays put; only .sidebar-nav-scroll below scrolls */
}

/* Scrollable nav region - everything except the brand header lives in here, so scrolling
   through a long menu (e.g. the Super Admin role, which sees every section) never carries
   the logo/brand header out of view with it. */
.sidebar-nav-scroll {
    flex: 1;
    min-height: 0; /* required for flex children to actually respect overflow-y in a column flex parent */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.2) transparent;
}
.sidebar-nav-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-nav-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

/* Mobile backdrop shown behind the sidebar, above the topbar, while the sidebar is open */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(11,46,51,.45);
    z-index: 1025;
}
.sidebar-backdrop.show { display: block; }
.app-sidebar .brand {
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0; /* never compressed - this is what stays pinned while the nav below scrolls */
}
.app-sidebar .brand .logo-badge {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-mint), var(--brand-teal));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; font-size: 1.1rem;
}
.app-sidebar .brand .brand-text { font-weight: 800; font-size: 1.05rem; color: #fff; line-height: 1.1; }
.app-sidebar .brand .brand-text small { display: block; font-weight: 500; font-size: .68rem; color: #9fd6d1; letter-spacing: .06em; }

.nav-section-label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
    color: #6ea9a4; padding: 1rem 1.25rem .35rem;
}
.nav-section-label:first-of-type { padding-top: .5rem; }
.app-sidebar .nav-link {
    color: #cfe8e6; padding: .55rem 1.25rem; font-size: .87rem; font-weight: 500;
    border-left: 3px solid transparent; display: flex; align-items: center; gap: .65rem;
    transition: background .12s ease, color .12s ease;
}
.app-sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
.app-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.app-sidebar .nav-link.active { background: rgba(20,184,166,.15); border-left-color: var(--brand-mint); color: #fff; }



.branch-pill {
    background: var(--brand-teal-light); color: var(--brand-teal-dark);
    border-radius: 20px; padding: .3rem .8rem; font-size: .78rem; font-weight: 600;
    display: inline-flex; align-items: center; gap: .4rem;
}
/* When the branch switcher is a <select>, strip native chrome so it reads as one clean pill */
select.branch-pill {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%230b5a54' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .7rem center;
    background-size: 10px 7px;
    padding-right: 1.9rem;
    max-width: 220px;
    text-overflow: ellipsis;
}
select.branch-pill:focus { box-shadow: 0 0 0 .15rem rgba(15,118,110,.25); }

/* ---------- Cards / KPIs ---------- */
.kpi-card {
    background: #fff; border-radius: 14px; padding: 1.15rem 1.25rem;
    border: 1px solid var(--border-soft);
    box-shadow: 0 1px 2px rgba(15,23,22,.03);
    min-width: 0; /* allow flex/grid children to shrink instead of overflowing */
    transition: box-shadow .15s ease, transform .15s ease;
}
.kpi-card:hover { box-shadow: 0 6px 16px rgba(15,23,22,.06); transform: translateY(-1px); }
.kpi-card .kpi-icon {
    width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #fff;
}
.kpi-card .kpi-value {
    font-size: 1.5rem; font-weight: 800; color: var(--brand-navy); font-family: 'IBM Plex Mono', monospace;
    overflow-wrap: break-word; word-break: break-word; line-height: 1.2;
}
.kpi-card .kpi-label { font-size: .78rem; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

@media (max-width: 575px) {
    .kpi-card .kpi-value { font-size: 1.2rem; }
}

.card { border: 1px solid var(--border-soft); border-radius: 14px; }
/* Explicit padding rather than relying on Bootstrap's --bs-card-cap-padding-* custom
   properties, which only resolve when .card-header sits inside a real .card element.
   Our .table-card wrapper (used on nearly every list/report page) is NOT .card, so
   those variables were undefined there and the padding silently collapsed to zero -
   headers like "Slow-Moving Stock" ended up flush against the edge. */
.card-header { background: #fff; border-bottom: 1px solid var(--border-soft); font-weight: 700; color: var(--brand-navy); border-radius: 14px 14px 0 0 !important; padding: 0.5rem 1rem; }

.section-title { font-weight: 800; color: var(--brand-navy); }

/* ---------- Buttons ---------- */
.btn { transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease; }
.btn-brand { background: var(--brand-teal); border-color: var(--brand-teal); color: #fff; font-weight: 600; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-teal-dark); border-color: var(--brand-teal-dark); color: #fff; }
.btn-outline-brand { border-color: var(--brand-teal); color: var(--brand-teal); font-weight: 600; }
.btn-outline-brand:hover, .btn-outline-brand:focus { background: var(--brand-teal); color: #fff; }

/* ---------- Tables ---------- */
.table-card { background: #fff; border-radius: 14px; border: 1px solid var(--border-soft); overflow: hidden; }
table.table thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280;
    background: #fafbfb; border-bottom: 1px solid var(--border-soft); font-weight: 700;
}
table.table td { vertical-align: middle; font-size: .87rem; }
.badge-soft-teal { background: var(--brand-teal-light); color: var(--brand-teal-dark); font-weight: 600; }
.badge-soft-danger { background: #fde8e8; color: var(--brand-danger); font-weight: 600; }
.badge-soft-warning { background: #fef3d9; color: #92620a; font-weight: 600; }
.badge-soft-gray { background: #eef1f1; color: #4b5563; font-weight: 600; }

/* ---------- POS ----------
   The cart is sticky and self-scrolling (bounded by its own max-height), while the
   catalog flows naturally in the page. This avoids relying on a brittle 100vh-minus-header
   calculation that breaks the moment content above the POS grid changes height. */
.pos-wrap { display: flex; align-items: flex-start; gap: 1rem; }
.pos-catalog { flex: 1.5; min-width: 0; }
.pos-cart {
    flex: 1; min-width: 280px;
    background: #fff; border-radius: 14px; border: 1px solid var(--border-soft);
    display: flex; flex-direction: column;
    position: sticky;
    top: calc(var(--topbar-height) + 1rem);
    max-height: calc(100vh - var(--topbar-height) - 2rem);
}
.pos-product-card {
    background: #fff; border: 1px solid var(--border-soft); border-radius: 12px; padding: .8rem;
    cursor: pointer; transition: all .12s ease; height: 100%;
}
.pos-product-card:hover { border-color: var(--brand-mint); box-shadow: 0 4px 10px rgba(15,118,110,.1); transform: translateY(-1px); }
.pos-product-card:active { transform: translateY(0); }
.pos-product-card .pname {
    font-weight: 700; font-size: .82rem; color: var(--brand-navy); line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 2.05em;
}
.pos-product-card .pstock { font-size: .7rem; color: #6b7280; }
.pos-product-card .pprice { font-weight: 800; color: var(--brand-teal); font-family: 'IBM Plex Mono', monospace; }
.pos-cart-items { flex: 1; overflow-y: auto; padding: .75rem; min-height: 120px; }
.pos-cart-item { border-bottom: 1px solid var(--border-soft); padding: .6rem 0; }
.pos-cart-item:last-child { border-bottom: 0; }
.pos-cart-footer { padding: 1rem; border-top: 1px solid var(--border-soft); background: #fafbfb; border-radius: 0 0 14px 14px; flex-shrink: 0; }

@media (max-width: 991px) {
    /* On smaller screens the sticky/scrolling cart is hard to reach comfortably - let it sit
       inline instead of pinned, and cap its height so the page scrolls normally. */
    .pos-cart { position: static; max-height: none; }
    .pos-cart-items { max-height: 45vh; }
}

/* Auth pages */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand-navy), #0f4c46); padding: 1.5rem; }
.auth-card { background: #fff; border-radius: 18px; padding: 2.5rem; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }

/* ---- Two-column login ---- */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 5fr) 7fr; }
.auth-split-single { grid-template-columns: 1fr; }
.auth-left { display: flex; align-items: center; justify-content: center; padding: 2rem; background: #f4f7f7; }
.auth-left .auth-card { box-shadow: 0 10px 40px rgba(15,23,42,.08); max-width: 420px; }
.auth-right { display: flex; align-items: center; justify-content: center; padding: 2.5rem; background: linear-gradient(135deg, var(--brand-navy), #0f4c46); position: relative; overflow: hidden; }
.auth-right::before { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(20,184,166,.28), transparent 70%); }
.demo-panel { position: relative; width: 100%; max-width: 760px; }
.demo-eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5eead4; background: rgba(20,184,166,.15); border: 1px solid rgba(94,234,212,.3); padding: .3rem .7rem; border-radius: 999px; }
.demo-title { color: #fff; font-weight: 700; margin: .9rem 0 .3rem; }
.demo-sub { color: rgba(255,255,255,.7); margin-bottom: 1.5rem; font-size: .95rem; }
.demo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
.demo-form { margin: 0; }
.demo-tile { width: 100%; height: 100%; display: flex; align-items: center; gap: .9rem; text-align: left; cursor: pointer; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); color: #fff; backdrop-filter: blur(6px); transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.demo-tile:hover, .demo-tile:focus-visible { transform: translateY(-3px); background: rgba(255,255,255,.14); border-color: rgba(94,234,212,.7); box-shadow: 0 12px 28px rgba(0,0,0,.25); outline: none; }
.demo-icon { flex: 0 0 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; background: linear-gradient(135deg, #14b8a6, #0f766e); box-shadow: 0 4px 12px rgba(20,184,166,.35); }
.demo-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.demo-role { font-weight: 700; font-size: .98rem; line-height: 1.2; }
.demo-name { font-size: .78rem; color: #5eead4; margin-top: 2px; }
.demo-desc { font-size: .76rem; color: rgba(255,255,255,.65); margin-top: 4px; line-height: 1.35; }
.demo-arrow { font-size: 1.6rem; color: rgba(255,255,255,.4); transition: transform .18s ease, color .18s ease; }
.demo-tile:hover .demo-arrow { transform: translateX(4px); color: #5eead4; }
@media (max-width: 991px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-right { padding: 2rem 1.25rem; }
}
@media (max-width: 575px) {
    .demo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .auth-card { padding: 1.75rem 1.5rem; border-radius: 14px; }
}

@media (max-width: 991px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.show { transform: translateX(0); box-shadow: 8px 0 24px rgba(0,0,0,.25); }
    .app-main { margin-left: 0; }
    .pos-wrap { flex-direction: column; }
}

@media (max-width: 575px) {
    .app-topbar { padding: 0 1rem; }
    .app-content { padding: 1rem; }
}

/* Respect users who've asked the OS to reduce motion */
@media (prefers-reduced-motion: reduce) {
    .app-sidebar, .kpi-card, .pos-product-card, .btn, .app-sidebar .nav-link { transition: none; }
}


/* =====================================================================
   v1.2 LAYOUT: fixed top bar, fixed footer, grouped sidebar, POS terminal
   ===================================================================== */
:root { --footer-height: 44px; --pos-top: 60px; }

.app-main { margin-left: var(--sidebar-width); padding-top: var(--topbar-height); padding-bottom: calc(var(--footer-height) + 8px); min-height: 100vh; display: flex; flex-direction: column; }
.app-content { padding: 1.5rem 1.75rem; flex: 1; min-width: 0; }

.app-topbar {
    position: fixed; top: 0; left: var(--sidebar-width); right: 0;
    height: var(--topbar-height);
    background: #fff; border-bottom: 1px solid var(--border-soft);
    display: flex; align-items: center; gap: 1rem;
    padding: 0 1.5rem; z-index: 1028;
}

.app-footer {
    position: fixed; left: var(--sidebar-width); right: 0; bottom: 0;
    height: var(--footer-height);
    background: #fff; border-top: 1px solid var(--border-soft);
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0 1.75rem; z-index: 1028; font-size: .78rem; color: #6b7280;
}
.app-footer .footer-clock { font-family: 'IBM Plex Mono', monospace; font-weight: 600; color: var(--brand-navy); white-space: nowrap; margin-left: auto; }
.app-footer .footer-clock i { color: var(--brand-teal); margin-right: .25rem; }

/* Sidebar: grouped menu + logout pinned to the bottom, level with the footer */
.app-sidebar .sidebar-menu { padding: .5rem 0; }
.app-sidebar .nav-link { padding: .5rem 1.25rem; }
.app-sidebar .nav-group-toggle { position: relative; }
.app-sidebar .nav-group-toggle .nav-chevron { margin-left: auto; width: auto; font-size: .7rem; transition: transform .2s ease; opacity: .7; }
.app-sidebar .nav-group-toggle.collapsed .nav-chevron { transform: rotate(-90deg); }
.app-sidebar .nav-group-toggle.has-active { color: #fff; }
.app-sidebar .nav-sub { background: rgba(0,0,0,.14); padding: .25rem 0; }
.app-sidebar .nav-sub .nav-link { padding: .42rem 1.25rem .42rem 2.6rem; font-size: .82rem; }
.app-sidebar .nav-sub .nav-link i { font-size: .95rem; }
.sidebar-logout {
    flex-shrink: 0; height: var(--footer-height);
    display: flex; align-items: center; gap: .65rem; padding: 0 1.25rem;
    color: #fecaca; font-weight: 600; font-size: .85rem;
    background: rgba(0,0,0,.2); border-top: 1px solid rgba(255,255,255,.08);
    transition: background .15s ease, color .15s ease;
}
.sidebar-logout i { font-size: 1.05rem; }
.sidebar-logout:hover { background: #b91c1c; color: #fff; }

/* Breadcrumb / page locator */
.page-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; font-size: .78rem; color: #6b7280; margin-bottom: 1rem; }
.page-crumbs a { color: var(--brand-teal); font-weight: 600; }
.page-crumbs a:hover { text-decoration: underline; }
.page-crumbs .sep { font-size: .6rem; opacity: .6; }
.page-crumbs .current { color: var(--brand-navy); font-weight: 700; }

/* Global search */
.global-search { position: relative; max-width: 560px; margin: 0 auto; }
.global-search > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; }
.global-search input { padding-left: 2.4rem; border-radius: 999px; background: var(--bg-soft); border-color: transparent; height: 40px; }
.global-search input:focus { background: #fff; }
.global-search-results {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: #fff; border: 1px solid var(--border-soft); border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15,23,22,.18); max-height: 70vh; overflow-y: auto; z-index: 1040; padding: .4rem 0;
}
.gs-group { padding: .5rem 1rem .2rem; font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-teal); font-weight: 800; }
.gs-item { display: flex; align-items: center; gap: .7rem; padding: .5rem 1rem; color: #1f2937; }
.gs-item:hover, .gs-item.active { background: var(--brand-teal-light); }
.gs-item .gs-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-teal-light); color: var(--brand-teal); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gs-item .gs-title { font-weight: 600; font-size: .86rem; line-height: 1.2; }
.gs-item .gs-sub { font-size: .72rem; color: #6b7280; }
.gs-empty { padding: 1rem; text-align: center; color: #6b7280; font-size: .85rem; }

/* Content containers: keep every table/card content off the edges */
.table-card .card-body, .table-card > .p-0 + .p-3 { padding: 1rem 1.25rem; }
.table-card .card-header, .card .card-header { padding: .75rem 1.25rem; }
.table-card .card-header { border-radius: 14px 14px 0 0; }
table.table th:first-child, table.table td:first-child { padding-left: 1.25rem; }
table.table th:last-child, table.table td:last-child { padding-right: 1.25rem; }
.table-card > form { padding: 1rem 1.25rem; }
.card > .card-body { padding: 1.25rem; }
.table-filter { max-width: 240px; }
.table-filter-bar { padding: .75rem 1.25rem; border-bottom: 1px solid var(--border-soft); background: #fff; }
.live-loading { opacity: .55; transition: opacity .15s ease; }

/* Clickable KPI cards */
a.kpi-link { display: block; color: inherit; text-decoration: none; height: 100%; }
a.kpi-link .kpi-card { height: 100%; position: relative; cursor: pointer; }
a.kpi-link .kpi-card::after {
    content: "\F135"; font-family: "bootstrap-icons"; position: absolute; top: 12px; right: 14px;
    color: var(--brand-teal); opacity: 0; transform: translateX(-4px); transition: all .15s ease; font-size: 1rem;
}
a.kpi-link:hover .kpi-card, a.kpi-link:focus-visible .kpi-card { border-color: var(--brand-mint); box-shadow: 0 8px 20px rgba(15,118,110,.14); transform: translateY(-2px); }
a.kpi-link:hover .kpi-card::after { opacity: 1; transform: translateX(0); }
.card-link { color: inherit; display: block; height: 100%; }
.card-link:hover .card { border-color: var(--brand-mint); box-shadow: 0 8px 20px rgba(15,118,110,.12); }

/* Toasts */
.app-toast { border-left: 5px solid var(--brand-teal); border-radius: 10px !important; box-shadow: 0 10px 30px rgba(15,23,22,.18) !important; }
.app-toast.toast-error { border-left-color: var(--brand-danger); }
.app-toast.toast-warning { border-left-color: var(--brand-accent); }
.app-toast .swal2-title { font-size: .9rem !important; font-weight: 600 !important; color: #1f2937 !important; }

/* Period tabs (reports) */
.period-tabs .btn { font-weight: 600; font-size: .82rem; }

/* ---------- POS terminal (full screen) ---------- */
body.pos-mode { background: var(--bg-soft); }
.pos-topbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--pos-top); background: #fff;
    border-bottom: 1px solid var(--border-soft); z-index: 1028;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1.25rem;
}
.logo-badge-sm { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-mint), var(--brand-teal)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.pos-nav { gap: .25rem; }
.pos-nav a { padding: .45rem .9rem; border-radius: 8px; color: #4b5563; font-weight: 600; font-size: .85rem; }
.pos-nav a:hover { background: var(--bg-soft); }
.pos-nav a.active { background: var(--brand-teal-light); color: var(--brand-teal-dark); }
.pos-content { padding: calc(var(--pos-top) + 1rem) 1.25rem 1rem; min-height: 100vh; }
body.pos-mode .pos-wrap { height: calc(100vh - var(--pos-top) - 2rem); align-items: stretch; }
body.pos-mode .pos-catalog { overflow-y: auto; padding-right: .35rem; }
body.pos-mode .pos-cart { position: static; max-height: none; height: 100%; }

@media (max-width: 991px) {
    .app-topbar { left: 0; padding: 0 1rem; }
    .app-footer { left: 0; padding: 0 1rem; }
    .app-main { margin-left: 0; }
    .app-content { padding: 1rem; }
    .global-search { max-width: none; }
    body.pos-mode .pos-wrap { height: auto; }
    body.pos-mode .pos-catalog { overflow: visible; }
    body.pos-mode .pos-cart { height: auto; }
}
@media (max-width: 575px) {
    .app-footer .footer-left { display: none; }
    .app-topbar .branch-pill { max-width: 120px; }
}
@media print {
    .app-topbar, .app-footer, .page-crumbs, .pos-topbar { display: none !important; }
    .app-main { padding: 0 !important; margin: 0 !important; }
}

.pos-product-card.is-out { opacity: .5; background: #f9fafb; }
.pos-product-card.is-out:hover { border-color: var(--brand-danger); box-shadow: none; transform: none; }
.pos-product-card.is-low { border-color: #fcd34d; }

a.row-link:hover { background: var(--brand-teal-light); margin: 0 -.5rem; padding-left: .5rem !important; padding-right: .5rem !important; border-radius: 8px; }
tr.row-click { cursor: pointer; }
tr.row-click:hover > td { background: var(--brand-teal-light); }
