/* ============================================================
   InnoPet Warehouse — Shared Components
   Tokens extend base.css; page-specific overrides kept minimal
   ============================================================ */

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -100%;
    left: 12px;
    z-index: 9999;
    padding: 8px 14px;
    background: #0f172a;
    color: #fff;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Semantic stock badges — replaces ad-hoc bg-danger-subtle scatter */
.badge-stock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid transparent;
    line-height: 1;
}
.badge-stock--out { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.badge-stock--low { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.badge-stock--ok  { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.badge-stock--neutral { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

/* Page header — single source (inventory.css keeps alias) */
.page-header--unified {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
}

/* Empty state — unified illustration + CTA */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #64748b;
}
.empty-state .empty-icon {
    font-size: 40px;
    opacity: 0.35;
    display: block;
    margin: 0 auto 10px;
}
.empty-state .empty-title { font-weight: 600; color: #0f172a; margin-bottom: 4px; }
.empty-state .empty-desc { font-size: 0.8125rem; color: #64748b; margin-bottom: 14px; }

/* Table panel — one definition */
.table-panel--unified { overflow: hidden; }

/* Responsive card stack fallback for tables on mobile */
@media (max-width: 767.98px) {
    .table--cards thead { display: none; }
    .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
    .table--cards tr {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        margin-bottom: 12px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    }
    .table--cards td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px !important;
        border-bottom: 1px solid #f1f5f9 !important;
        font-size: 0.8125rem;
    }
    .table--cards td:last-child { border-bottom: none !important; }
    .table--cards td::before {
        content: attr(data-label);
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #64748b;
        flex-shrink: 0;
    }
    .table--cards td[data-label="Actions"]::before { content: none; }
    .table--cards td[data-label="Actions"] { justify-content: flex-end; }
}

/* Filter bar dense variant */
.filter-bar--dense { padding: 10px 14px; gap: 8px; }

/* Kpi card — unified without left-border accent (taste: no left-border cards) */
.kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); border-color: #cbd5e1; }
.kpi-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kpi-card__label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b; }
.kpi-card__value { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.35rem; color: #0f172a; line-height: 1; }
.kpi-card__sub { font-size: 0.72rem; color: #94a3b8; margin-top: 6px; display: flex; align-items: center; gap: 6px; }

/* Notification bell dot */
.nav-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff; color: #475569; }
.nav-bell:hover { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; }
.nav-bell__dot { position: absolute; top: 4px; right: 6px; width: 8px; height: 8px; background: #ef4444; border-radius: 50%; border: 2px solid #fff; }
.nav-bell__count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; background: #ef4444; color: #fff; font-size: 0.68rem; font-weight: 700; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; border: 2px solid #fff; }

/* Focus visible */
:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.sidebar .nav-link:focus-visible, .btn:focus-visible { outline-offset: 1px; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Dense action queue refresh */
.queue-empty-state .material-symbols-outlined { font-size: 28px; opacity: 0.35; }
