/* Shared application styles: containers, cards, buttons, forms, toolbars, tables, charts, popups,
   responsive overrides, delete modal, micro-animations. Split from the former public/css/pos.css.
   Global and order-sensitive: rule order is preserved from the original file. A few page-exclusive
   selectors intentionally remain here because moving them would change the cascade. */

@keyframes posFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0;
}

.pos-search-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: posSpinner 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes posSpinner {
    to {
        transform: rotate(360deg);
    }
}

@keyframes resultSlideIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pos-result-price-unit {
    font-size: 10px;
    color: var(--text-light);
    margin-top: 1px;
}

/* Separator between results hint */
.pos-search-hint {
    padding: 8px 14px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
}

.pos-search-hint kbd {
    font-size: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: var(--font-family);
    color: var(--text-dark);
}

@keyframes rowIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* ── completed ── green */
.status-badge.completed {
    background: #dcfce7;
    color: #166534;
}
[data-theme="dark"] .status-badge.completed {
    background: rgba(22, 163, 74, 0.18);
    color: #4ade80;
}

/* ── draft ── blue */
.status-badge.draft {
    background: #e8f1f8;
    color: #1e40af;
}
[data-theme="dark"] .status-badge.draft {
    background: rgba(6, 182, 212, 0.18);
    color: #93c5fd;
}

/* ── pending ── amber */
.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}
[data-theme="dark"] .status-badge.pending {
    background: rgba(202, 138, 4, 0.18);
    color: #fcd34d;
}

/* ── cancelled ── red */
.status-badge.cancelled {
    background: #fee2e2;
    color: #991b1b;
}
[data-theme="dark"] .status-badge.cancelled {
    background: rgba(220, 38, 38, 0.18);
    color: #fca5a5;
}

/* ── returned ── purple */
.status-badge.returned {
    background: #ede9fe;
    color: #5b21b6;
}
[data-theme="dark"] .status-badge.returned {
    background: rgba(124, 58, 237, 0.18);
    color: #c4b5fd;
}

/* ==========================================================================
   OUT-OF-STOCK ALTERNATIVES MODAL
   ========================================================================== */

/* ── Overlay ─────────────────────────────────────────── */
.oos-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: var(--z-modal);
}

.oos-modal.show {
    display: flex;
}

/* ── Mobile ──────────────────────────────────────────── */

.billing-collapsed-hint span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    color: var(--primary-color);
}

.bill-row.total .value {
    color: var(--primary-color);
    font-size: 18px;
}

.disc-row-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.change-row .value {
    font-size: 15px;
    font-weight: 700;
    color: var(--success-hover);
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 0;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-light);
    border-color: var(--border-dark);
    color: var(--text-primary);
}

.page-footer {
    padding: 8px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-light);
}

/* Global Scrollbars */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-xl);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-dark);
}

/* ==========================================================================
   CONSOLIDATED PAGE CONTENT & CONTAINERS
   ========================================================================== */
.dashboard-content,
.sales-content,
.products-content,
.customers-content,
.inventory-content,
.reports-content,
.users-content,
.purchases-content,
.suppliers-content,
.expiry-content,
.activity-content {
    padding: 24px;
    background: var(--bg-primary);
    flex: 1;
}

/* ==========================================================================
   DASHBOARD PAGE & WIDGETS
   ========================================================================== */
.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-grid-lines span {
    display: block;
    border-top: 1px dashed var(--primary-light-border);
    opacity: 0.35;
}

.dashboard-chart-bar span {
    order: -1;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* Status Labels */
.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
}

.low-stock,
.status.low,
.status.warning {
    background: var(--warning-light);
    color: var(--warning-orange-text);
}

.out-stock,
.status.out,
.status.failed {
    background: var(--danger-light);
    color: var(--danger-color);
}

.completed,
.status.active,
.status.success {
    background: var(--success-light);
    color: var(--success-color);
}

.status.inactive {
    background: var(--bg-secondary);
    color: var(--text-gray-light);
}

.low-stock,
.out-stock,
.completed {
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
}

/* ==========================================================================
   CONSOLIDATED CARD & PANEL STRUCTURES
   ========================================================================== */
.card,
.sales-table-card,
.summary-card,
.table-card,
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-4xl);
    box-shadow: var(--shadow-sm);
}

.card,
.sales-table-card,
.summary-card,
.chart-card {
    padding: 20px;
}

.table-card {
    /* Do NOT set overflow:auto here — it would trap position:sticky inside */
    overflow: visible;
}

.table-card .table-responsive {
    overflow-x: auto; /* horizontal scroll only — Y stays with .page-content */
    overflow-y: visible;
}

/* Specific deviations */
.chart-card,
.purchases-content .table-card,
.suppliers-content .table-card {
    border-radius: var(--radius-5xl);
}

/* Card & Table Headers */
.card-header,
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background-color: transparent !important;
}

.table-header {
    padding: 16px 20px;
    background: var(--bg-card);
    border-top-left-radius: var(--radius-5xl);
    border-top-right-radius: var(--radius-5xl);
}

.card-header h3,
.table-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-gray-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.015em;
    margin: 0;
}

.card-header h3::before,
.table-header h3::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--primary-color);
    border-radius: var(--radius-sm);
}

.card-header select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    outline: none;
    font-size: 13px;
    color: var(--text-dark);
    background-color: var(--bg-primary);
    cursor: pointer;
    transition:
        border-color var(--transition-fast),
        background-color var(--transition-fast);
}

.card-header select:hover {
    border-color: var(--border-dark);
    background-color: var(--border-medium);
}

.card-header select:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* ==========================================================================
   CONSOLIDATED BUTTONS & FORM INPUTS
   ========================================================================== */
.btn-primary,
.primary-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    height: 44px;
    padding: 0 18px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background var(--transition-fast);
}

.btn-primary:hover,
.primary-btn:hover {
    background: var(--primary-hover);
}

.primary-btn {
    padding: 12px 20px;
    height: auto;
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    height: 44px;
    padding: 0 18px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--border-dark);
}

.export-btn,
.btn-export {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.export-btn:hover,
.btn-export:hover {
    background: var(--primary-hover);
}

.export-btn {
    margin-left: auto;
}

/* Stats Grid & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
    align-items: stretch;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-4xl);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 110px;
    width: 100%;
    box-sizing: border-box;
    transition:
        transform var(--transition-slow),
        box-shadow var(--transition-slow);
    box-shadow: var(--shadow-sm);
}

.stat-card > div:not(.stat-icon):not(.stat-header):not(.stat-info) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.purchases-content .stat-card,
.suppliers-content .stat-card {
    border-radius: var(--radius-5xl);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.stat-card h4 {
    color: var(--text-gray-light);
    font-size: 14px;
    margin-bottom: 6px;
}

.stat-card h2 {
    font-size: 28px;
    color: var(--text-gray-dark);
    margin-bottom: 6px;
}

.stat-card span {
    font-size: 13px;
    color: var(--success-color);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-3xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    margin-bottom: 4px;
}

.purchases-content .stat-icon,
.suppliers-content .stat-icon {
    width: 58px;
    height: 58px;
}

/* ── Purchase Toolbar ──────────────────────────────────────────── */
.pur-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-5xl);
    padding: 14px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.pur-toolbar-icon {
    position: absolute;
    left: 12px;
    color: var(--text-light);
    font-size: 13px;
    pointer-events: none;
    z-index: 1;
}

.pur-toolbar-search input,
.pur-toolbar-field input {
    width: 100%;
    height: 42px;
    padding: 0 12px 0 34px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-dark);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.pur-toolbar-search input:focus,
.pur-toolbar-field input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
}

/* Selects */
.pur-toolbar select {
    height: 42px;
    max-width: 250px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-dark);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast);
    appearance: auto;
}

.pur-toolbar select:focus {
    border-color: var(--primary-color);
}

/* Clear button */
.pur-btn-clear {
    height: 42px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

/* New Purchase button */
.pur-btn-new {
    height: 42px;
    padding: 0 18px;
    background: var(--primary-color);
    color: #fff;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    transition:
        background var(--transition-fast),
        transform var(--transition-fast);
    margin-left: auto;
}

.pur-btn-new:hover {
    background: var(--primary-dark, #0c3d68);
    color: #fff;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .pur-toolbar {
        padding: 12px;
        gap: 8px;
    }
}

.stat-icon.blue,
.blue {
    background: var(--blue-light-bg);
    color: var(--primary-color);
}

.stat-icon.green,
.green {
    background: var(--success-light);
    color: var(--success-color);
}

.stat-icon.yellow,
.orange {
    background: var(--warning-orange-bg);
    color: var(--warning-color);
}

.stat-icon.gray,
.gray {
    background: var(--gray-light-bg);
    color: var(--gray-color);
}

.stat-icon.red,
.red {
    background: var(--danger-light);
    color: var(--danger-color);
}

.purple {
    background: var(--purple-light);
    color: var(--purple-color);
}

.stat-icon.teal,
.teal {
    background: #e6f7f5;
    color: #0d9488;
}

/* ==========================================================================
   CONSOLIDATED TOOLBARS & FILTERS
   ========================================================================== */
.products-toolbar,
.customers-toolbar,
.inventory-toolbar,
.users-toolbar,
.purchases-toolbar,
.suppliers-toolbar,
.expiry-toolbar,
.activity-toolbar,
.report-filters {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-4xl);
    padding: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.stock-filter-btn {
    position: relative;
    overflow: hidden;
    height: 42px;
    margin: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
}

.stock-filter-btn .ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    pointer-events: none;
    width: 50px;
    height: 50px;
    transform: scale(0);
    animation: ripple-effect 0.6s linear;
}

@keyframes ripple-effect {
    to {
        transform: scale(3);
        opacity: 0;
    }
}

.users-toolbar,
.purchases-toolbar,
.suppliers-toolbar,
.expiry-toolbar,
.activity-toolbar,
.report-filters {
    border-radius: var(--radius-5xl);
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
}

.products-toolbar input,
.products-toolbar select,
.customers-toolbar input,
.customers-toolbar select,
.inventory-toolbar input,
.inventory-toolbar select,
.report-filters input,
.report-filters select,
.users-toolbar input,
.users-toolbar select,
.purchases-toolbar input,
.purchases-toolbar select,
.suppliers-toolbar input,
.suppliers-toolbar select,
.expiry-toolbar input,
.expiry-toolbar select,
.activity-toolbar input,
.activity-toolbar select {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    height: 44px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 0 14px;
    outline: none;
    background-color: var(--bg-card);
    color: var(--text-dark);
    font-size: 13px;
    transition: border-color var(--transition-fast);
}
#search {
    min-width: 200px !important;
}
.btn-text {
    height: 42px;
    overflow: hidden;
    /* display: flex; */
    align-content: center;
    flex-wrap: wrap;
}
.products-toolbar input:focus,
.products-toolbar select:focus,
.customers-toolbar input:focus,
.customers-toolbar select:focus,
.inventory-toolbar input:focus,
.inventory-toolbar select:focus,
.report-filters input:focus,
.report-filters select:focus,
.users-toolbar input:focus,
.users-toolbar select:focus,
.purchases-toolbar input:focus,
.purchases-toolbar select:focus,
.suppliers-toolbar input:focus,
.suppliers-toolbar select:focus,
.expiry-toolbar input:focus,
.expiry-toolbar select:focus,
.activity-toolbar input:focus,
.activity-toolbar select:focus {
    border-color: var(--primary-color);
}

.report-filters input,
.report-filters select,
.users-toolbar input,
.users-toolbar select,
.purchases-toolbar input,
.purchases-toolbar select,
.suppliers-toolbar input,
.suppliers-toolbar select,
.expiry-toolbar input,
.expiry-toolbar select,
.activity-toolbar input,
.activity-toolbar select {
    height: 46px;
}

.btn-filter {
    height: 44px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    padding: 0 18px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    color: var(--text-dark);
}

/* Expiry Card and custom colors */
.expiry-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-4xl);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.expiry-card .section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-gray-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.015em;
}

.expiry-card .section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 16px;
    background: #1f2937;
    border-radius: var(--radius-sm);
}

.expiry-card.danger-card {
    border-left: 4px solid var(--danger-color);
}
.expiry-card.danger-card .section-title::before {
    background: var(--danger-color);
}

.expiry-card.warning-card {
    border-left: 4px solid var(--warning-color);
}
.expiry-card.warning-card .section-title::before {
    background: var(--warning-color);
}

.expiry-card.success-card {
    border-left: 4px solid var(--success-color);
}
.expiry-card.success-card .section-title::before {
    background: var(--success-color);
}

/* Empty state for expired table */
.no-expired {
    padding: 56px 32px !important;
    text-align: center;
    border-top: none !important;
    background: transparent;
    position: relative;
}

.no-expired::before {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--success-light);
    color: var(--success-color);
    font-size: 28px;
    font-weight: 700;
    box-shadow: 0 0 0 8px
        color-mix(in srgb, var(--success-color) 8%, transparent);
    animation: pulse-ring 2.4s ease-in-out infinite;
}

.no-expired::after {
    content: "No products found";
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-gray-dark);
    margin-top: 0;
    letter-spacing: -0.01em;
}

.no-expired {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-light);
    letter-spacing: 0.01em;
}

@keyframes pulse-ring {
    0%,
    100% {
        box-shadow: 0 0 0 8px
            color-mix(in srgb, var(--success-color) 8%, transparent);
    }
    50% {
        box-shadow: 0 0 0 14px
            color-mix(in srgb, var(--success-color) 4%, transparent);
    }
}

.badge-expired,
.badge-danger {
    background: var(--danger-light);
    color: var(--danger-color);
}
.badge-warning {
    background: var(--warning-light);
    color: var(--warning-color);
}
.badge-success {
    background: var(--success-light);
    color: var(--success-color);
}

/* Section header (used in expiry card components) */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.field-group input,
.amount-group input,
.form-group input,
.form-group select,
.form-group textarea {
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
    background: var(--bg-card);
}

.form-group input,
.form-group select,
.form-group textarea {
    border-color: var(--border-darker);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-darker);
    transition:
        border-color var(--transition-normal),
        box-shadow var(--transition-normal);
    background: var(--bg-card);
}

.field-group input:focus,
.amount-group input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light-alpha);
}

.field-group input::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

/* ==========================================================================
   CHARTS & TABLES
   ========================================================================== */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.sales-chart {
    height: 280px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.bar {
    flex: 1;
    background: linear-gradient(to top, var(--primary-color), #38c7e3);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.donut-chart {
    width: 220px;
    height: 220px;
    margin: auto;
    border-radius: 50%;
    background: conic-gradient(
        var(--primary-color) 0% 46%,
        var(--success-hover) 46% 64%,
        var(--warning-color) 64% 78%,
        var(--purple-color) 78% 89%,
        #06b6d4 89% 100%
    );
    position: relative;
}

.donut-chart::after {
    content: "";
    position: absolute;
    width: 110px;
    height: 110px;
    background: var(--bg-card);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.legend {
    list-style: none;
    margin-top: 20px;
}

.legend li {
    padding: 6px 0;
    color: var(--text-muted);
}

/* Global table designs */
table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
}

thead {
    background: var(--bg-primary);
}

th {
    color: var(--text-gray-title);
    font-weight: 600;
    /* Sticky — pins to top of .page-content on Y scroll; follows table on X scroll */
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

th,
td {
    padding: 16px;
    text-align: left;
}

td {
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
}

tbody tr:hover {
    background: var(--bg-hover);
}

small {
    color: var(--text-light);
}

/* No Results state for tables */
.no-result {
    text-align: center;
    padding: 48px 24px !important;
    background: var(--bg-card);
}

.no-result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.no-result-icon {
    font-size: 48px;
    color: var(--text-light);
    opacity: 0.6;
    margin-bottom: 4px;
}

.no-result-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.no-result-text {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

.suppliers-content table {
    min-width: 1100px;
}

/* Roles */
.role {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.admin {
    background: var(--blue-light-bg);
    color: var(--primary-color);
}

.pharmacist {
    background: var(--success-light);
    color: var(--success-color);
}

.cashier {
    background: var(--purple-light);
    color: var(--purple-color);
}

.doctor {
    background: var(--warning-yellow);
    color: #0f172a;
}

.delivery {
    background: var(--warning-light-orange);
    color: var(--warning-dark-orange);
}

.purchases-content .paid {
    background: var(--success-light);
    color: var(--success-color);
}

.purchases-content .partial {
    background: var(--warning-light);
    color: var(--warning-color);
}

.purchases-content .unpaid {
    background: var(--danger-light);
    color: var(--danger-color);
}

.purchases-content .completed {
    background: var(--success-light);
    color: var(--success-color);
}

.purchases-content .pending {
    background: var(--blue-light-bg);
    color: var(--primary-color);
}

/* Sales layout POS page */
.sales-layout {
    display: grid;
    gap: 20px;
}

.filters {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.filters input {
    color: var(--text-dark);
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    outline: none;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
    background: var(--bg-card);
}
.filters input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light-alpha);
}

.filters input[type="text"] {
    flex: 1;
}

.filters .primary-btn {
    flex-shrink: 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

/* Ellipsis Hover and Rotation */
.invoice-close-btn:hover,
.qty-btn:hover,
.billing-toggle-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-light-border);
    color: var(--primary-color);
}

.tab {
    border: none;
    background: var(--border-color);
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
    color: var(--text-dark);
    transition:
        background var(--transition-slow),
        color var(--transition-slow),
        box-shadow var(--transition-slow);
}

.tab:hover:not(.active) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(15, 76, 129, 0.2);
}

/* ==========================================================================
   CONSOLIDATED POPUP MODALS (PRODUCT & CUSTOMER INFO)
   ========================================================================== */
.product-popup,
.customer-popup,
.user-popup {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity var(--transition-slow),
        visibility var(--transition-slow);
    z-index: var(--z-modal);
}

.customer-popup,
.user-popup {
    pointer-events: none;
}

.product-popup.show,
.customer-popup.show,
.user-popup.show {
    opacity: 1;
    visibility: visible;
}

.customer-popup.show,
.user-popup.show {
    pointer-events: auto;
}

/* Popup Content geometries */
.product-popup-content,
.add-product-popup-content,
.customer-popup-content,
.user-popup-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-6xl);
    box-shadow: var(--shadow-3xl);
    transform: translateY(30px) scale(0.95);
    transition:
        transform var(--transition-slower),
        opacity var(--transition-slower);
}

.product-popup.show .product-popup-content,
.product-popup.show .add-product-popup-content,
.customer-popup.show .customer-popup-content,
.user-popup.show .user-popup-content {
    transform: translateY(0) scale(1);
}

.product-popup-content {
    width: 550px;
    max-width: 95%;
    padding: 28px;
    overflow: hidden;
}

.add-product-popup-content {
    width: 800px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
}

.customer-popup-content,
.user-popup-content {
    width: 650px;
    max-width: 95%;
    padding: 30px;
}

.product-popup-content h2,
.add-product-popup-content h2 {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-gray-title);
}

.add-product-popup-content h2 {
    margin-bottom: 8px;
    font-size: 26px;
}

.popup-subtitle {
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Info items inside product popup */
.product-popup-content p {
    margin: 12px 0;
    padding: 12px 10px;
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    transition:
        transform var(--transition-normal),
        background var(--transition-normal);
}

.product-popup-content p:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.product-popup-content strong {
    color: var(--text-gray-title);
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    cursor: pointer;
    font-size: 16px;
    transition:
        background var(--transition-normal),
        color var(--transition-normal),
        transform var(--transition-normal);
}

.close-btn:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

/* Form geometries */
.add-product-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border-medium);
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    height: auto;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
}

/* Required field star */
.required-star {
    color: var(--danger-color);
    margin-left: 2px;
}

/* Validation error block shown inside the form */
.form-errors {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    color: var(--danger-color);
    font-size: 13px;
    line-height: 1.7;
}

[data-theme="dark"] .form-errors {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.3);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-family);
    outline: none;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light-alpha);
    background: var(--bg-card);
}

.form-group textarea {
    resize: vertical;
    min-height: 64px;
}

/* Customer details popup grid */
.customer-header,
.user-popup-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-medium);
}

.customer-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #0f4c81, #0c3d68);
}

.customer-header h2,
.user-popup-header h2 {
    margin: 0;
    color: var(--text-gray-title);
}

.customer-status {
    font-size: 14px;
}

.customer-info,
.user-popup-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.info-item {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius-3xl);
    transition:
        transform var(--transition-fast),
        background var(--transition-fast);
}

.info-item:hover {
    transform: translateY(-2px);
    background: var(--bg-hover);
}

.info-item .label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.info-item .value {
    font-weight: 600;
    color: var(--text-gray-title);
}

.suppliers-content .danger-text {
    color: var(--danger-color);
    font-weight: 600;
}

.suppliers-content .success-text {
    color: var(--success-color);
    font-weight: 600;
}

/* ==========================================================================
   RESPONSIVE DESIGN — TABLET (≤1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    /* Sidebar auto-collapse */
    .sidebar {
        width: 72px;
        min-width: 72px;
    }

    .sidebar .logo-text,
    .sidebar .nav-text,
    .sidebar .sidebar-text,
    .sidebar .branch-arrow {
        opacity: 0;
        width: 0;
        transform: translateX(-10px);
        pointer-events: none;
    }

    .sidebar .sidebar-logo {
        justify-content: center;
    }

    .sidebar .nav-item {
        justify-content: center;
        gap: 0;
    }

    /* Topbar */
    .topbar {
        padding: 0 16px;
    }

    .search-box {
        width: 260px;
    }

    /* POS layout — stack billing below cart */
    .content {
        flex-direction: column;
    }

    /* Grids & Layouts */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid,
    .dashboard-row,
    .sales-layout {
        grid-template-columns: 1fr;
    }

    .invoice-customer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    th,
    td {
        padding: 12px 10px;
    }

    .purchases-toolbar,
    .suppliers-toolbar {
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN — MOBILE (≤768px)
   ========================================================================== */
@media (max-width: 768px) {
    html,
    body {
        overflow: hidden;
    }

    /* Topbar */
    .topbar {
        padding: 0 12px;
        height: 50px;
    }

    .search-box {
        width: 180px;
        height: 50px;
        padding: 8px 0 8px 8px;
    }

    .search-box input {
        padding: 8px 12px;
        font-size: 13px;
    }

    .topbar-right {
        gap: 12px;
    }

    .user-info span {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
        gap: 12px;
    }

    .stat-card h2 {
        font-size: 20px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
        margin-bottom: 4px;
    }

    /* Page container padding */
    .dashboard-content,
    .sales-content,
    .products-content,
    .customers-content,
    .inventory-content,
    .reports-content,
    .users-content,
    .purchases-content,
    .suppliers-content {
        padding: 12px;
    }

    .card {
        overflow-x: auto;
    }

    .invoice-modal {
        padding: 14px;
    }

    .invoice-dialog {
        padding: 18px;
    }

    .invoice-customer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-toolbar,
    .customers-toolbar,
    .inventory-toolbar,
    .report-filters,
    .users-toolbar {
        flex-wrap: wrap;
        padding: 12px;
        gap: 8px;
    }

    th,
    td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .customer-info {
        grid-template-columns: 1fr;
    }

    .customer-popup-content {
        padding: 20px;
    }

    .product-popup-content {
        width: 95%;
        padding: 20px;
    }

    .product-popup-content h2 {
        font-size: 20px;
    }

    .add-product-popup-content {
        width: 95%;
        padding: 24px;
        max-height: 85vh;
    }

    .add-product-popup-content h2 {
        font-size: 22px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
    }

    .sales-chart {
        height: 200px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .purchases-toolbar,
    .suppliers-toolbar {
        flex-direction: column;
    }

    .purchases-toolbar input,
    .purchases-toolbar select,
    .purchases-toolbar .btn-primary,
    .purchases-toolbar .btn-secondary,
    .suppliers-toolbar input,
    .suppliers-toolbar select,
    .suppliers-toolbar .btn-primary,
    .suppliers-toolbar .btn-secondary {
        width: 100%;
        height: 46px;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN — PHONE (≤480px)
   ========================================================================== */
@media (max-width: 480px) {
    /* Sidebar mobile open overlay state */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: var(--z-mobile-sidebar);
        width: 200px !important;
        min-width: 200px !important;
        transition: left var(--transition-slow);
        box-shadow: 4px 0 20px rgba(15, 23, 42, 0.15);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .sidebar.mobile-open .sidebar-logo-icon {
        display: none;
    }

    .sidebar.mobile-open .sidebar-logo-full {
        display: block;
    }

    .sidebar.mobile-open .sidebar-logo {
        justify-content: center;
    }

    .sidebar.mobile-open .nav-item {
        justify-content: flex-start;
        gap: 10px;
    }

    .topbar {
        padding: 0 10px;
    }

    .search-box {
        width: 130px;
    }

    .search-box span {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .invoice-customer-grid {
        grid-template-columns: 1fr;
    }

    .invoice-summary {
        width: 100%;
    }

    .table-card {
        border-radius: var(--radius-2xl);
        overflow: auto;
    }

    .topbar-right {
        gap: 8px;
    }

    .filters {
        flex-wrap: wrap;
    }

    .donut-chart {
        width: 160px;
        height: 160px;
    }

    .donut-chart::after {
        width: 80px;
        height: 80px;
    }
}

/* ==========================================================================
   STAGGERED ENTRANCE ANIMATIONS FOR ALL PAGES
   ========================================================================== */
.stats-grid {
    animation: fadeUp 0.6s 0.05s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.products-toolbar,
.customers-toolbar,
.users-toolbar,
.inventory-toolbar,
.suppliers-toolbar,
.purchases-toolbar,
.sales-toolbar,
.reports-toolbar,
.expiry-toolbar,
.activity-toolbar,
.inventory-tabs,
.report-filters {
    animation: fadeUp 0.6s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
    position: relative;
    z-index: 10;
}

.table-card,
.sales-table-card,
.expiry-card,
.summary-card,
.chart-grid,
.charts-container,
.dashboard-row,
.charts-grid {
    animation: fadeUp 0.6s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ========================================
EXPIRY PAGE LAYOUT
======================================== */

.expiry-content {
    padding: 24px;
    background: var(--bg-primary);
}

/* ========================================
EXPIRY STATS CARDS
======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
    align-items: stretch;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    min-height: 110px;
    width: 100%;
    box-sizing: border-box;
}

.stat-card > div:not(.stat-icon) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.stat-card span {
    font-size: 13px;
    color: #16a34a;
}

.stat-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.red {
    background: #fee2e2;
}
.orange {
    background: #ffedd5;
}
.blue {
    background: #e8f1f8;
}
.green {
    background: #dcfce7;
}
.purple {
    background: #ede9fe;
}
.black {
    background: #1f2937;
    color: #f9fafb;
}

/* ========================================
EXPIRY FILTERS / TOOLBAR
======================================== */

.expiry-toolbar {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.expiry-toolbar input,
.expiry-toolbar select {
    height: 46px;
    border: 1px solid var(--border-light);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0 14px;
}

/* ========================================
EXPIRY BUTTONS
======================================== */

.btn-primary {
    background: #0f4c81;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0 18px;
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0 18px;
}

/* ========================================
EXPIRY SECTIONS
======================================== */

.expiry-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 18px;
    margin-bottom: 24px;
    overflow: visible !important;
}

/* Elevate stacking context of card and table row when dropdown is open */
.expiry-card:has(.dropdown-menu.show),
.expiry-card:has(.product-action-btn[aria-expanded="true"]) {
    position: relative !important;
    z-index: 100 !important;
}

tr:has(.dropdown-menu.show) {
    position: relative !important;
    z-index: 10 !important;
}

.danger-card {
    border-left: 4px solid #ef4444;
}

.warning-card {
    border-left: 4px solid #f59e0b;
}

.success-card {
    border-left: 4px solid #22c55e;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Section header row: title + Show All button */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
}

.section-header .section-title {
    padding: 0;
    border-bottom: none;
}

/* Expired card variant */
.expired-card {
    border-left: 4px solid #1f2937;
}

/* ========================================
EXPIRY TABLE
======================================== */

table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
}

th {
    color: var(--text-gray-title);
    font-weight: 600;
}

th,
td {
    padding: 16px;
    text-align: left;
}

thead {
    background: var(--bg-secondary);
}

td {
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* ========================================
EXPIRY STATUS BADGES
======================================== */

.badge {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge.danger {
    background: #fee2e2;
    color: #dc2626;
}

.badge.warning {
    background: #fef3c7;
    color: #ca8a04;
}

.badge.success {
    background: #dcfce7;
    color: #16a34a;
}

.badge.expired {
    background: #1f2937;
    color: #f9fafb;
}

/* ========================================
EXPIRY PAGE SCROLLBAR
======================================== */

.page-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ========================================
EXPIRY TABLET RESPONSIVE
======================================== */

@media (max-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .expiry-toolbar {
        flex-wrap: wrap;
    }
    .user-info .user-details,
    .user-info .user-chevron {
        display: none !important;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN — TABLET TO PORTRAIT (≤970px)
   ========================================================================== */
@media (max-width: 970px) {
    .topbar-status-badge {
        display: none !important;
    }

    .user-info {
        padding: 3px !important;
        border-radius: 50% !important;
        width: 38px !important;
        height: 38px !important;
        justify-content: center !important;
    }

    .user-info .user-details,
    .user-info .user-chevron {
        display: none !important;
    }

    .user-info .avatar {
        width: 30px !important;
        height: 30px !important;
        margin: 0 !important;
    }

    .topbar-right {
        gap: 10px !important;
    }
}

/* ========================================
EXPIRY MOBILE RESPONSIVE
======================================== */

@media (max-width: 768px) {
    .expiry-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .expiry-toolbar {
        flex-direction: column;
    }

    .expiry-toolbar input,
    .expiry-toolbar select,
    .btn-primary,
    .btn-secondary {
        width: 100%;
        height: 46px;
    }
}
/* ========================================
   ACTIVITY LOG PAGE MODULE & ACTION BADGES
======================================== */
.module,
.action-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.module.sales {
    background: var(--blue-light-bg);
    color: var(--primary-color);
}

.module.patients {
    background: var(--purple-light);
    color: var(--purple-color);
}

.module.purchases {
    background: var(--success-light);
    color: var(--success-color);
}

.module.system {
    background: var(--bg-secondary);
    color: var(--text-gray-light);
}

/* ── New module colours ── */
.module.stock {
    background: var(--warning-light);
    color: var(--warning-color);
}

.module.auth {
    background: var(--purple-light);
    color: var(--purple-color);
}

.module.products {
    background: var(--warning-light-orange);
    color: var(--warning-dark-orange);
}

.module.expenses {
    background: var(--danger-light);
    color: var(--danger-color);
}

.module.users {
    background: var(--blue-light-bg);
    color: var(--primary-color);
}

.module.customers {
    background: #e0f7f4;
    color: #00897b;
}

.module.suppliers {
    background: #fff3e0;
    color: #e65100;
}

/* ── Activity Status badges (properties.attributes.status) ── */
.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: capitalize;
    line-height: 1;
}

.status.pending {
    background: var(--warning-light);
    color: var(--warning-color);
}

.status.paid {
    background: var(--success-light);
    color: var(--success-color);
}

.status.partial {
    background: var(--blue-light-bg);
    color: var(--primary-color);
}

.status.success {
    background: var(--success-light);
    color: var(--success-color);
}

.status.failed {
    background: var(--danger-light);
    color: var(--danger-color);
}

.status.draft {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.status.active {
    background: var(--success-light);
    color: var(--success-color);
}

.status.inactive {
    background: var(--danger-light);
    color: var(--danger-color);
}

.status.unpaid {
    background: #fee2e2;
    color: #b91c1c;
}

[data-theme="dark"] .status.unpaid {
    background: rgba(185, 28, 28, 0.18);
    color: #fca5a5;
}

.status.completed {
    background: #d1fae5;
}

[data-theme="dark"] .status.completed {
    background: rgba(6, 95, 70, 0.22);
}

.settings-sidebar h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-gray-dark);
    margin-bottom: 20px;
    padding-left: 10px;
}

@keyframes settingsFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-section-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.settings-card-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-gray-dark);
    margin-bottom: 4px;
}

.settings-card-header p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.settings-toggle-info p {
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 0;
}

.settings-notif-card p {
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.35;
}

.settings-backup-info p {
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 0;
}

.settings-status-badge.active {
    background-color: var(--success-light);
    color: var(--success-color);
}

.settings-status-badge.inactive {
    background-color: var(--danger-light);
    color: var(--danger-color);
}

/* responsive settings layout */

/* =====================================================================
   DELETE CONFIRMATION MODAL (shared — users, suppliers, etc.)
   ===================================================================== */

.delete-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1060;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(3px);
}

.delete-modal-overlay.show {
    display: flex;
}

.delete-modal-card {
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: sbModalIn 0.22s ease;
}

.delete-modal-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.delete-warning-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.delete-title-container h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
}

.delete-modal-body {
    padding: 1.1rem 1.5rem;
}

.delete-modal-body p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.6;
}

.delete-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.btn-cancel {
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    background: transparent;
    color: var(--text-muted, #94a3b8);
    transition:
        background 0.15s,
        color 0.15s;
}

.btn-cancel:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.06));
    color: var(--text-primary, #e2e8f0);
}

.btn-delete {
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: #ef4444;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
}

.btn-delete:hover:not(:disabled) {
    background: #dc2626;
}

.btn-delete:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* =====================================================================
   BUTTON PRESS MICRO-ANIMATION
   Applies a slight scale-down on :active for a tactile "click" feel.
   Works on action triggers, portal menu items, and all form buttons.
   ===================================================================== */

/* Primary & secondary buttons (forms, toolbar) */
.btn-primary,
.btn-secondary,
.pur-btn-new,
.pur-btn-clear,
.stock-filter-btn {
    will-change: transform;
    transition:
        background var(--transition-fast, 0.15s),
        border-color var(--transition-fast, 0.15s),
        color var(--transition-fast, 0.15s),
        box-shadow var(--transition-fast, 0.15s),
        transform 0.08s ease;
}

.btn-primary:active:not(:disabled),
.btn-secondary:active:not(:disabled),
.pur-btn-new:active,
.pur-btn-clear:active,
.stock-filter-btn:active {
    transform: scale(0.96);
}

/* Delete / Cancel modal buttons */
.btn-delete,
.btn-cancel {
    will-change: transform;
    transition:
        background 0.15s,
        color 0.15s,
        transform 0.08s ease;
}

.btn-delete:active:not(:disabled),
.btn-cancel:active {
    transform: scale(0.95);
}

/* Close buttons (popup ✖) */
.close-btn {
    will-change: transform;
    transition:
        background var(--transition-fast, 0.15s),
        color var(--transition-fast, 0.15s),
        transform 0.08s ease;
}

.close-btn:active {
    transform: scale(0.88) rotate(15deg);
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
    outline: none;
    border-radius: var(--radius-4xl, 24px);
    transition: transform var(--transition-medium, 0.2s ease);
}

.stat-card-link:focus-visible {
    outline: 2px solid var(--primary-color, #2563eb);
    outline-offset: 3px;
}

.stat-card-link:hover .stat-card {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    /* border-color: var(--primary-color, #2563eb); */
}

.stat-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 4px;
}

.stat-card-title {
    color: var(--text-gray-light, #64748b);
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stat-action-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-secondary, #f1f5f9);
    transition:
        background var(--transition-fast, 0.15s),
        transform var(--transition-fast, 0.15s);
}

.stat-card-link:hover .stat-action-icon-wrapper {
    background: var(--blue-light-bg, #dbeafe);
}

.stat-action-icon {
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
    transition:
        color var(--transition-fast, 0.15s),
        transform var(--transition-fast, 0.15s);
}

.stat-card-link:hover .stat-action-icon {
    color: var(--primary-color, #2563eb);
    transform: translate(1px, -1px);
}

.stat-card-count {
    font-size: 26px;
    color: var(--text-gray-dark, #1e293b);
    margin: 2px 0 4px 0;
    line-height: 1.1;
}

.stat-card-change {
    font-size: 0.76rem;
}

/* ── Chart bar enter animation ───────────────────────────────────────────── */
@keyframes chartBarEnter {
    from {
        opacity: 0;
        transform: scaleY(0.25);
        transform-origin: bottom;
    }
    to {
        opacity: 1;
        transform: scaleY(1);
        transform-origin: bottom;
    }
}

/* ── ≤1200px: compact layout, hide SKU column ────────────────────────── */

/* ── User Info Popup — avatar ─────────────────────── */
.user-popup-avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: background 0.3s;
}

.user-popup-avatar.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}
.user-popup-avatar.inactive {
    background: linear-gradient(135deg, #64748b, #475569);
}
.user-popup-avatar.banned {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* ── Status badge ─────────────────────────────────── */
.user-popup-status {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.user-popup-status.active {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}
.user-popup-status.inactive {
    background: rgba(100, 116, 139, 0.12);
    color: #94a3b8;
}
.user-popup-status.banned {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

/* Invoice number preview badge */
.invoice-preview-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #718096);
    background: var(--input-bg, #f1f5f9);
    border-radius: 5px;
    padding: 3px 8px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.invoice-preview-label {
    opacity: 0.6;
    font-weight: 400;
}

[data-theme="dark"] .invoice-preview-badge {
    background: rgba(255, 255, 255, 0.07);
}
