/* AgriVet — typography & UI polish */

:root {
    --av-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --av-green-900: #0f3d28;
    --av-green-700: #1a5c3a;
    --av-green-600: #22734a;
    --av-green-500: #2d8f5c;
    --av-green-100: #e8f5ee;
    --av-amber-500: #d97706;
    --av-slate-900: #0f172a;
    --av-slate-700: #334155;
    --av-slate-500: #64748b;
    --av-slate-200: #e2e8f0;
    --av-slate-100: #f1f5f9;
    --av-slate-50: #f8fafc;
    --av-radius: 10px;
    --av-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    --av-shadow-lg: 0 4px 6px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.08);
}

/* Base typography */
body,
.wrapper,
.form-control,
.btn,
.table,
.card,
.nav-link,
.brand-text,
h1, h2, h3, h4, h5, h6,
p, label, .alert {
    font-family: var(--av-font) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    color: var(--av-slate-700);
    font-size: 0.9375rem;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

h1, h2, h3, h4, h5, h6,
.content-header h1 {
    color: var(--av-slate-900);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.content-header h1 {
    font-size: 1.625rem;
    margin-bottom: 0;
}

.page-subtitle {
    color: var(--av-slate-500);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.35rem;
    margin-bottom: 0;
}

/* Layout */
.content-wrapper {
    background: var(--av-slate-50) !important;
}

.content-header {
    padding: 1.25rem 0 0.75rem;
}

.content-header .breadcrumb {
    background: transparent;
    margin-bottom: 0;
    padding: 0.5rem 0 0;
    font-size: 0.8125rem;
    font-weight: 500;
}

.content-header .breadcrumb-item a {
    color: var(--av-green-700);
    text-decoration: none;
}

.content-header .breadcrumb-item a:hover {
    color: var(--av-green-900);
    text-decoration: underline;
}

.content-header .breadcrumb-item.active {
    color: var(--av-slate-500);
}

.content-header .breadcrumb-item + .breadcrumb-item::before {
    color: var(--av-slate-500);
}

.content {
    padding-top: 0.5rem;
}

.main-footer {
    background: #fff;
    border-top: 1px solid var(--av-slate-200);
    color: var(--av-slate-500);
    font-size: 0.8125rem;
}

/* Navbar */
.main-header {
    border-bottom: 1px solid var(--av-slate-200) !important;
    box-shadow: var(--av-shadow);
}

.main-header .nav-link {
    color: var(--av-slate-700) !important;
    font-size: 0.875rem;
    font-weight: 500;
}

.user-pill {
    align-items: center;
    background: var(--av-green-100);
    border-radius: 999px;
    color: var(--av-green-900) !important;
    display: inline-flex;
    font-size: 0.8125rem !important;
    font-weight: 600;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem !important;
}

.user-pill .role-tag {
    background: var(--av-green-700);
    border-radius: 999px;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.5rem;
    text-transform: uppercase;
}

.nav-context-pill {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 0.35rem;
    line-height: 1.2;
    margin-right: 0.5rem;
    padding: 0.35rem 0.85rem;
    white-space: nowrap;
}

.nav-context-pill--global {
    background: #e0e7ff;
    color: #3730a3;
}

.nav-context-pill--store {
    background: var(--av-green-100);
    color: var(--av-green-900);
}

.nav-context-pill--branch {
    background: #fef3c7;
    color: #92400e;
}

.nav-context-type {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nav-context-sep {
    font-weight: 400;
    opacity: 0.55;
}

.nav-context-name {
    font-weight: 600;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-datetime {
    align-items: center;
    background: var(--av-slate-100);
    border-radius: 8px;
    color: var(--av-slate-700);
    display: inline-flex;
    flex-direction: column;
    font-size: 0.6875rem;
    font-weight: 600;
    gap: 0.1rem;
    line-height: 1.2;
    margin-right: 0.75rem;
    min-width: 7.5rem;
    padding: 0.3rem 0.65rem;
    text-align: center;
}

.nav-datetime__icon {
    display: none;
}

.nav-datetime__date {
    color: var(--av-slate-500);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.nav-datetime__time {
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

@media (min-width: 992px) {
    .nav-datetime {
        flex-direction: row;
        gap: 0.5rem;
        min-width: auto;
        text-align: left;
    }

    .nav-datetime__icon {
        color: var(--av-slate-400);
        display: inline;
        font-size: 0.75rem;
    }

    .nav-datetime__date::after {
        content: '·';
        margin-left: 0.5rem;
        opacity: 0.45;
    }
}

.btn-logout {
    color: var(--av-slate-500) !important;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-logout:hover {
    color: var(--av-green-700) !important;
}

/* Sidebar */
.main-sidebar {
    background: linear-gradient(180deg, var(--av-green-900) 0%, #0a2e1c 100%) !important;
}

.brand-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 0.65rem 1rem !important;
}

.brand-text {
    color: #fff !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em;
}

.brand-text span {
    color: #86efac;
    font-weight: 600;
}

.main-sidebar .sidebar {
    height: calc(100vh - 3.1rem);
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 0.5rem;
}

.main-sidebar .sidebar nav {
    margin-top: 0.35rem !important;
}

.sidebar .nav-header {
    color: rgba(255, 255, 255, 0.45) !important;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-top: 0.35rem;
    padding: 0.2rem 1rem 0.1rem;
    text-transform: uppercase;
}

.sidebar .nav-link {
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin: 1px 0.5rem;
    padding: 0.4rem 0.75rem;
    transition: background 0.15s ease;
}

.sidebar .nav-link .nav-icon {
    font-size: 0.95rem;
    width: 1.35rem;
}

.sidebar .nav-link p {
    font-weight: 500;
    margin: 0;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.14) !important;
    font-weight: 600;
}

.brand-image {
    display: none;
    color: #86efac;
    font-size: 1.35rem;
    line-height: 1;
}

/* Collapsed sidebar — compact icon rail */
body.sidebar-mini.sidebar-collapse .main-sidebar {
    overflow-x: hidden;
    width: 4.6rem;
}

body.sidebar-mini.sidebar-collapse .brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0 !important;
    width: 4.6rem;
}

body.sidebar-mini.sidebar-collapse .brand-text,
body.sidebar-mini.sidebar-collapse .brand-text-long {
    display: none !important;
}

body.sidebar-mini.sidebar-collapse .brand-image {
    display: inline-block;
}

body.sidebar-mini.sidebar-collapse .sidebar .nav-header {
    display: none !important;
    height: 0;
    margin: 0;
    padding: 0;
}

body.sidebar-mini.sidebar-collapse .sidebar .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0 !important;
    margin: 1px 0.35rem;
    width: calc(4.6rem - 0.7rem);
}

body.sidebar-mini.sidebar-collapse .sidebar .nav-link p {
    display: none !important;
}

body.sidebar-mini.sidebar-collapse .sidebar .nav-icon {
    margin: 0 !important;
    width: auto;
    min-width: 0;
    font-size: 1.05rem;
    text-align: center;
}

/* Cards */
.card {
    border: 1px solid var(--av-slate-200);
    border-radius: var(--av-radius);
    box-shadow: var(--av-shadow);
    margin-bottom: 1.25rem;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--av-slate-200);
    color: var(--av-slate-900);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    padding: 0.875rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--av-slate-50);
    border-top: 1px solid var(--av-slate-200);
}

/* Tables */
.table {
    color: var(--av-slate-700);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.table thead th {
    background: var(--av-slate-50);
    border-bottom: 1px solid var(--av-slate-200) !important;
    color: var(--av-slate-500);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td {
    border-top: 1px solid var(--av-slate-100);
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--av-slate-50);
}

.table .amount {
    font-variant-numeric: tabular-nums;
}

/* Forms */
label {
    color: var(--av-slate-700);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-bottom: 0.35rem;
}

.form-control {
    border: 1px solid var(--av-slate-200);
    border-radius: 8px;
    color: var(--av-slate-900);
    font-size: 0.875rem;
    height: auto;
    line-height: 1.5;
    min-height: 2.5rem;
    padding: 0.5rem 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    border-color: var(--av-green-500);
    box-shadow: 0 0 0 3px rgba(45, 143, 92, 0.15);
}

.form-control-sm {
    font-size: 0.875rem;
    height: auto !important;
    line-height: 1.5 !important;
    min-height: 2.25rem !important;
    padding: 0.4rem 0.75rem !important;
}

select.form-control,
select.form-control-sm {
    -webkit-appearance: menulist;
    appearance: menulist;
    overflow: visible;
    padding-right: 1.75rem !important;
}

.form-control-lg {
    font-size: 1rem;
    min-height: 3rem;
    padding: 0.75rem 1rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.45rem 1rem;
}

.btn-primary {
    background: var(--av-green-700);
    border-color: var(--av-green-700);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--av-green-900);
    border-color: var(--av-green-900);
}

.btn-success {
    background: var(--av-green-600);
    border-color: var(--av-green-600);
}

.btn-success:hover {
    background: var(--av-green-700);
    border-color: var(--av-green-700);
}

.btn-outline-primary {
    border-color: var(--av-green-600);
    color: var(--av-green-700);
}

.btn-outline-primary:hover {
    background: var(--av-green-700);
    border-color: var(--av-green-700);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--av-radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-success {
    background: var(--av-green-100);
    color: var(--av-green-900);
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.approval-attention-banner,
.transfer-attention-banner {
    background: #fef3c7;
    border-bottom: 1px solid #fcd34d;
    color: #92400e;
    font-size: 0.875rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    width: 100%;
}

.approval-attention-banner__inner,
.transfer-attention-banner__inner {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 100%;
    padding: 0.5rem 1.25rem;
}

.approval-attention-banner__content,
.transfer-attention-banner__content {
    align-items: flex-start;
    display: flex;
    flex: 1;
    gap: 0.5rem;
    min-width: 0;
}

.approval-attention-banner__list {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
}

.approval-attention-banner__list li + li {
    margin-top: 0.2rem;
}

.approval-attention-banner__content > span,
.transfer-attention-banner__content > span {
    line-height: 1.45;
    word-break: break-word;
}

.approval-attention-banner__icon,
.transfer-attention-banner__icon {
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.approval-attention-banner__link,
.transfer-attention-banner__link {
    color: #92400e;
    font-weight: 600;
    margin-left: 0.35rem;
    text-decoration: underline;
}

.approval-attention-banner__link:hover,
.transfer-attention-banner__link:hover {
    color: #78350f;
}

.approval-attention-banner__dismiss,
.transfer-attention-banner__dismiss {
    flex-shrink: 0;
    margin: 0;
}

.approval-attention-banner__dismiss .btn-link,
.transfer-attention-banner__dismiss .btn-link {
    color: #92400e;
    padding: 0.15rem 0.35rem;
}

/* Stat cards */
.stat-card {
    background: #fff;
    border: 1px solid var(--av-slate-200);
    border-radius: var(--av-radius);
    box-shadow: var(--av-shadow);
    overflow: hidden;
    padding: 1.25rem 1.35rem;
    position: relative;
}

.stat-card::before {
    background: var(--accent, var(--av-green-600));
    content: '';
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 4px;
}

.stat-card .stat-label {
    color: var(--av-slate-500);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 0.35rem;
}

.stat-card .stat-value {
    color: var(--av-slate-900);
    font-size: 1.75rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-card .stat-icon {
    align-items: center;
    background: var(--icon-bg, var(--av-green-100));
    border-radius: 10px;
    color: var(--icon-color, var(--av-green-700));
    display: flex;
    font-size: 1.125rem;
    height: 42px;
    justify-content: center;
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    width: 42px;
}

.stat-card--sales { --accent: #0ea5e9; --icon-bg: #e0f2fe; --icon-color: #0284c7; }
.stat-card--txn   { --accent: var(--av-green-600); }
.stat-card--warn  { --accent: var(--av-amber-500); --icon-bg: #fef3c7; --icon-color: #b45309; }
.stat-card--low   { --accent: #dc2626; --icon-bg: #fee2e2; --icon-color: #b91c1c; }

.dashboard-chart-wrap {
    height: 260px;
    position: relative;
}

.dashboard-chart-wrap--compact {
    height: 220px;
}

.dashboard-chart-summary {
    border-top: 1px solid var(--av-slate-200);
    color: var(--av-slate-600);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    gap: 1rem 1.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.dashboard-chart-summary strong {
    color: var(--av-slate-900);
    font-variant-numeric: tabular-nums;
}

.dashboard-chart-legend-inline {
    color: var(--av-slate-500);
    font-size: 0.75rem;
    margin-top: 0.35rem;
}

/* Report tiles */
.report-tile {
    background: #fff;
    border: 1px solid var(--av-slate-200);
    border-radius: var(--av-radius);
    box-shadow: var(--av-shadow);
    color: var(--av-slate-900);
    display: block;
    font-weight: 600;
    padding: 1.1rem 1.25rem;
    text-decoration: none !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.report-tile:hover {
    border-color: var(--av-green-500);
    box-shadow: var(--av-shadow-lg);
    color: var(--av-green-700);
    transform: translateY(-2px);
}

.report-tile i {
    color: var(--av-green-600);
    margin-right: 0.5rem;
}

/* POS */
.pos-search-wrap label {
    display: block;
    margin-bottom: 0.5rem;
}

.pos-results .list-group-item {
    border-color: var(--av-slate-200);
    border-radius: 8px !important;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
    padding: 0.75rem 1rem;
    transition: background 0.12s ease;
}

.pos-results .list-group-item:hover {
    background: var(--av-green-100);
    border-color: var(--av-green-500);
    color: var(--av-green-900);
}

.pos-results .product-sku {
    color: var(--av-slate-500);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.pos-results .product-name {
    font-weight: 600;
}

.pos-results .product-meta {
    color: var(--av-slate-500);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.pos-cart-total {
    color: var(--av-slate-900);
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.pos-cart-total span {
    color: var(--av-green-700);
}

.pos-out-of-stock {
    background: var(--av-slate-50);
    border-color: var(--av-slate-200);
    cursor: not-allowed;
    opacity: 0.75;
    padding: 0.75rem 1rem;
}

.pos-payment label {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.pos-change-display {
    background: var(--av-slate-100);
    border: 2px solid var(--av-slate-200);
    border-radius: 8px;
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    letter-spacing: -0.02em;
    padding: 0.55rem 1rem;
}

.pos-change-display.sufficient {
    background: var(--av-green-100);
    border-color: var(--av-green-500);
    color: var(--av-green-900);
}

.pos-change-display.insufficient {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.pos-shortfall {
    color: #b45309;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.pos-products-card .card-body {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

.pos-cart-card {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
}

.pos-cart-items {
    flex: 1 1 auto;
    max-height: calc(100vh - 420px);
    min-height: 180px;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
}

.pos-cart-footer {
    flex-shrink: 0;
}

.pos-cart-line {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--av-slate-200);
}

.pos-cart-line:last-child {
    border-bottom: none;
}

.pos-cart-line__image {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--av-slate-200);
    background: #fff;
}

.pos-cart-line__body {
    flex: 1;
    min-width: 0;
}

.pos-cart-line__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.pos-cart-line__name {
    font-weight: 700;
    color: var(--av-slate-900);
    line-height: 1.3;
}

.pos-cart-line__meta {
    color: var(--av-slate-500);
    font-size: 0.8rem;
}

.pos-cart-line__controls {
    margin-top: 0.5rem;
}

.pos-cart-line__amounts {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.pos-cart-line__amounts strong {
    color: var(--av-green-700);
    font-size: 1rem;
}

.pos-categories-shell {
    position: relative;
}

.pos-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 5.75rem; /* ~2 rows of chips */
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 0.15rem;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.pos-categories-shell.has-more .pos-categories {
    mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 1.4rem), transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 1.4rem), transparent 100%);
}

.pos-categories-caret {
    align-items: center;
    background: linear-gradient(to bottom, transparent, #fff 45%);
    border: 0;
    bottom: 0;
    color: var(--av-slate-500);
    cursor: pointer;
    display: flex;
    font-size: 0.75rem;
    height: 1.65rem;
    justify-content: center;
    left: 0;
    padding: 0;
    position: absolute;
    right: 0;
    width: 100%;
    z-index: 1;
}

.pos-categories-caret:hover {
    color: var(--av-green-700);
}

.pos-categories-shell.is-expanded .pos-categories {
    max-height: 14rem;
    mask-image: none;
    -webkit-mask-image: none;
    padding-bottom: 1.5rem;
}

.pos-categories-shell.is-expanded .pos-categories-caret {
    background: linear-gradient(to bottom, transparent, #fff 55%);
}

.pos-categories-shell.is-expanded .pos-categories-caret i {
    transform: rotate(180deg);
}

.pos-category-chip {
    background: #fff;
    border: 1px solid var(--av-slate-200);
    border-radius: 999px;
    color: var(--av-slate-700);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    transition: all 0.12s ease;
}

.pos-category-chip:hover,
.pos-category-chip.active {
    background: var(--av-green-100);
    border-color: var(--av-green-500);
    color: var(--av-green-800);
}

.pos-browse-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.pos-browse-title {
    color: var(--av-slate-800);
    font-weight: 700;
}

.pos-stock-filter .btn.active {
    background: var(--av-green-600, #1a5c3a);
    border-color: var(--av-green-600, #1a5c3a);
    color: #fff;
}

.pos-product-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}

.pos-product-card {
    background: #fff;
    border: 1px solid var(--av-slate-200);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    text-align: left;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
    width: 100%;
}

.pos-product-card:hover:not(:disabled) {
    border-color: var(--av-green-500);
    box-shadow: var(--av-shadow);
    transform: translateY(-1px);
}

.pos-product-card--disabled,
.pos-product-card:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.pos-product-card__image {
    aspect-ratio: 1;
    background: var(--av-slate-50);
    overflow: hidden;
}

.pos-product-card__image img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.pos-product-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.55rem 0.65rem 0.7rem;
}

.pos-product-card__sku {
    color: var(--av-slate-500);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pos-product-card__name {
    color: var(--av-slate-900);
    display: -webkit-box;
    font-size: 0.8125rem;
    font-weight: 600;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.25;
    min-height: 2.05rem;
    overflow: hidden;
}

.pos-product-card__meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: space-between;
    margin-top: 0.15rem;
}

.pos-product-card__price {
    color: var(--av-green-700);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.pos-stock-badge {
    color: var(--av-slate-500);
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.pos-search-item {
    align-items: center;
    display: flex !important;
    gap: 0.75rem;
}

.pos-search-thumb {
    border: 1px solid var(--av-slate-200);
    border-radius: 8px;
    flex-shrink: 0;
    height: 52px;
    object-fit: cover;
    width: 52px;
}

.pos-search-body {
    min-width: 0;
}

.product-thumb,
.product-form-preview {
    border: 1px solid var(--av-slate-200);
    border-radius: 8px;
    height: 44px;
    object-fit: cover;
    width: 44px;
}

.product-form-preview {
    height: 120px;
    width: 120px;
}

/* Branch switcher */
.branch-switcher {
    align-items: center;
    background: #fff;
    border: 1px solid var(--av-slate-200);
    border-radius: var(--av-radius);
    box-shadow: var(--av-shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0.75rem 1rem;
}

.branch-switcher label {
    align-items: center;
    color: var(--av-slate-700);
    display: inline-flex;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0;
    white-space: nowrap;
}

.branch-switcher select {
    flex: 1 1 220px;
    max-width: 100%;
    min-width: 220px;
}

.form-inline .form-control,
.form-inline select.form-control {
    display: inline-block;
    vertical-align: middle;
    width: auto;
}

/* Page toolbar */
.page-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

/* Login */
.login-page {
    background: linear-gradient(135deg, var(--av-green-900) 0%, #0a2e1c 50%, #14532d 100%);
    font-family: var(--av-font);
}

.login-box {
    width: 400px;
}

.login-logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.login-logo b {
    color: #86efac;
}

.login-box .card {
    border: none;
    border-radius: 14px;
    box-shadow: var(--av-shadow-lg);
}

.login-box-msg {
    color: var(--av-slate-500);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Pagination */
.pagination {
    font-size: 0.875rem;
}

.page-link {
    border-radius: 6px;
    margin: 0 2px;
}

/* Links in tables */
.table a {
    color: var(--av-green-700);
    font-weight: 600;
    text-decoration: none;
}

.table a:hover {
    color: var(--av-green-900);
    text-decoration: underline;
}

/* Activity logs */
.activity-log-when__primary {
    font-weight: 600;
    color: var(--av-slate-900);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.activity-log-when__meta {
    font-size: 0.75rem;
    color: var(--av-slate-500);
    margin-top: 0.1rem;
    white-space: nowrap;
}

.activity-log-changes {
    list-style: none;
    padding-left: 0;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--av-slate-700);
    line-height: 1.5;
}

.activity-log-changes li + li {
    margin-top: 0.15rem;
}

.badge-activity {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.3em 0.55em;
}

.badge-activity--created { background: #dcfce7; color: #166534; }
.badge-activity--updated { background: #dbeafe; color: #1e40af; }
.badge-activity--deleted { background: #fee2e2; color: #991b1b; }
.badge-activity--voided { background: #fef3c7; color: #92400e; }
.badge-activity--imported { background: #f3e8ff; color: #6b21a8; }
.badge-activity--approved { background: #dcfce7; color: #166534; }

.badge-po {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.3em 0.55em;
}

.badge-po--pending { background: #fef3c7; color: #92400e; }
.badge-po--approved { background: #dcfce7; color: #166534; }
.badge-po--partial { background: #dbeafe; color: #1e40af; }
.badge-po--received { background: #e2e8f0; color: #334155; }

/* SweetAlert2 */
.swal2-popup {
    font-family: var(--av-font) !important;
    border-radius: var(--av-radius) !important;
}

.av-delete-popup {
    padding: 1.5rem 1.5rem 1.25rem !important;
}

.av-delete-popup .swal2-icon.swal2-warning {
    border-color: #f59e0b;
    color: #d97706;
}

.av-delete-popup .av-delete-confirm {
    font-weight: 600;
    min-width: 7.5rem;
}

.av-delete-popup .av-delete-cancel {
    font-weight: 500;
    min-width: 5.5rem;
}

.swal2-title {
    color: var(--av-slate-900) !important;
    font-size: 1.125rem !important;
    font-weight: 700 !important;
}

.swal2-html-container,
.swal2-content {
    color: var(--av-slate-500) !important;
    font-size: 0.875rem !important;
}

.swal2-toast {
    font-family: var(--av-font) !important;
    border-radius: 10px !important;
    box-shadow: var(--av-shadow-lg) !important;
    margin: 0 1rem 1rem 0 !important;
    overflow: hidden;
}

.swal2-container.swal2-bottom-end {
    bottom: 0 !important;
    right: 0 !important;
    padding: 0 1rem 1rem 0 !important;
}

.av-toast-popup.swal2-toast {
    align-items: flex-start !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 0.625rem !important;
    min-height: 3.25rem !important;
    min-width: 300px !important;
    max-width: 420px !important;
    padding: 0.875rem 2.75rem 0.875rem 1rem !important;
}

.av-toast-popup .swal2-icon.av-toast-icon {
    align-items: center !important;
    border: none !important;
    display: flex !important;
    flex-shrink: 0 !important;
    font-size: 1.25rem !important;
    height: 1.25rem !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0.125rem 0 0 0 !important;
    min-height: 1.25rem !important;
    min-width: 1.25rem !important;
    position: static !important;
    transform: none !important;
    width: 1.25rem !important;
}

.av-toast-popup .av-toast-icon .swal2-icon-content {
    align-items: center !important;
    display: flex !important;
    font-size: inherit !important;
    font-weight: 400 !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0 !important;
    width: auto !important;
}

.av-toast-popup .av-toast-icon.swal2-error .swal2-x-mark,
.av-toast-popup .av-toast-icon.swal2-success .swal2-success-ring,
.av-toast-popup .av-toast-icon.swal2-success .swal2-success-fix,
.av-toast-popup .av-toast-icon.swal2-success .swal2-success-circular-line-left,
.av-toast-popup .av-toast-icon.swal2-success .swal2-success-circular-line-right,
.av-toast-popup .av-toast-icon.swal2-success .swal2-success-line-tip,
.av-toast-popup .av-toast-icon.swal2-success .swal2-success-line-long {
    display: none !important;
}

.av-toast-icon--success {
    color: var(--av-green-600) !important;
}

.av-toast-icon--error {
    color: #dc2626 !important;
}

.av-toast-icon--warning {
    color: #d97706 !important;
}

.av-toast-icon--info {
    color: #2563eb !important;
}

.av-toast-popup .swal2-title {
    flex: 1 1 auto !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

.av-toast-popup .swal2-timer-progress-bar-container {
    height: 3px !important;
    inset: auto 0 0 0 !important;
    position: absolute !important;
    width: 100% !important;
}

.av-toast-popup .swal2-timer-progress-bar {
    background: var(--av-green-500) !important;
}

.av-toast-close {
    align-items: center !important;
    color: var(--av-slate-500) !important;
    display: flex !important;
    font-size: 1.25rem !important;
    height: 1.5rem !important;
    justify-content: center !important;
    line-height: 1 !important;
    opacity: 0.7;
    position: absolute !important;
    right: 0.75rem !important;
    top: 0.75rem !important;
    transform: none !important;
    width: 1.5rem !important;
}

.av-toast-close:hover {
    color: var(--av-slate-700) !important;
    opacity: 1;
}

.main-footer .footer-brand {
    color: var(--av-slate-700);
    font-weight: 600;
}

.main-footer .footer-copyright {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: var(--av-slate-500);
}

.brand-text-long {
    font-size: 0.95rem !important;
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
}

/* Mobile */
@media (max-width: 767.98px) {
    .content-header h1 {
        font-size: 1.375rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .user-pill .role-tag {
        display: none;
    }
}
