/*
 * App-wide Stylesheet
 * Version: 2.0
 * Description: A complete and modern redesign for the application.
 */

:root {
    color-scheme: light;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    --primary: #0b2545; /* deep navy */
    --primary-dark: #071830;
    --accent: #1976d2; /* A brighter blue for accents */
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --background: #f1f5f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Layout */
.app-shell {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    --sidebar-width: 260px;
    --sidebar-padding: 24px;
    flex: 0 0 var(--sidebar-width);
    width: var(--sidebar-width);
    background: var(--primary-dark);
    color: #fff;
    padding: var(--sidebar-padding);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, padding 0.3s ease, transform 0.3s ease, opacity 0.2s ease;
    overflow-y: auto;
}
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.dashboard-header {
    background: var(--surface);
    padding: 16px clamp(16px, 4vw, 32px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.dashboard-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}
.welcome-note {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}
.page-header-titles {
    flex: 1 1 220px;
    min-width: 200px;
}
.page-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-header-text {
    display: flex;
    flex-direction: column;
}
.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.brand-mark img {
    width: 70%;
    height: 70%;
    display: block;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    margin-bottom: 8px;
}
.sidebar-brand .brand-mark {
    background: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}
.sidebar-brand-name {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
}
.sidebar-brand-sub {
    font-size: 12px;
    color: #a8b0bb;
}

.dashboard-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 0 0 auto;
    flex-wrap: wrap;
}

.sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 20px;
    line-height: 1;
}

.app-shell.sidebar-collapsed .sidebar {
    flex-basis: 0;
    width: 0;
    padding: 0;
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
    overflow: hidden;
}

.app-shell.sidebar-collapsed .app-main {
    flex: 1 1 auto;
}

.logout-form {
    margin: 0;
    display: flex;
    align-items: center;
}

.logout-form .logout-btn {
    flex: 0 0 auto;
}

.dashboard-content {
    padding: clamp(20px, 4vw, 32px);
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    align-self: center;
}

/* Sidebar */
.sidebar-user {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user-greeting {
    font-size: 14px;
    opacity: 0.7;
}
.sidebar-user-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.8);
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}
.sidebar-link:hover, .sidebar-link.active {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    transform: translateX(4px);
    box-shadow: 0 4px 10px rgba(25, 118, 210, 0.3);
}

.sidebar-link::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: currentColor;
    mask-repeat: no-repeat;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    flex-shrink: 0;
}

/* Icons for sidebar links */
a[href*="dashboard.php"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z'/%3E%3C/svg%3E"); }
a[href*="inventory.php"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-5 14H9v-2h6v2zm3-4H6v-2h12v2zm0-4H6V6h12v2z'/%3E%3C/svg%3E"); }
a[href*="clients.php"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E"); }
a[href*="suppliers.php"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M16.5 12c1.38 0 2.5-1.12 2.5-2.5S17.88 7 16.5 7C15.12 7 14 8.12 14 9.5s1.12 2.5 2.5 2.5zM9 11c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zm7.5 3c-1.83 0-5.5.92-5.5 2.75V19h11v-2.25c0-1.83-3.67-2.75-5.5-2.75zM9 13c-2.33 0-7 1.17-7 3.5V19h7v-2.25c0-.85.33-2.34 2.37-3.41C10.5 13.1 9.66 13 9 13z'/%3E%3C/svg%3E"); }
a[href*="cash.php"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M21 18v1c0 1.1-.9 2-2 2H5c-1.11 0-2-.9-2-2V5c0-1.1.89-2 2-2h14c1.1 0 2 .9 2 2v1h-9c-1.11 0-2 .9-2 2v8c0 1.1.89 2 2 2h9zm-9-2h10V8H12v8zm4-2.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z'/%3E%3C/svg%3E"); }
a[href*="reports.php"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M8 10h.01M12 10h.01M16 10h.01M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z'/%3E%3C/svg%3E"); }
a[href*="settings.php"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61.22l2-3.46c.12-.22-.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z'/%3E%3C/svg%3E"); }
}
.sidebar-group summary {
    cursor: pointer;
    list-style: none; /* Remove default marker */
}
.sidebar-group summary::-webkit-details-marker {
    display: none; /* For Chrome/Safari */
}
.sidebar-group summary::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: currentColor;
    mask-repeat: no-repeat;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    flex-shrink: 0;
}
.sidebar-subnav {
    margin-top: 4px;
    padding-right: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sidebar-subnav a {
    color: rgba(255,255,255,0.7);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
}
.sidebar-subnav a:hover, .sidebar-subnav a.active {
    background: rgba(0,0,0,0.2);
    color: #fff;
    text-decoration: none;
}
summary[class*="sales"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z'/%3E%3C/svg%3E"); }
summary[class*="purchase"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z'/%3E%3C/svg%3E"); }
summary[class*="expenses"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z'/%3E%3C/svg%3E"); }

/* Settings Page Tabs */
.settings-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.settings-nav a {
    padding: 10px 20px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    text-decoration: none;
}
.settings-nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Components */
.panel {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}
.panel-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-body {
    padding: 24px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

/* --- Responsive Sidebar (mobile) --- */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0; /* RTL: open from the right */
        z-index: 999;
        transform: translateX(100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.is-open {
        transform: translateX(0%);
    }
    .sidebar-toggle-btn {
        margin-inline-start: 8px;
    }
}

/* --- Utility visibility helpers --- */
@media (max-width: 992px) {
    .hide-mobile { display: none !important; }
}
@media (min-width: 993px) {
    .hide-desktop { display: none !important; }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.dashboard-action {
    --action-from: #2563eb;
    --action-to: #1e40af;
    --action-glow: rgba(37, 99, 235, 0.35);
    background: linear-gradient(135deg, var(--action-from), var(--action-to));
    border-radius: 18px;
    border: none;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18), 0 8px 18px var(--action-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    position: relative;
    overflow: hidden;
    min-height: 92px;
    isolation: isolate;
}

.dashboard-action::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120px 90px at 88% 18%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 60%),
        radial-gradient(140px 110px at 10% 85%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 70%);
    opacity: 0.9;
    pointer-events: none;
    z-index: 0;
}

.dashboard-action:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22), 0 10px 24px var(--action-glow);
    filter: brightness(1.02);
    text-decoration: none;
}

.dashboard-action .action-emoji {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    flex: 0 0 48px;
    z-index: 1;
}

.dashboard-action .action-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 1;
}

.dashboard-action .action-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.dashboard-action .action-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.dashboard-action .action-arrow {
    margin-inline-start: auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 1;
}

.dashboard-action:hover .action-arrow {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.28);
}

.dashboard-action.action-sale .action-emoji {
    background: rgba(255, 255, 255, 0.2);
}

.dashboard-action.action-purchase .action-emoji {
    background: rgba(255, 255, 255, 0.2);
}

.dashboard-action.action-expense .action-emoji {
    background: rgba(255, 255, 255, 0.2);
}

.dashboard-action.action-sale {
    --action-from: #16a34a;
    --action-to: #0f766e;
    --action-glow: rgba(34, 197, 94, 0.35);
}

.dashboard-action.action-purchase {
    --action-from: #2563eb;
    --action-to: #1e3a8a;
    --action-glow: rgba(37, 99, 235, 0.35);
}

.dashboard-action.action-expense {
    --action-from: #f97316;
    --action-to: #c2410c;
    --action-glow: rgba(249, 115, 22, 0.35);
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}
.stat-title {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}
.stat-trend {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Dashboard enhancements */
.dashboard-page {
    --dash-teal: rgba(14, 116, 144, 0.12);
    --dash-sky: rgba(37, 99, 235, 0.12);
    --dash-sun: rgba(251, 191, 36, 0.12);
    position: relative;
    isolation: isolate;
}

.dashboard-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(600px 240px at 6% -12%, var(--dash-teal), transparent 65%),
        radial-gradient(520px 220px at 100% 0%, var(--dash-sky), transparent 60%),
        radial-gradient(320px 200px at 45% 100%, var(--dash-sun), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.dashboard-page > * {
    position: relative;
    z-index: 1;
}

.dashboard-section {
    margin-bottom: 32px;
}

.dashboard-section-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.dashboard-section-heading h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.dashboard-section-heading p {
    font-size: 13px;
    color: var(--text-muted);
}

.dashboard-page .stats-grid,
.dashboard-page .dashboard-actions {
    margin-bottom: 0;
}

.dashboard-page .dashboard-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    background: var(--surface);
}

.dashboard-page .dashboard-panel .panel-header {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0));
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.subscription-card {
    border-inline-start: 6px solid var(--accent);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.subscription-card .panel-header {
    padding: 10px 16px;
    font-size: 15px;
}

.subscription-card .panel-body {
    padding: 14px 16px;
}

.subscription-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 14px;
}

.subscription-row-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    flex: 1 1 360px;
    min-width: 0;
}

.subscription-row-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding-inline-end: 10px;
    margin-inline-end: 6px;
    border-inline-end: 1px solid rgba(148, 163, 184, 0.45);
}

.subscription-row-item:last-child {
    padding-inline-end: 0;
    margin-inline-end: 0;
    border-inline-end: none;
}

.subscription-label {
    font-size: 11px;
    color: var(--text-muted);
}

.subscription-text {
    font-weight: 600;
    color: var(--text-main);
}

.subscription-separator {
    color: var(--text-muted);
    font-size: 11px;
}

.subscription-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
    flex-wrap: wrap;
}

.subscription-card .primary-btn,
.subscription-card .secondary-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.subscription-card .subscription-badge {
    padding: 4px 10px;
    font-size: 11px;
}

.dashboard-page .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
    background: var(--surface-alt);
    color: var(--text-main);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.dashboard-page .badge--success {
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
    border-color: rgba(22, 163, 74, 0.3);
}

.dashboard-page .badge--danger {
    background: rgba(190, 18, 60, 0.12);
    color: #9f1239;
    border-color: rgba(190, 18, 60, 0.3);
}

.dashboard-page .stat-card {
    position: relative;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-inline-start: 4px solid var(--stat-accent, var(--accent));
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-page .stat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.dashboard-page .stat-head .stat-title {
    margin: 0;
}

.dashboard-page .stat-emoji {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--stat-soft, rgba(15, 23, 42, 0.08));
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.dashboard-mini-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-mini-cards .mini-card {
    flex: 0 1 320px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(14, 165, 233, 0.06));
    color: var(--text-main);
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-mini-cards .mini-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.12);
    text-decoration: none;
}

.mini-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-emoji {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: rgba(79, 70, 229, 0.12);
}

.mini-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.mini-card-body {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.mini-main {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.mini-amount {
    font-size: 14px;
    font-weight: 700;
    color: #1d4ed8;
    white-space: nowrap;
}

.mini-sub {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-link {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
}

.dashboard-mini-cards .mini-card--warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(248, 113, 113, 0.08));
}

.dashboard-mini-cards .mini-card--warning .mini-emoji {
    background: rgba(245, 158, 11, 0.18);
}

.dashboard-mini-cards .mini-card--warning .mini-amount {
    color: #b45309;
}

.dashboard-mini-cards .mini-card--cash {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(14, 116, 144, 0.06));
}

.dashboard-mini-cards .mini-card--cash .mini-emoji {
    background: rgba(16, 185, 129, 0.18);
}

.dashboard-mini-cards .mini-card--cash .mini-amount {
    color: #0f766e;
}

.dashboard-page .stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120px 80px at 12% 8%, var(--stat-soft, rgba(25, 118, 210, 0.12)), rgba(255, 255, 255, 0) 65%);
    pointer-events: none;
}

.dashboard-page .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.dashboard-page .stat-title {
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
}

.dashboard-page .stat-value {
    color: var(--stat-accent, var(--primary));
    font-variant-numeric: tabular-nums;
}

.dashboard-page .stat-trend {
    font-size: 12px;
}

.dashboard-page .stat-card--blue { --stat-accent: #1d4ed8; --stat-soft: rgba(29, 78, 216, 0.12); }
.dashboard-page .stat-card--indigo { --stat-accent: #4338ca; --stat-soft: rgba(67, 56, 202, 0.12); }
.dashboard-page .stat-card--teal { --stat-accent: #0f766e; --stat-soft: rgba(15, 118, 110, 0.12); }
.dashboard-page .stat-card--amber { --stat-accent: #b45309; --stat-soft: rgba(180, 83, 9, 0.12); }
.dashboard-page .stat-card--emerald { --stat-accent: #15803d; --stat-soft: rgba(21, 128, 61, 0.12); }
.dashboard-page .stat-card--sky { --stat-accent: #0284c7; --stat-soft: rgba(2, 132, 199, 0.12); }
.dashboard-page .stat-card--orange { --stat-accent: #c2410c; --stat-soft: rgba(194, 65, 12, 0.12); }
.dashboard-page .stat-card--rose { --stat-accent: #be123c; --stat-soft: rgba(190, 18, 60, 0.12); }
.dashboard-page .stat-card--slate { --stat-accent: #475569; --stat-soft: rgba(71, 85, 105, 0.12); }

.dashboard-page .dashboard-table thead th {
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
}

.dashboard-page .dashboard-table th,
.dashboard-page .dashboard-table td {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.dashboard-page .dashboard-table tbody tr {
    transition: background-color 0.15s ease;
}

.dashboard-page .dashboard-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.02);
}

.dashboard-page .dashboard-table tbody tr:hover {
    background: rgba(25, 118, 210, 0.08);
}

.dashboard-page .dashboard-table tbody tr.low-stock-row {
    background: rgba(248, 113, 113, 0.14);
}

.dashboard-page .dashboard-table tbody tr.low-stock-row:hover {
    background: rgba(248, 113, 113, 0.2);
}

.dashboard-page .low-stock-qty {
    font-weight: 700;
    color: #b91c1c;
}

.dashboard-page .welcome-panel {
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.12), rgba(37, 99, 235, 0.08));
    border-color: rgba(14, 116, 144, 0.2);
}

.dashboard-page .welcome-panel h2 {
    margin-bottom: 6px;
    font-size: 20px;
}

.dashboard-page .helper-text {
    color: var(--text-muted);
    font-size: 12px;
}

.dashboard-page .helper-text--label {
    margin-bottom: 6px;
}

.dashboard-page .helper-text--note {
    margin-top: 12px;
}

@keyframes dashboard-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-page .dashboard-actions .dashboard-action,
.dashboard-page .stats-grid .stat-card,
.dashboard-page .dashboard-panel {
    animation: dashboard-rise 0.5s ease both;
}

.dashboard-page .dashboard-actions .dashboard-action:nth-child(1) { animation-delay: 0.05s; }
.dashboard-page .dashboard-actions .dashboard-action:nth-child(2) { animation-delay: 0.1s; }
.dashboard-page .dashboard-actions .dashboard-action:nth-child(3) { animation-delay: 0.15s; }

.dashboard-page .stats-grid .stat-card:nth-child(1) { animation-delay: 0.02s; }
.dashboard-page .stats-grid .stat-card:nth-child(2) { animation-delay: 0.04s; }
.dashboard-page .stats-grid .stat-card:nth-child(3) { animation-delay: 0.06s; }
.dashboard-page .stats-grid .stat-card:nth-child(4) { animation-delay: 0.08s; }
.dashboard-page .stats-grid .stat-card:nth-child(5) { animation-delay: 0.1s; }
.dashboard-page .stats-grid .stat-card:nth-child(6) { animation-delay: 0.12s; }
.dashboard-page .stats-grid .stat-card:nth-child(7) { animation-delay: 0.14s; }
.dashboard-page .stats-grid .stat-card:nth-child(8) { animation-delay: 0.16s; }
.dashboard-page .stats-grid .stat-card:nth-child(9) { animation-delay: 0.18s; }
.dashboard-page .stats-grid .stat-card:nth-child(10) { animation-delay: 0.2s; }

@media (max-width: 768px) {
    .dashboard-section-heading h2 {
        font-size: 18px;
    }
    .subscription-row {
        gap: 6px 10px;
    }
    .subscription-row-details {
        gap: 6px 10px;
    }
    .subscription-row-item {
        padding-inline-end: 8px;
        margin-inline-end: 4px;
    }
    .subscription-actions {
        width: 100%;
        margin-inline-start: 0;
    }
    .subscription-actions .primary-btn,
    .subscription-actions .secondary-btn {
        flex: 1 1 160px;
    }
    .dashboard-mini-cards {
        gap: 10px;
    }
    .dashboard-mini-cards .mini-card {
        flex: 1 1 100%;
    }
    .dashboard-page .dashboard-table th,
    .dashboard-page .dashboard-table td {
        padding: 12px 10px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-page .dashboard-actions .dashboard-action,
    .dashboard-page .stats-grid .stat-card,
    .dashboard-page .dashboard-panel {
        animation: none;
    }
}

/* Sales page */
.sales-page {
    position: relative;
    isolation: isolate;
}

.sales-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(520px 220px at 8% -10%, rgba(14, 165, 233, 0.12), transparent 65%),
        radial-gradient(420px 200px at 100% 0%, rgba(16, 185, 129, 0.12), transparent 60%),
        radial-gradient(320px 180px at 40% 100%, rgba(251, 191, 36, 0.12), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.sales-page > * {
    position: relative;
    z-index: 1;
}

.sales-page .sales-stats {
    margin-bottom: 28px;
}

.sales-page .sales-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    background: var(--surface);
}

.sales-page .sales-panel .panel-header {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0));
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.sales-page .sales-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.sales-page .stat-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-inline-start: 4px solid var(--stat-accent, var(--accent));
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.sales-page .stat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.sales-page .stat-emoji {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: var(--stat-soft, rgba(15, 23, 42, 0.08));
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.sales-page .stat-value {
    color: var(--stat-accent, var(--primary));
    font-variant-numeric: tabular-nums;
}

.sales-page .stat-trend {
    font-size: 12px;
}

.sales-page .stat-card--sales {
    --stat-accent: #0ea5e9;
    --stat-soft: rgba(14, 165, 233, 0.14);
}

.sales-page .stat-card--paid {
    --stat-accent: #16a34a;
    --stat-soft: rgba(22, 163, 74, 0.14);
}

.sales-page .stat-card--due {
    --stat-accent: #f97316;
    --stat-soft: rgba(249, 115, 22, 0.14);
}

.sales-page .sales-filter-card {
    display: grid;
    gap: 16px;
}

.sales-page .sales-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    align-items: end;
}

.sales-page .sales-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sales-page .sales-filter-search {
    grid-column: span 2;
    min-width: 240px;
}

.sales-page .sales-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.sales-page .sales-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sales-page .sales-date-range input {
    flex: 1 1 140px;
}

.sales-page .range-sep {
    color: var(--text-muted);
    font-size: 14px;
}

.sales-page .sales-filter-row--chips {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 16px;
    align-items: center;
}

.sales-page .sales-filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.sales-page .chip-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-inline-end: 4px;
}

.sales-page .sales-filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.sales-page .sales-filter-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.sales-page .sales-filter-chip.is-active {
    background: rgba(25, 118, 210, 0.12);
    border-color: rgba(25, 118, 210, 0.3);
    color: var(--accent);
}

.sales-page .sales-filter-advanced {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    background: var(--surface-alt);
}

.sales-page .sales-filter-advanced > summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-main);
    list-style: none;
}

.sales-page .sales-filter-advanced > summary::-webkit-details-marker {
    display: none;
}

.sales-page .sales-filter-advanced > summary::after {
    content: '▾';
    margin-inline-start: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.sales-page .sales-filter-advanced[open] > summary::after {
    content: '▴';
}

.sales-page .sales-filter-advanced-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
    margin-top: 12px;
}

.sales-page .sales-filter-advanced-body .filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sales-page .sales-filter-card input,
.sales-page .sales-filter-card select {
    background: var(--surface);
}

.sales-page .sales-filter-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.18);
    color: #92400e;
    font-size: 12px;
    margin-bottom: 12px;
}

.sales-page .sales-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.sales-page .sales-pagination-info {
    font-size: 12px;
    color: var(--text-muted);
}

.sales-page .sales-pagination-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sales-page .pagination-number {
    min-width: 32px;
    text-align: center;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-main);
    background: var(--surface);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.sales-page .pagination-number:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.sales-page .pagination-number.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.sales-page .pagination-btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.sales-page .pagination-ellipsis {
    font-size: 12px;
    color: var(--text-muted);
    padding: 0 4px;
}

.sales-page .sales-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 980px;
}

.sales-page .sales-table thead th {
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: none;
}

.sales-page .sales-table th,
.sales-page .sales-table td {
    padding: 12px 14px;
}

.sales-page .sales-table tbody tr {
    background: var(--surface);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.sales-page .sales-table tbody td {
    background: var(--surface);
    border-bottom: none;
}

.sales-page .sales-table tbody tr:hover td {
    background: var(--surface-alt);
}

.sales-page .sales-table tbody tr td:first-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.sales-page .sales-table tbody tr td:last-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.sales-page .sale-date {
    color: var(--text-muted);
    font-size: 13px;
}

.sales-page .sale-amount,
.sales-page .sale-paid,
.sales-page .sale-remaining {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sales-page .sale-paid {
    color: #0f766e;
    font-weight: 600;
}

.sales-page .sale-remaining--due {
    color: #b91c1c;
    font-weight: 700;
}

.sales-page .sale-remaining--over {
    color: #15803d;
    font-weight: 700;
}

.sales-page .sales-actions {
    flex-wrap: wrap;
    gap: 6px;
}

.sales-page .sales-actions .action-btn {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
}

.sales-page .pill {
    font-size: 12px;
    padding: 4px 8px;
}

.sales-page .empty-state td {
    text-align: center;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-radius: 10px;
}

@media (max-width: 900px) {
    .sales-page .sales-filter-row {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .sales-page .sales-filter-search {
        grid-column: span 1;
    }
    .sales-page .sales-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
    .sales-page .sales-filter-row--chips {
        grid-template-columns: 1fr;
    }
    .sales-page .sales-filter-advanced-body {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .sales-page .sales-table {
        min-width: 760px;
    }
}

/* Purchases page */
.purchases-page {
    position: relative;
    isolation: isolate;
}

.purchases-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(520px 220px at 10% -10%, rgba(14, 116, 144, 0.12), transparent 65%),
        radial-gradient(420px 200px at 100% 0%, rgba(14, 165, 233, 0.12), transparent 60%),
        radial-gradient(320px 180px at 45% 100%, rgba(234, 179, 8, 0.12), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.purchases-page > * {
    position: relative;
    z-index: 1;
}

.purchases-page .purchases-stats {
    margin-bottom: 28px;
}

.purchases-page .purchases-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    background: var(--surface);
}

.purchases-page .purchases-panel .panel-header {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0));
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.purchases-page .purchases-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.purchases-page .stat-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-inline-start: 4px solid var(--stat-accent, var(--accent));
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.purchases-page .stat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.purchases-page .stat-emoji {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: var(--stat-soft, rgba(15, 23, 42, 0.08));
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.purchases-page .stat-value {
    color: var(--stat-accent, var(--primary));
    font-variant-numeric: tabular-nums;
}

.purchases-page .stat-trend {
    font-size: 12px;
}

.purchases-page .stat-card--count {
    --stat-accent: #2563eb;
    --stat-soft: rgba(37, 99, 235, 0.14);
}

.purchases-page .stat-card--total {
    --stat-accent: #0f766e;
    --stat-soft: rgba(15, 118, 110, 0.14);
}

.purchases-page .stat-card--paid {
    --stat-accent: #16a34a;
    --stat-soft: rgba(22, 163, 74, 0.14);
}

.purchases-page .stat-card--due {
    --stat-accent: #f97316;
    --stat-soft: rgba(249, 115, 22, 0.14);
}

.purchases-page .purchases-filter-card {
    display: grid;
    gap: 16px;
}

.purchases-page .purchases-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    align-items: end;
}

.purchases-page .purchases-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.purchases-page .purchases-filter-search {
    grid-column: span 2;
    min-width: 240px;
}

.purchases-page .purchases-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.purchases-page .purchases-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.purchases-page .purchases-date-range input {
    flex: 1 1 140px;
}

.purchases-page .range-sep {
    color: var(--text-muted);
    font-size: 14px;
}

.purchases-page .purchases-filter-row--chips {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 16px;
    align-items: center;
}

.purchases-page .purchases-filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.purchases-page .chip-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-inline-end: 4px;
}

.purchases-page .purchases-filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.purchases-page .purchases-filter-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.purchases-page .purchases-filter-chip.is-active {
    background: rgba(25, 118, 210, 0.12);
    border-color: rgba(25, 118, 210, 0.3);
    color: var(--accent);
}

.purchases-page .purchases-filter-advanced {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    background: var(--surface-alt);
}

.purchases-page .purchases-filter-advanced > summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-main);
    list-style: none;
}

.purchases-page .purchases-filter-advanced > summary::-webkit-details-marker {
    display: none;
}

.purchases-page .purchases-filter-advanced > summary::after {
    content: '▾';
    margin-inline-start: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.purchases-page .purchases-filter-advanced[open] > summary::after {
    content: '▴';
}

.purchases-page .purchases-filter-advanced-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
    margin-top: 12px;
}

.purchases-page .purchases-filter-advanced-body .filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.purchases-page .purchases-filter-card input,
.purchases-page .purchases-filter-card select {
    background: var(--surface);
}

.purchases-page .purchases-filter-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.18);
    color: #92400e;
    font-size: 12px;
    margin-bottom: 12px;
}

.purchases-page .purchases-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.purchases-page .purchases-pagination-info {
    font-size: 12px;
    color: var(--text-muted);
}

.purchases-page .purchases-pagination-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.purchases-page .pagination-number {
    min-width: 32px;
    text-align: center;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-main);
    background: var(--surface);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.purchases-page .pagination-number:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.purchases-page .pagination-number.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.purchases-page .pagination-btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.purchases-page .pagination-ellipsis {
    font-size: 12px;
    color: var(--text-muted);
    padding: 0 4px;
}

.purchases-page .purchase-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 980px;
    table-layout: auto;
}

.purchases-page .purchase-table thead th {
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: none;
}

.purchases-page .purchase-table th,
.purchases-page .purchase-table td {
    padding: 12px 14px;
}

.purchases-page .purchase-table tbody tr {
    background: var(--surface);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.purchases-page .purchase-table tbody td {
    background: var(--surface);
    border-bottom: none;
}

.purchases-page .purchase-table tbody tr:hover td {
    background: var(--surface-alt);
}

.purchases-page .purchase-table tbody tr td:first-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.purchases-page .purchase-table tbody tr td:last-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.purchases-page .cell-amount {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.purchases-page .purchase-table .cell-amount {
    white-space: nowrap;
}

.purchases-page .purchases-actions {
    flex-wrap: wrap;
    gap: 6px;
}

.purchases-page .purchases-actions .action-btn {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
}

.purchases-page .pill {
    font-size: 12px;
    padding: 4px 8px;
}

.purchases-page .empty-state td {
    text-align: center;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-radius: 10px;
}

@media (max-width: 900px) {
    .purchases-page .purchases-filter-row {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .purchases-page .purchases-filter-search {
        grid-column: span 1;
    }
    .purchases-page .purchases-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
    .purchases-page .purchases-filter-row--chips {
        grid-template-columns: 1fr;
    }
    .purchases-page .purchases-filter-advanced-body {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .purchases-page .purchase-table {
        min-width: 0;
        border-spacing: 0;
    }
}

/* Expenses page */
.expenses-page {
    position: relative;
    isolation: isolate;
}

.expenses-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(520px 220px at 6% -10%, rgba(14, 116, 144, 0.12), transparent 65%),
        radial-gradient(460px 220px at 100% 0%, rgba(14, 165, 233, 0.12), transparent 60%),
        radial-gradient(320px 200px at 45% 100%, rgba(249, 115, 22, 0.12), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.expenses-page > * {
    position: relative;
    z-index: 1;
}

.expenses-page .expenses-stats {
    margin-bottom: 28px;
}

.expenses-page .expenses-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    background: var(--surface);
}

.expenses-page .expenses-panel .panel-header {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0));
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.expenses-page .expenses-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.expenses-page .stat-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-inline-start: 4px solid var(--stat-accent, var(--accent));
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.expenses-page .stat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.expenses-page .stat-emoji {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: var(--stat-soft, rgba(15, 23, 42, 0.08));
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.expenses-page .stat-value {
    color: var(--stat-accent, var(--primary));
    font-variant-numeric: tabular-nums;
}

.expenses-page .stat-trend {
    font-size: 12px;
}

.expenses-page .stat-card--total {
    --stat-accent: #0ea5e9;
    --stat-soft: rgba(14, 165, 233, 0.14);
}

.expenses-page .stat-card--critical {
    --stat-accent: #ef4444;
    --stat-soft: rgba(239, 68, 68, 0.14);
}

.expenses-page .stat-card--important {
    --stat-accent: #f59e0b;
    --stat-soft: rgba(245, 158, 11, 0.16);
}

.expenses-page .stat-card--optional {
    --stat-accent: #22c55e;
    --stat-soft: rgba(34, 197, 94, 0.16);
}

.expenses-page .expenses-filter-card {
    display: grid;
    gap: 16px;
}

.expenses-page .expenses-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    align-items: end;
}

.expenses-page .expenses-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.expenses-page .expenses-filter-search {
    grid-column: span 2;
    min-width: 240px;
}

.expenses-page .expenses-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.expenses-page .expenses-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.expenses-page .expenses-date-range input {
    flex: 1 1 140px;
}

.expenses-page .range-sep {
    color: var(--text-muted);
    font-size: 14px;
}

.expenses-page .expenses-filter-row--chips {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 16px;
    align-items: center;
}

.expenses-page .expenses-filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.expenses-page .chip-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-inline-end: 4px;
}

.expenses-page .expenses-filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.expenses-page .expenses-filter-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.expenses-page .expenses-filter-chip.is-active {
    background: rgba(25, 118, 210, 0.12);
    border-color: rgba(25, 118, 210, 0.3);
    color: var(--accent);
}

.expenses-page .expenses-filter-advanced {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    background: var(--surface-alt);
}

.expenses-page .expenses-filter-advanced > summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-main);
    list-style: none;
}

.expenses-page .expenses-filter-advanced > summary::-webkit-details-marker {
    display: none;
}

.expenses-page .expenses-filter-advanced > summary::after {
    content: '▾';
    margin-inline-start: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.expenses-page .expenses-filter-advanced[open] > summary::after {
    content: '▴';
}

.expenses-page .expenses-filter-advanced-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
    margin-top: 12px;
}

.expenses-page .expenses-filter-advanced-body .filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.expenses-page .expenses-filter-card input,
.expenses-page .expenses-filter-card select {
    background: var(--surface);
}

.expenses-page .expenses-filter-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.18);
    color: #92400e;
    font-size: 12px;
    margin-bottom: 12px;
}

.expenses-page .expenses-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.expenses-page .expenses-pagination-info {
    font-size: 12px;
    color: var(--text-muted);
}

.expenses-page .expenses-pagination-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.expenses-page .pagination-number {
    min-width: 32px;
    text-align: center;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-main);
    background: var(--surface);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.expenses-page .pagination-number:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.expenses-page .pagination-number.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.expenses-page .pagination-btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.expenses-page .pagination-ellipsis {
    font-size: 12px;
    color: var(--text-muted);
    padding: 0 4px;
}

.expenses-page .expenses-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 940px;
}

.expenses-page .expenses-summary-table {
    min-width: 420px;
}

.expenses-page .expenses-table thead th {
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: none;
}

.expenses-page .expenses-table th,
.expenses-page .expenses-table td {
    padding: 12px 14px;
}

.expenses-page .expenses-table tbody tr {
    background: var(--surface);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.expenses-page .expenses-table tbody td {
    background: var(--surface);
    border-bottom: none;
}

.expenses-page .expenses-table tbody tr:hover td {
    background: var(--surface-alt);
}

.expenses-page .expenses-table tbody tr td:first-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.expenses-page .expenses-table tbody tr td:last-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.expenses-page .expense-date {
    color: var(--text-muted);
    font-size: 13px;
}

.expenses-page .expense-amount {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.expenses-page .priority-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}

.expenses-page .priority-critical {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.3);
}

.expenses-page .priority-important {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.35);
}

.expenses-page .priority-optional {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.3);
}

.expenses-page .expenses-actions {
    flex-wrap: wrap;
    gap: 6px;
}

.expenses-page .expenses-actions .action-btn {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
}

.expenses-page .empty-state td {
    text-align: center;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-radius: 10px;
}

@media (max-width: 900px) {
    .expenses-page .expenses-filter-row {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .expenses-page .expenses-filter-search {
        grid-column: span 1;
    }
    .expenses-page .expenses-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
    .expenses-page .expenses-filter-row--chips {
        grid-template-columns: 1fr;
    }
    .expenses-page .expenses-filter-advanced-body {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .expenses-page .expenses-table {
        min-width: 760px;
    }
}

/* Clients page */
.clients-page {
    position: relative;
    isolation: isolate;
}

.clients-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(520px 220px at 8% -10%, rgba(14, 165, 233, 0.12), transparent 65%),
        radial-gradient(460px 220px at 100% 0%, rgba(99, 102, 241, 0.12), transparent 60%),
        radial-gradient(320px 200px at 45% 100%, rgba(16, 185, 129, 0.12), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.clients-page > * {
    position: relative;
    z-index: 1;
}

.clients-page .clients-stats {
    margin-bottom: 28px;
}

.clients-page .clients-actions-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.clients-page .clients-actions-bar .primary-btn {
    padding: 10px 16px;
    font-size: 14px;
}

.clients-page .clients-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    background: var(--surface);
}

.clients-page .clients-panel .panel-header {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0));
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.clients-page .clients-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.clients-page .stat-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-inline-start: 4px solid var(--stat-accent, var(--accent));
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.clients-page .stat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.clients-page .stat-emoji {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: var(--stat-soft, rgba(15, 23, 42, 0.08));
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.clients-page .stat-value {
    color: var(--stat-accent, var(--primary));
    font-variant-numeric: tabular-nums;
}

.clients-page .stat-trend {
    font-size: 12px;
}

.clients-page .stat-card--count {
    --stat-accent: #0ea5e9;
    --stat-soft: rgba(14, 165, 233, 0.14);
}

.clients-page .stat-card--sales {
    --stat-accent: #6366f1;
    --stat-soft: rgba(99, 102, 241, 0.14);
}

.clients-page .stat-card--paid {
    --stat-accent: #16a34a;
    --stat-soft: rgba(22, 163, 74, 0.14);
}

.clients-page .stat-card--due {
    --stat-accent: #f97316;
    --stat-soft: rgba(249, 115, 22, 0.14);
}

.clients-page .clients-filter-card {
    display: grid;
    gap: 16px;
}

.clients-page .clients-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    align-items: end;
}

.clients-page .clients-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.clients-page .clients-filter-search {
    grid-column: span 2;
    min-width: 240px;
}

.clients-page .clients-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.clients-page .clients-filter-row--chips {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 16px;
    align-items: center;
}

.clients-page .clients-filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.clients-page .chip-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-inline-end: 4px;
}

.clients-page .clients-filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.clients-page .clients-filter-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.clients-page .clients-filter-chip.is-active {
    background: rgba(25, 118, 210, 0.12);
    border-color: rgba(25, 118, 210, 0.3);
    color: var(--accent);
}

.clients-page .clients-filter-advanced {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    background: var(--surface-alt);
}

.clients-page .clients-filter-advanced > summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-main);
    list-style: none;
}

.clients-page .clients-filter-advanced > summary::-webkit-details-marker {
    display: none;
}

.clients-page .clients-filter-advanced > summary::after {
    content: '▾';
    margin-inline-start: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.clients-page .clients-filter-advanced[open] > summary::after {
    content: '▴';
}

.clients-page .clients-filter-advanced-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
    margin-top: 12px;
}

.clients-page .clients-filter-advanced-body .filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.clients-page .clients-filter-card input,
.clients-page .clients-filter-card select {
    background: var(--surface);
}

.clients-page .clients-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.clients-page .clients-pagination-info {
    font-size: 12px;
    color: var(--text-muted);
}

.clients-page .clients-pagination-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.clients-page .pagination-number {
    min-width: 32px;
    text-align: center;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-main);
    background: var(--surface);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.clients-page .pagination-number:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.clients-page .pagination-number.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.clients-page .pagination-btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.clients-page .pagination-ellipsis {
    font-size: 12px;
    color: var(--text-muted);
    padding: 0 4px;
}

.clients-page .clients-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 980px;
}

.clients-page .clients-table thead th {
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: none;
}

.clients-page .clients-table th,
.clients-page .clients-table td {
    padding: 12px 14px;
}

.clients-page .clients-table tbody tr {
    background: var(--surface);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.clients-page .clients-table tbody td {
    background: var(--surface);
    border-bottom: none;
}

.clients-page .clients-table tbody tr:hover td {
    background: var(--surface-alt);
}

.clients-page .clients-table tbody tr td:first-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.clients-page .clients-table tbody tr td:last-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.clients-page .client-amount {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.clients-page .client-outstanding--due {
    color: #b91c1c;
    font-weight: 700;
}

.clients-page .client-outstanding--clear {
    color: #15803d;
    font-weight: 700;
}

.clients-page .client-phone,
.clients-page .client-email {
    color: var(--text-muted);
    font-size: 13px;
}

.clients-page .clients-actions {
    flex-wrap: wrap;
    gap: 6px;
}

.clients-page .clients-actions .action-btn {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
}

.clients-page .client-sales-list li {
    background: var(--surface-alt);
    border: 1px solid var(--border);
}

.clients-page .client-sale-link {
    color: var(--accent);
}

.clients-page .empty-state td {
    text-align: center;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-radius: 10px;
}

@media (max-width: 900px) {
    .clients-page .clients-filter-row {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .clients-page .clients-filter-search {
        grid-column: span 1;
    }
    .clients-page .clients-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
    .clients-page .clients-filter-row--chips {
        grid-template-columns: 1fr;
    }
    .clients-page .clients-filter-advanced-body {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .clients-page .clients-table {
        min-width: 760px;
    }
}

/* Client detail page */
.client-page {
    position: relative;
    isolation: isolate;
}

.client-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(520px 220px at 8% -10%, rgba(14, 165, 233, 0.12), transparent 65%),
        radial-gradient(460px 220px at 100% 0%, rgba(34, 197, 94, 0.12), transparent 60%),
        radial-gradient(320px 200px at 45% 100%, rgba(249, 115, 22, 0.12), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.client-page > * {
    position: relative;
    z-index: 1;
}

.client-page .client-stats {
    margin-bottom: 28px;
}

.client-page .client-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    background: var(--surface);
}

.client-page .client-panel .panel-header {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0));
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.client-page .client-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.client-page .stat-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-inline-start: 4px solid var(--stat-accent, var(--accent));
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.client-page .stat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.client-page .stat-emoji {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: var(--stat-soft, rgba(15, 23, 42, 0.08));
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.client-page .stat-value {
    color: var(--stat-accent, var(--primary));
    font-variant-numeric: tabular-nums;
}

.client-page .stat-trend {
    font-size: 12px;
}

.client-page .stat-card--count {
    --stat-accent: #0ea5e9;
    --stat-soft: rgba(14, 165, 233, 0.14);
}

.client-page .stat-card--sales {
    --stat-accent: #6366f1;
    --stat-soft: rgba(99, 102, 241, 0.14);
}

.client-page .stat-card--paid {
    --stat-accent: #16a34a;
    --stat-soft: rgba(22, 163, 74, 0.14);
}

.client-page .stat-card--due {
    --stat-accent: #f97316;
    --stat-soft: rgba(249, 115, 22, 0.14);
}

.client-page .client-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.client-page .client-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: var(--surface-alt);
    border-radius: 14px;
    padding: 16px;
}

.client-page .client-card-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-main);
}

.client-page .client-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.client-page .client-info-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.client-page .client-info-list strong {
    color: var(--text-main);
    font-weight: 600;
}

.client-page .client-note {
    margin: 0;
    color: var(--text-main);
    line-height: 1.6;
}

.client-page .client-span-full {
    grid-column: 1 / -1;
}

.client-page .client-outstanding-badge {
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.client-page .client-payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    align-items: start;
}

.client-page .client-payment-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.client-page .client-payment-balance {
    margin: 0 0 6px 0;
    font-weight: 600;
    color: var(--text-main);
}

.client-page .client-payment-form .helper-text {
    margin-top: 6px;
}

.client-page .client-form-actions {
    justify-content: flex-end;
}

.client-page .client-due-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.client-page .client-due-head h3 {
    margin: 0;
    font-size: 16px;
}

.client-page .client-due-badge {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.client-page .client-due-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.client-page .client-due-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
}

.client-page .client-due-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    font-size: 13px;
}

.client-page .client-sale-date {
    color: var(--text-muted);
}

.client-page .client-sale-remaining {
    font-weight: 600;
}

.client-page .client-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 940px;
}

.client-page .client-table thead th {
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: none;
}

.client-page .client-table th,
.client-page .client-table td {
    padding: 12px 14px;
}

.client-page .client-table tbody tr {
    background: var(--surface);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.client-page .client-table tbody td {
    background: var(--surface);
    border-bottom: none;
}

.client-page .client-table tbody tr:hover td {
    background: var(--surface-alt);
}

.client-page .client-table tbody tr td:first-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.client-page .client-table tbody tr td:last-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.client-page .client-actions {
    flex-wrap: wrap;
    gap: 6px;
}

.client-page .client-actions .action-btn {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
}

.client-page .client-amount--due {
    color: #b45309;
    font-weight: 700;
}

.client-page .client-amount--credit {
    color: #0f766e;
    font-weight: 700;
}

.client-page .client-amount--clear {
    color: #15803d;
    font-weight: 700;
}

.client-page .empty-state td {
    text-align: center;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-radius: 10px;
}

@media (max-width: 900px) {
    .client-page .client-table {
        min-width: 760px;
    }
}

/* Suppliers page */
.suppliers-page,
.supplier-page {
    position: relative;
    isolation: isolate;
}

.suppliers-page::before,
.supplier-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(520px 220px at 8% -10%, rgba(14, 165, 233, 0.12), transparent 65%),
        radial-gradient(460px 220px at 100% 0%, rgba(249, 115, 22, 0.12), transparent 60%),
        radial-gradient(320px 200px at 45% 100%, rgba(34, 197, 94, 0.12), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.suppliers-page > *,
.supplier-page > * {
    position: relative;
    z-index: 1;
}

.suppliers-page .suppliers-stats,
.supplier-page .supplier-stats {
    margin-bottom: 28px;
}

.suppliers-page .suppliers-actions-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.suppliers-page .suppliers-actions-bar .primary-btn {
    padding: 10px 16px;
    font-size: 14px;
}

.suppliers-page .suppliers-permission-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px dashed var(--border);
    background: var(--surface-alt);
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 13px;
}

.suppliers-page .suppliers-panel,
.supplier-page .supplier-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    background: var(--surface);
}

.suppliers-page .suppliers-panel .panel-header,
.supplier-page .supplier-panel .panel-header {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0));
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.suppliers-page .suppliers-panel-header,
.supplier-page .supplier-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.supplier-page .supplier-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.suppliers-page .stat-card,
.supplier-page .stat-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-inline-start: 4px solid var(--stat-accent, var(--accent));
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.suppliers-page .stat-head,
.supplier-page .stat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.suppliers-page .stat-emoji,
.supplier-page .stat-emoji {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: var(--stat-soft, rgba(15, 23, 42, 0.08));
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.suppliers-page .stat-value,
.supplier-page .stat-value {
    color: var(--stat-accent, var(--primary));
    font-variant-numeric: tabular-nums;
}

.suppliers-page .stat-trend,
.supplier-page .stat-trend {
    font-size: 12px;
}

.suppliers-page .stat-card--count,
.supplier-page .stat-card--count {
    --stat-accent: #0ea5e9;
    --stat-soft: rgba(14, 165, 233, 0.14);
}

.suppliers-page .stat-card--purchases,
.supplier-page .stat-card--purchases {
    --stat-accent: #f97316;
    --stat-soft: rgba(249, 115, 22, 0.14);
}

.suppliers-page .stat-card--paid,
.supplier-page .stat-card--paid {
    --stat-accent: #16a34a;
    --stat-soft: rgba(22, 163, 74, 0.14);
}

.suppliers-page .stat-card--due,
.supplier-page .stat-card--due {
    --stat-accent: #ef4444;
    --stat-soft: rgba(239, 68, 68, 0.14);
}

.suppliers-page .stat-card--duecount {
    --stat-accent: #0f766e;
    --stat-soft: rgba(15, 118, 110, 0.14);
}

.suppliers-page .suppliers-filter-card {
    display: grid;
    gap: 16px;
}

.suppliers-page .suppliers-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    align-items: end;
}

.suppliers-page .suppliers-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.suppliers-page .suppliers-filter-search {
    grid-column: span 2;
    min-width: 240px;
}

.suppliers-page .suppliers-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.suppliers-page .suppliers-filter-row--chips {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 16px;
    align-items: center;
}

.suppliers-page .suppliers-filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.suppliers-page .chip-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-inline-end: 4px;
}

.suppliers-page .suppliers-filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.suppliers-page .suppliers-filter-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.suppliers-page .suppliers-filter-chip.is-active {
    background: rgba(25, 118, 210, 0.12);
    border-color: rgba(25, 118, 210, 0.3);
    color: var(--accent);
}

.suppliers-page .suppliers-filter-advanced {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    background: var(--surface-alt);
}

.suppliers-page .suppliers-filter-advanced > summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-main);
    list-style: none;
}

.suppliers-page .suppliers-filter-advanced > summary::-webkit-details-marker {
    display: none;
}

.suppliers-page .suppliers-filter-advanced > summary::after {
    content: '▾';
    margin-inline-start: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.suppliers-page .suppliers-filter-advanced[open] > summary::after {
    content: '▴';
}

.suppliers-page .suppliers-filter-advanced-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
    margin-top: 12px;
}

.suppliers-page .suppliers-filter-advanced-body .filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.suppliers-page .suppliers-filter-card input,
.suppliers-page .suppliers-filter-card select {
    background: var(--surface);
}

.suppliers-page .suppliers-count {
    font-size: 12px;
    color: var(--text-muted);
}

.suppliers-page .suppliers-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.suppliers-page .suppliers-pagination-info {
    font-size: 12px;
    color: var(--text-muted);
}

.suppliers-page .suppliers-pagination-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.suppliers-page .pagination-number {
    min-width: 32px;
    text-align: center;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-main);
    background: var(--surface);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.suppliers-page .pagination-number:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.suppliers-page .pagination-number.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.suppliers-page .pagination-btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.suppliers-page .pagination-ellipsis {
    font-size: 12px;
    color: var(--text-muted);
    padding: 0 4px;
}

.suppliers-page .suppliers-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 980px;
}

.suppliers-page .suppliers-table thead th {
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: none;
}

.suppliers-page .suppliers-table th,
.suppliers-page .suppliers-table td {
    padding: 12px 14px;
}

.suppliers-page .suppliers-table tbody tr {
    background: var(--surface);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.suppliers-page .suppliers-table tbody td {
    background: var(--surface);
    border-bottom: none;
}

.suppliers-page .suppliers-table tbody tr:hover td {
    background: var(--surface-alt);
}

.suppliers-page .suppliers-table tbody tr td:first-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.suppliers-page .suppliers-table tbody tr td:last-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.suppliers-page .supplier-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suppliers-page .supplier-link {
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
}

.suppliers-page .supplier-link:hover {
    color: var(--accent);
}

.suppliers-page .supplier-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.suppliers-page .supplier-communication {
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suppliers-page .supplier-amount {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.suppliers-page .supplier-updated {
    color: var(--text-muted);
    font-size: 12px;
}

.suppliers-page .supplier-outstanding--due {
    color: #b91c1c;
    font-weight: 700;
}

.suppliers-page .supplier-outstanding--clear {
    color: #15803d;
    font-weight: 700;
}

.suppliers-page .supplier-outstanding-value {
    display: block;
}

.suppliers-page .supplier-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
    margin-top: 4px;
}

.suppliers-page .supplier-status-pill.supplier-outstanding--due {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.3);
}

.suppliers-page .supplier-status-pill.supplier-outstanding--clear {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.3);
}

.suppliers-page .suppliers-actions {
    flex-wrap: wrap;
    gap: 6px;
}

.suppliers-page .suppliers-actions .action-btn {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
}

.suppliers-page .empty-state td {
    text-align: center;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-radius: 10px;
}

.supplier-page .supplier-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.supplier-page .supplier-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.supplier-page .supplier-card-title {
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.supplier-page .supplier-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.supplier-page .supplier-info-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.supplier-page .supplier-info-list strong {
    font-weight: 700;
}

.supplier-page .supplier-note {
    margin: 0;
    color: var(--text-main);
    line-height: 1.6;
}

.supplier-page .supplier-span-full {
    grid-column: 1 / -1;
}

.supplier-page .supplier-outstanding-badge {
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.supplier-page .supplier-alert {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.08);
    color: #c2410c;
    font-size: 13px;
}

.supplier-page .supplier-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.supplier-page .supplier-pagination-info {
    font-size: 12px;
    color: var(--text-muted);
}

.supplier-page .supplier-pagination-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.supplier-page .pagination-number {
    min-width: 32px;
    text-align: center;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-main);
    background: var(--surface);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.supplier-page .pagination-number:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.supplier-page .pagination-number.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.supplier-page .pagination-btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.supplier-page .pagination-ellipsis {
    font-size: 12px;
    color: var(--text-muted);
    padding: 0 4px;
}

@media (max-width: 900px) {
    .suppliers-page .suppliers-filter-row {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .suppliers-page .suppliers-filter-search {
        grid-column: span 1;
    }
    .suppliers-page .suppliers-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
    .suppliers-page .suppliers-filter-row--chips {
        grid-template-columns: 1fr;
    }
    .suppliers-page .suppliers-filter-advanced-body {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    .suppliers-page .suppliers-table {
        min-width: 760px;
    }
}

/* Cash page */
.cash-page {
    position: relative;
    isolation: isolate;
}

.cash-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(520px 220px at 8% -10%, rgba(14, 165, 233, 0.12), transparent 65%),
        radial-gradient(460px 220px at 100% 0%, rgba(16, 185, 129, 0.12), transparent 60%),
        radial-gradient(320px 200px at 45% 100%, rgba(249, 115, 22, 0.12), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.cash-page > * {
    position: relative;
    z-index: 1;
}

.cash-page .cash-stats {
    margin-bottom: 28px;
}

.cash-page .cash-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    background: var(--surface);
}

.cash-page .cash-panel .panel-header {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0));
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.cash-page .cash-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.cash-page .cash-panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cash-page .cash-panel-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}
.cash-page .cash-panel-title p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}
.cash-page .cash-panel-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    font-size: 18px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.cash-page .cash-panel-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.cash-page .cash-add-btn {
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
}
.cash-page .cash-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.9fr);
    gap: 24px;
    align-items: start;
}
.cash-page .cash-main,
.cash-page .cash-side {
    display: grid;
    gap: 20px;
}
.cash-page .cash-card {
    background: var(--surface);
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}
.cash-page .cash-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0));
}
.cash-page .cash-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
    font-size: 18px;
}
.cash-page .cash-card-title h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}
.cash-page .cash-card-title p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}
.cash-page .cash-card-body {
    padding: 18px;
}
.cash-page .cash-form {
    display: grid;
    gap: 14px;
}
.cash-page .cash-form .form-actions {
    margin-top: 4px;
    justify-content: flex-end;
}

.cash-page .stat-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-inline-start: 4px solid var(--stat-accent, var(--accent));
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.cash-page .stat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.cash-page .stat-emoji {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: var(--stat-soft, rgba(15, 23, 42, 0.08));
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.cash-page .stat-value {
    color: var(--stat-accent, var(--primary));
    font-variant-numeric: tabular-nums;
}

.cash-page .stat-trend {
    font-size: 12px;
}

.cash-page .stat-card--total {
    --stat-accent: #0ea5e9;
    --stat-soft: rgba(14, 165, 233, 0.14);
}

.cash-page .stat-card--accounts {
    --stat-accent: #6366f1;
    --stat-soft: rgba(99, 102, 241, 0.14);
}

.cash-page .stat-card--top {
    --stat-accent: #16a34a;
    --stat-soft: rgba(22, 163, 74, 0.14);
}

.cash-page .stat-card--movement {
    --stat-accent: #f97316;
    --stat-soft: rgba(249, 115, 22, 0.14);
}

.cash-page .cash-count {
    font-size: 12px;
    color: var(--text-muted);
}

.cash-page .cash-table,
.cash-page .cash-transactions-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 760px;
}

.cash-page .cash-table thead th,
.cash-page .cash-transactions-table thead th {
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: none;
}

.cash-page .cash-table th,
.cash-page .cash-table td,
.cash-page .cash-transactions-table th,
.cash-page .cash-transactions-table td {
    padding: 12px 14px;
}

.cash-page .cash-table tbody tr,
.cash-page .cash-transactions-table tbody tr {
    background: var(--surface);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.cash-page .cash-table tbody td,
.cash-page .cash-transactions-table tbody td {
    background: var(--surface);
    border-bottom: none;
}

.cash-page .cash-table tbody tr:hover td,
.cash-page .cash-transactions-table tbody tr:hover td {
    background: var(--surface-alt);
}

.cash-page .cash-table tbody tr td:first-child,
.cash-page .cash-transactions-table tbody tr td:first-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.cash-page .cash-table tbody tr td:last-child,
.cash-page .cash-transactions-table tbody tr td:last-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.cash-page .cash-table tbody tr.is-active td {
    background: rgba(25, 118, 210, 0.08);
}

.cash-page .cash-account-link {
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
}

.cash-page .cash-account-link:hover {
    color: var(--accent);
}

.cash-page .cash-amount {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cash-page .cash-balance {
    color: #0f766e;
    font-weight: 700;
}

.cash-page .cash-updated {
    color: var(--text-muted);
    font-size: 12px;
}

.cash-page .cash-amount--in {
    color: #15803d;
    font-weight: 600;
}

.cash-page .cash-amount--out {
    color: #b91c1c;
    font-weight: 600;
}

.cash-page .cash-actions {
    flex-wrap: wrap;
    gap: 6px;
}

.cash-page .cash-actions .action-btn {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
}

.cash-page .cash-account-badge {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.cash-page .cash-filter-card {
    display: grid;
    gap: 16px;
    margin-bottom: 12px;
}

.cash-page .cash-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    align-items: end;
}

.cash-page .cash-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cash-page .cash-filter-search {
    grid-column: span 2;
    min-width: 240px;
}

.cash-page .cash-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.cash-page .cash-filter-card input,
.cash-page .cash-filter-card select {
    background: var(--surface);
}

.cash-page .empty-state td {
    text-align: center;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-radius: 10px;
}

@media (max-width: 900px) {
    .cash-page .cash-layout {
        grid-template-columns: 1fr;
    }
    .cash-page .cash-filter-search {
        grid-column: span 1;
    }
    .cash-page .cash-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
    .cash-page .cash-table,
    .cash-page .cash-transactions-table {
        min-width: 760px;
    }
}

/* Employees page */
.employees-page,
.employee-page {
    position: relative;
    isolation: isolate;
}

.employees-page::before,
.employee-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(520px 220px at 8% -10%, rgba(14, 165, 233, 0.12), transparent 65%),
        radial-gradient(460px 220px at 100% 0%, rgba(20, 184, 166, 0.12), transparent 60%),
        radial-gradient(320px 200px at 45% 100%, rgba(251, 191, 36, 0.12), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.employees-page > *,
.employee-page > * {
    position: relative;
    z-index: 1;
}

.employees-page .employees-stats,
.employee-page .employees-stats {
    margin-bottom: 28px;
}

.employees-page .employees-actions-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.employees-page .employees-actions-bar .primary-btn {
    padding: 10px 16px;
    font-size: 14px;
}

.employees-page .employees-filter {
    margin-bottom: 18px;
}

.employees-page .employees-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.employees-page .employees-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.employees-page .employees-filter-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-main);
}

.employees-page .employees-filter-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.employees-page .employees-panel,
.employee-page .employees-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    background: var(--surface);
}

.employees-page .employees-panel .panel-header,
.employee-page .employees-panel .panel-header {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0));
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.employees-page .employees-panel-header,
.employee-page .employees-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.employee-page .employee-header-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.employee-page .employee-header-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.employee-page .employee-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.employee-page .employee-action-bar form {
    margin: 0;
    display: inline-flex;
}

.employee-page .employee-action-bar .action-btn {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 8px;
}

.employees-page .stat-card,
.employee-page .stat-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-inline-start: 4px solid var(--stat-accent, var(--accent));
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.employees-page .stat-head,
.employee-page .stat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.employees-page .stat-emoji,
.employee-page .stat-emoji {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: var(--stat-soft, rgba(15, 23, 42, 0.08));
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.employees-page .stat-value,
.employee-page .stat-value {
    color: var(--stat-accent, var(--primary));
    font-variant-numeric: tabular-nums;
}

.employees-page .stat-trend,
.employee-page .stat-trend {
    font-size: 12px;
}

.employees-page .stat-card--count,
.employee-page .stat-card--count {
    --stat-accent: #0ea5e9;
    --stat-soft: rgba(14, 165, 233, 0.14);
}

.employees-page .stat-card--salary,
.employee-page .stat-card--salary {
    --stat-accent: #14b8a6;
    --stat-soft: rgba(20, 184, 166, 0.14);
}

.employees-page .stat-card--paid,
.employee-page .stat-card--paid {
    --stat-accent: #22c55e;
    --stat-soft: rgba(34, 197, 94, 0.14);
}

.employees-page .stat-card--due,
.employee-page .stat-card--due {
    --stat-accent: #f97316;
    --stat-soft: rgba(249, 115, 22, 0.14);
}

.employees-page .stat-card--deductions,
.employee-page .stat-card--deductions {
    --stat-accent: #ef4444;
    --stat-soft: rgba(239, 68, 68, 0.14);
}

.employees-page .stat-card--next,
.employee-page .stat-card--next {
    --stat-accent: #6366f1;
    --stat-soft: rgba(99, 102, 241, 0.14);
}

.employees-page .employees-month-badge {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.employees-page .employees-table,
.employee-page .employees-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 1120px;
}

.employees-page .employees-table thead th,
.employee-page .employees-table thead th {
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: none;
}

.employees-page .employees-table th,
.employees-page .employees-table td,
.employee-page .employees-table th,
.employee-page .employees-table td {
    padding: 12px 14px;
}

.employees-page .employees-table tbody tr,
.employee-page .employees-table tbody tr {
    background: var(--surface);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.employees-page .employees-table tbody td,
.employee-page .employees-table tbody td {
    background: var(--surface);
    border-bottom: none;
}

.employees-page .employees-table tbody tr:hover td,
.employee-page .employees-table tbody tr:hover td {
    background: var(--surface-alt);
}

.employees-page .employees-table tbody tr td:first-child,
.employee-page .employees-table tbody tr td:first-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.employees-page .employees-table tbody tr td:last-child,
.employee-page .employees-table tbody tr td:last-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.employees-page .employee-name,
.employee-page .employee-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.employees-page .employee-meta,
.employee-page .employee-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.employees-page .employee-hire,
.employee-page .employee-hire {
    font-size: 11px;
    color: var(--text-muted);
}

.employees-page .employee-amount,
.employee-page .employee-amount {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.employees-page .employee-balance--due,
.employee-page .employee-balance--due {
    color: #b91c1c;
    font-weight: 700;
}

.employees-page .employee-balance--advance,
.employee-page .employee-balance--advance {
    color: #0f766e;
    font-weight: 700;
}

.employees-page .employee-balance--clear,
.employee-page .employee-balance--clear {
    color: #15803d;
    font-weight: 700;
}

.employees-page .employee-amount--deduction,
.employee-page .employee-amount--deduction {
    color: #b91c1c;
    font-weight: 700;
}

.employees-page .employee-balance-cell,
.employee-page .employee-balance-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.employees-page .employee-balance-pill,
.employee-page .employee-balance-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    width: fit-content;
    border: 1px solid transparent;
}

.employees-page .employee-balance-pill--due,
.employee-page .employee-balance-pill--due {
    background: rgba(234, 179, 8, 0.15);
    color: #a16207;
    border-color: rgba(234, 179, 8, 0.35);
}

.employees-page .employee-balance-pill--advance,
.employee-page .employee-balance-pill--advance {
    background: rgba(14, 116, 144, 0.16);
    color: #0f766e;
    border-color: rgba(14, 116, 144, 0.3);
}

.employees-page .employee-balance-pill--clear,
.employee-page .employee-balance-pill--clear {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.3);
}

.employees-page .employee-raise,
.employee-page .employee-raise {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.employees-page .employee-raise-amount,
.employee-page .employee-raise-amount {
    color: #16a34a;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.employees-page .employee-raise-date,
.employee-page .employee-raise-date {
    color: var(--text-muted);
    font-size: 11px;
}

.employees-page .employee-next-pay,
.employee-page .employee-next-pay {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.employees-page .employee-countdown,
.employee-page .employee-countdown {
    font-weight: 700;
    color: var(--text-main);
}

.employees-page .employee-next-date,
.employee-page .employee-next-date {
    font-size: 11px;
    color: var(--text-muted);
}

.employees-page .employee-badge,
.employee-page .employee-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
}

.employees-page .employee-badge--today,
.employee-page .employee-badge--today {
    background: rgba(16, 185, 129, 0.18);
    color: #0f766e;
    border-color: rgba(16, 185, 129, 0.35);
}

.employees-page .employee-badge--soon,
.employee-page .employee-badge--soon {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.3);
}

.employees-page .employee-badge--later,
.employee-page .employee-badge--later {
    background: rgba(148, 163, 184, 0.2);
    color: #475569;
    border-color: rgba(148, 163, 184, 0.35);
}

.employees-page .employee-status,
.employee-page .employee-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}

.employees-page .employee-status.status-active,
.employee-page .employee-status.status-active {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.3);
}

.employees-page .employee-status.status-inactive,
.employee-page .employee-status.status-inactive {
    background: rgba(148, 163, 184, 0.2);
    color: #475569;
    border-color: rgba(148, 163, 184, 0.3);
}

.employees-page .employees-actions,
.employee-page .employees-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
}

.employees-page .employees-actions .action-btn,
.employee-page .employees-actions .action-btn {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    width: 100%;
    justify-content: center;
    text-align: center;
}

.employees-page .employee-actions-cell,
.employee-page .employee-actions-cell {
    min-width: 260px;
}

.employees-page .action-withdraw,
.employee-page .action-withdraw {
    background: rgba(14, 116, 144, 0.12);
    color: #0f766e;
}

.employees-page .action-deduct,
.employee-page .action-deduct {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.employees-page .empty-state td,
.employee-page .empty-state td {
    text-align: center;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-radius: 10px;
}

@media (max-width: 900px) {
    .employees-page .employees-table,
    .employee-page .employees-table {
        min-width: 860px;
    }
    .employees-page .employees-filter-row {
        grid-template-columns: 1fr;
    }
    .employees-page .employees-filter-actions {
        justify-content: flex-start;
    }
}

/* Inventory page */
.inventory-page {
    position: relative;
    isolation: isolate;
}

.inventory-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(560px 240px at 6% -10%, rgba(14, 116, 144, 0.12), transparent 65%),
        radial-gradient(480px 220px at 100% 0%, rgba(37, 99, 235, 0.12), transparent 60%),
        radial-gradient(340px 200px at 45% 100%, rgba(16, 185, 129, 0.12), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.inventory-page > * {
    position: relative;
    z-index: 1;
}

.inventory-page .inventory-stats {
    margin-bottom: 24px;
}

.inventory-page .stat-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-inline-start: 4px solid var(--stat-accent, var(--accent));
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.inventory-page .stat-value {
    color: var(--stat-accent, var(--primary));
    font-variant-numeric: tabular-nums;
}

.inventory-page .stat-card:nth-child(1) {
    --stat-accent: #0ea5e9;
}
.inventory-page .stat-card:nth-child(2) {
    --stat-accent: #2563eb;
}
.inventory-page .stat-card:nth-child(3) {
    --stat-accent: #16a34a;
}
.inventory-page .stat-card:nth-child(4) {
    --stat-accent: #f97316;
}

.inventory-page .inventory-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 24px;
}

.inventory-page .inventory-search {
    margin: 0;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: var(--surface);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.inventory-page .inventory-search-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inventory-page .inventory-search label {
    font-weight: 600;
    color: var(--text-muted);
}

.inventory-page .inventory-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.inventory-page .inventory-search-row input {
    flex: 1 1 280px;
    min-width: 220px;
    background: var(--surface);
}

.inventory-page .inventory-actions {
    margin: 0;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: var(--surface);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
}

.inventory-page .inventory-actions .primary-btn,
.inventory-page .inventory-actions .secondary-btn {
    padding: 10px 16px;
    font-size: 14px;
}

.inventory-page .inventory-panel {
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    background: var(--surface);
}

.inventory-page .inventory-panel .panel-header {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0));
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.inventory-page .warehouse-header {
    align-items: center;
    gap: 20px;
}

.inventory-page .warehouse-title h2 {
    font-size: 18px;
}

.inventory-page .warehouse-stats {
    flex-wrap: wrap;
    gap: 8px;
}

.inventory-page .warehouse-stats span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}

.inventory-page .warehouse-actions {
    gap: 8px;
    flex-wrap: wrap;
}

.inventory-page .inventory-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 980px;
}

.inventory-page .inventory-table thead th {
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: none;
}

.inventory-page .inventory-table th,
.inventory-page .inventory-table td {
    padding: 12px 14px;
}

.inventory-page .inventory-table tbody tr {
    background: var(--surface);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.inventory-page .inventory-table tbody td {
    background: var(--surface);
    border-bottom: none;
}

.inventory-page .inventory-table tbody tr:hover td {
    background: var(--surface-alt);
}

.inventory-page .inventory-table tbody tr td:first-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.inventory-page .inventory-table tbody tr td:last-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.inventory-page .inventory-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inventory-page .inventory-qty-value {
    font-variant-numeric: tabular-nums;
}

.inventory-page .inventory-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

.inventory-page .inventory-badge--low {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.35);
}

.inventory-page .inventory-badge--out {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.3);
}

.inventory-page .inventory-row--low td:first-child {
    box-shadow: inset 4px 0 0 rgba(245, 158, 11, 0.35);
}

.inventory-page .inventory-row--out td:first-child {
    box-shadow: inset 4px 0 0 rgba(239, 68, 68, 0.35);
}

.inventory-page .table-actions {
    flex-wrap: wrap;
    gap: 6px;
}

.inventory-page .table-actions .action-btn {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
}

.inventory-page .empty-state td {
    text-align: center;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-radius: 10px;
}

.categories-table .category-edit-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.categories-table .category-edit-field input {
    min-width: 180px;
}

.categories-table .action-btn {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
}

@media (max-width: 900px) {
    .inventory-page .inventory-toolbar {
        grid-template-columns: 1fr;
    }
    .inventory-page .inventory-actions {
        justify-content: flex-start;
    }
    .inventory-page .inventory-table {
        min-width: 760px;
    }
}

/* Forms */
label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}
input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
    background: var(--surface);
}
.form-grid, .grid-two {
    display: grid;
    gap: 16px 20px;
}
.grid-two {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    align-items: center;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
/* Inline Filters (for reports page) */
.filters-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}
.filters-inline .filter-item {
    flex: 1 1 180px; /* Grow, shrink, with a base width */
    min-width: 180px;
}
.filters-inline label {
    font-size: 13px;
    margin-bottom: 6px;
}
.filters-inline input,
.filters-inline select {
    padding: 8px 10px;
    font-size: 14px;
}
.filters-inline .filter-actions {
    display: flex;
    gap: 10px;
}
.filters-inline .primary-btn,
.filters-inline .secondary-btn {
    padding: 8px 16px;
}

/* Collapsible sections (used in inventory, clients, etc.) */
.collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out, padding 0.35s ease-out, margin 0.35s ease-out;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
}
.collapsible.is-open {
    max-height: 1000px; /* Large enough for content */
    padding-top: 24px;
    padding-bottom: 24px;
    margin-top: 16px;
}

/* Permissions Grid */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 16px;
}
.permission-group-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.permission-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}
.permission-item input[type="checkbox"] {
    width: auto;
}

/* Buttons */
.primary-btn, .secondary-btn {
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.primary-btn {
    background: var(--primary);
    color: #fff;
}
.primary-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: #fff;
}
.secondary-btn {
    background: var(--surface-alt);
    color: var(--text-main);
    border: 1px solid var(--border);
}
.secondary-btn:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th, td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}
thead th {
    background: var(--surface-alt);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}
tbody tr:hover {
    background-color: var(--surface-alt);
}
.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.action-btn {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 6px;
}
.action-edit { background: rgba(25, 118, 210, 0.1); color: #1976D2; }
.action-delete { background: rgba(211, 47, 47, 0.1); color: #D32F2F; cursor: pointer; border: none; font-family: inherit; }
.action-view { background: rgba(100, 116, 139, 0.1); color: #475569; }
.action-raise { background: rgba(34, 197, 94, 0.12); color: #15803d; }

/* Purchases table */
.purchase-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    table-layout: fixed;
}
.purchase-table thead th {
    background: transparent;
    border-bottom: none;
}
.purchase-table th,
.purchase-table td {
    padding: 10px 12px;
    white-space: normal;
    overflow-wrap: anywhere;
}
.purchase-table tbody tr {
    background: var(--surface);
    box-shadow: var(--shadow);
}
.purchase-table tbody td {
    background: var(--surface);
    border-bottom: none;
}
.purchase-table tbody tr:hover td {
    background: var(--surface-alt);
}
.purchase-table tbody tr td:first-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}
.purchase-table tbody tr td:last-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}
.order-number {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}
.pill-muted {
    color: var(--text-muted);
}
.cell-amount {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.purchase-table .cell-amount {
    white-space: normal;
}
.amount-due {
    color: #b45309;
    font-weight: 600;
}
.amount-ok {
    color: #15803d;
    font-weight: 600;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}
.status-pending {
    background: rgba(234, 179, 8, 0.15);
    color: #a16207;
    border-color: rgba(234, 179, 8, 0.35);
}
.status-partial {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.3);
}
.status-paid {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.3);
}
.purchase-table .table-actions {
    flex-wrap: wrap;
    gap: 6px;
}
.purchase-table .action-btn {
    font-size: 12px;
    padding: 4px 8px;
}

@media (max-width: 900px) {
    .purchase-table {
        min-width: 0;
        border-spacing: 0;
    }
    .purchase-table thead {
        display: none;
    }
    .purchase-table,
    .purchase-table tbody,
    .purchase-table tr,
    .purchase-table td {
        display: block;
        width: 100%;
    }
    .purchase-table tbody tr {
        margin-bottom: 12px;
        border-radius: 12px;
        overflow: hidden;
    }
    .purchase-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px;
        border-bottom: 1px dashed var(--border);
    }
    .purchase-table tbody td:last-child {
        border-bottom: none;
    }
    .purchase-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
    }
    .table-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* Compact form inside a table cell */
.table-form-inline {
    margin-top: 8px;
}
.table-form-inline select,
.table-form-inline input {
    padding: 6px 8px;
    font-size: 13px;
    flex: 1;
}
.table-form-inline button {
    padding: 6px 12px;
    font-size: 13px;
    flex-shrink: 0;
    height: 35px; /* Match input height */
}

/* Auth Page */
.auth-body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(900px 360px at 10% 5%, rgba(14, 116, 144, 0.18), transparent 60%),
        radial-gradient(700px 340px at 90% 0%, rgba(15, 118, 110, 0.16), transparent 55%),
        linear-gradient(160deg, #f8fafc 0%, #eef2f7 45%, #f8fafc 100%);
    font-family: 'Tajawal', 'Changa', sans-serif;
    color: var(--text-main);
    --auth-primary: #0f766e;
    --auth-primary-dark: #115e59;
    --auth-accent: #2563eb;
    --auth-muted: #f1f5f9;
    --auth-border: rgba(15, 23, 42, 0.12);
    --primary: var(--auth-primary);
    --primary-dark: var(--auth-primary-dark);
    --accent: var(--auth-accent);
    --surface: #ffffff;
    --surface-alt: var(--auth-muted);
    --border: var(--auth-border);
}

.auth-shell {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.auth-shell::before,
.auth-shell::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    opacity: 0.7;
}

.auth-shell::before {
    width: 320px;
    height: 320px;
    top: -160px;
    right: -120px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, transparent 70%);
}

.auth-shell::after {
    width: 280px;
    height: 280px;
    bottom: -140px;
    left: -120px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
}

.auth-container {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 0 24px;
}

.auth-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(248, 250, 252, 0.92);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
}

.auth-topbar .auth-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 24px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.auth-mark img {
    width: 70%;
    height: 70%;
    display: block;
}

.auth-brand-name {
    font-family: 'Changa', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
}

.auth-brand-sub {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
}

.auth-nav a {
    text-decoration: none;
    color: #334155;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-nav a:hover {
    color: var(--auth-primary);
}

.auth-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-remember label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

.auth-remember input[type="checkbox"] {
    width: auto;
    accent-color: var(--auth-primary);
}

.auth-admin-btn {
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(15, 118, 110, 0.35);
    color: #0f766e;
    font-size: 13px;
    font-weight: 700;
    background: rgba(15, 118, 110, 0.08);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.auth-admin-btn:hover {
    border-color: rgba(15, 118, 110, 0.6);
    transform: translateY(-1px);
    color: #0f766e;
}

.auth-cta-btn {
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--auth-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(15, 118, 110, 0.28);
    color: #fff;
}

.auth-main {
    display: flex;
    flex-direction: column;
    gap: 64px;
    padding-bottom: 64px;
}

.auth-main--compact {
    gap: 24px;
    padding-bottom: 40px;
}

.auth-page-grid {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 32px;
    align-items: start;
}

.auth-page-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-page-content .auth-container {
    width: 100%;
    margin: 0;
    padding: 0;
}

.auth-login-aside {
    position: sticky;
    top: 110px;
    align-self: start;
}

.auth-hero-section {
    padding: 72px 0 24px;
    scroll-margin-top: 90px;
}

#login {
    scroll-margin-top: 120px;
}

.auth-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

.auth-login-stack {
    display: grid;
    gap: 18px;
    align-items: start;
}

.auth-hero-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 620px;
}

.auth-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: var(--auth-primary);
    font-weight: 700;
    font-size: 12px;
}

.auth-hero-title {
    font-family: 'Changa', sans-serif;
    font-size: 38px;
    line-height: 1.25;
    margin: 0;
}

.auth-hero-text {
    margin: 0;
    color: #334155;
    font-size: 16px;
    line-height: 1.8;
}

.auth-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.auth-hero-media {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-hero-media-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 20px;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
}

.auth-hero-media img {
    width: 100%;
    display: block;
    border-radius: 14px;
}

.auth-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-hero-badges span {
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.auth-hero-actions .primary-btn,
.auth-hero-actions .secondary-btn {
    border-radius: 999px;
    padding: 12px 22px;
}

.auth-hero-primary {
    box-shadow: 0 16px 32px rgba(15, 118, 110, 0.2);
}

.auth-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.auth-metric {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.1);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-metric-label {
    font-size: 12px;
    color: var(--text-muted);
}

.auth-metric-value {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.auth-metric-note {
    font-size: 12px;
    color: #64748b;
}

.auth-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 28px;
    padding: 32px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(16px);
    text-align: right;
}

.auth-card--admin {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(15, 118, 110, 0.2);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
}

.auth-card--admin .auth-card-head h1 {
    font-size: 22px;
}

.auth-card--admin .auth-subtitle {
    margin-bottom: 18px;
}

.auth-admin-note {
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px dashed rgba(15, 118, 110, 0.3);
}

.auth-card-head h1 {
    font-family: 'Changa', sans-serif;
    font-size: 26px;
    margin: 0 0 8px;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}

.field {
    margin-bottom: 18px;
    text-align: right;
}

.field label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

.field-help {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    padding-inline-start: 48px;
    padding-inline-end: 14px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    font-size: 14px;
}

.auth-body input:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.input-wrap--action input {
    padding-inline-end: 70px;
}

.input-icon {
    position: absolute;
    inset-inline-start: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.06);
    color: #0f766e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.field--code .input-wrap input {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.2);
}

.field--code .input-icon {
    color: #0ea5e9;
}

.input-action {
    position: absolute;
    inset-inline-end: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
}

.input-action:hover {
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}

.auth-primary {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
}

.auth-secondary-actions {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.auth-admin-entry-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(15, 118, 110, 0.35);
    color: #0f766e;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    background: rgba(15, 118, 110, 0.08);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-admin-entry-btn:hover {
    border-color: rgba(15, 118, 110, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 118, 110, 0.18);
    color: #0f766e;
}

.auth-secondary-actions .secondary-btn,
.auth-secondary-actions .ghost-btn {
    width: 100%;
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px dashed rgba(15, 23, 42, 0.2);
    text-decoration: none;
    color: #0f172a;
    font-weight: 600;
    font-size: 13px;
    background: transparent;
}

.ghost-btn:hover {
    border-color: #0f766e;
    color: #0f766e;
}

.auth-card .flash {
    text-align: right;
}

.auth-section {
    padding: 40px 0;
    scroll-margin-top: 90px;
}

.auth-section-head {
    max-width: 620px;
    margin-bottom: 24px;
}

.auth-section-kicker {
    font-size: 12px;
    font-weight: 700;
    color: var(--auth-primary);
    margin: 0 0 8px;
}

.auth-section-head h2 {
    font-family: 'Changa', sans-serif;
    font-size: 28px;
    margin: 0 0 10px;
}

.auth-section-head p {
    margin: 0;
    color: #475569;
    font-size: 15px;
    line-height: 1.7;
}

.auth-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.auth-feature-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    padding: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0ea5e9, #22c55e);
    color: #fff;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.auth-feature-card h3 {
    margin: 0;
    font-size: 16px;
}

.auth-feature-card p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.auth-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.auth-step-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    padding: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-step-number {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: var(--auth-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.auth-step-card h3 {
    margin: 0;
    font-size: 16px;
}

.auth-step-card p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.auth-callout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(14, 165, 233, 0.1));
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.auth-callout-content h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.auth-callout-content p {
    margin: 0;
    color: #475569;
    line-height: 1.7;
}

.auth-callout-list {
    display: grid;
    gap: 12px;
}

.auth-callout-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    font-weight: 600;
    color: #0f172a;
    font-size: 14px;
}

.auth-support-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 24px;
    align-items: center;
}

.auth-support-content h2 {
    margin: 0 0 12px;
    font-size: 26px;
}

.auth-support-content p {
    margin: 0 0 18px;
    color: #475569;
    line-height: 1.7;
}

.auth-support-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.auth-support-primary {
    border-radius: 999px;
    padding: 12px 22px;
}

.auth-support-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 22px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-support-title {
    margin: 0;
    font-weight: 700;
    font-size: 16px;
}

.auth-support-text {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.auth-support-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-support-tags span {
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.auth-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding: 24px 0 40px;
    color: #64748b;
    font-size: 13px;
}

.auth-footer .auth-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.auth-reveal {
    animation: authRise 0.7s ease both;
}

.auth-delay-1 { animation-delay: 0.1s; }
.auth-delay-2 { animation-delay: 0.2s; }
.auth-delay-3 { animation-delay: 0.3s; }

@keyframes authRise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-reveal {
        animation: none;
    }
}

@media (max-width: 980px) {
    .auth-topbar .auth-container {
        flex-wrap: wrap;
    }
    .auth-nav {
        display: none;
    }
    .auth-page-grid {
        grid-template-columns: 1fr;
        padding: 0 18px;
    }
    .auth-login-aside {
        position: static;
        order: -1;
    }
    .auth-hero-grid {
        grid-template-columns: 1fr;
    }
    .auth-metrics {
        grid-template-columns: 1fr;
    }
    .auth-callout {
        grid-template-columns: 1fr;
    }
    .auth-support-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .auth-topbar .auth-container {
        padding: 14px 18px;
    }
    .auth-container {
        padding: 0 18px;
    }
    .auth-page-grid {
        padding: 0 18px;
    }
    .auth-hero-title {
        font-size: 28px;
    }
    .auth-hero-section {
        padding-top: 56px;
    }
    .auth-card {
        padding: 24px;
    }
    .auth-section {
        padding: 32px 0;
    }
    .auth-footer .auth-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Flash Messages */
.flash {
    padding: 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid transparent;
}
.flash-error { background-color: #fdeded; border-color: #f9c6c6; color: #5c2121; }
.flash-success { background-color: #e6f4ea; border-color: #bde0c5; color: #1e462a; }

/* Responsive */
@media (max-width: 992px) {
    .dashboard-header {
        padding: 16px;
    }
    .dashboard-header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .dashboard-content {
        padding: 16px;
    }
}

@media (max-width: 600px) {
    .app-shell {
        flex-direction: column;
    }
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .dashboard-header-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 10px;
    }
    .sidebar-toggle-btn {
        order: -1;
    }
    .logout-form {
        width: 100%;
    }
    .logout-form .logout-btn {
        width: 100%;
    }
    .panel {
        border-radius: var(--radius);
    }
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .panel-body {
        padding: 18px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .invoice-form-grid {
        grid-template-columns: 1fr;
    }
    .admin-inline-form,
    .filters-inline,
    .actions-inline {
        grid-template-columns: 1fr;
    }
    .table-wrapper {
        margin-bottom: 16px;
    }
}

/* Invoice Create/Edit Pages */
.invoice-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px 24px;
}

.invoice-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.invoice-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.invoice-product-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.invoice-product-search input {
    min-width: 220px;
}

.invoice-items-panel .panel-body {
    padding: 0;
}

.invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.invoice-items-table thead {
    background-color: var(--surface-alt);
}

.invoice-items-table th {
    padding: 12px 16px;
    text-align: right;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
}

.invoice-items-table td {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.invoice-items-table tbody tr:last-child td {
    border-bottom: none;
}

.invoice-items-table td input,
.invoice-items-table td select {
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 6px;
}

.invoice-summary {
    padding: 24px;
    background-color: var(--surface-alt);
    border-top: 1px solid var(--border);
}

.invoice-summary p {
    margin-bottom: 8px;
    font-size: 16px;
}
.invoice-summary p:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
    .invoice-product-search {
        width: 100%;
    }
    .invoice-product-search input {
        flex: 1;
        min-width: 0;
    }
    .dashboard-action {
        padding: 14px 16px;
    }
    .dashboard-action .action-arrow {
        display: none;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    padding-top: 60px;
}

.modal-content {
    background-color: var(--surface);
    margin: 5% auto;
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    animation: animatetop 0.4s;
    overflow: hidden;
}

@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.modal-header {
    padding: 16px 24px;
    background-color: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 { font-size: 20px; }

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    background-color: var(--surface-alt);
    text-align: left;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.close-btn {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.modal-footer .close-btn { color: var(--text-main); font-size: 15px; font-weight: 600; }

.close-btn:hover,
.close-btn:focus {
    color: #bbb;
    text-decoration: none;
}

/* Inventory Page: Warehouse Header */
.warehouse-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.warehouse-title h2 {
    margin: 0;
    font-size: 20px;
}
.warehouse-stats {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: var(--text-muted);
}
.warehouse-actions {
    display: flex;
    gap: 12px;
}
.warehouse-actions .primary-btn, .warehouse-actions .secondary-btn {
    padding: 10px 16px;
    font-size: 14px;
}

.client-name-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.client-name-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-main);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.client-name-title:hover {
    color: var(--accent);
}

.client-sales-list {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.client-sales-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    padding: 5px 8px;
    font-size: 12px;
    color: #0f172a;
}

.client-sale-date {
    font-weight: 600;
}

.client-sale-amount {
    color: #0f172a;
}

.client-sale-remaining {
    color: #b91c1c;
    font-weight: 600;
}

.client-sale-status {
    color: #475569;
}

.client-sale-link {
    margin-inline-start: auto;
    font-weight: 600;
    color: var(--accent);
    font-size: 12px;
}

.client-sales-list li:hover .client-sale-link {
    text-decoration: underline;
}

.item-product-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.serial-btn {
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.serial-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.6);
}

.serial-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.18);
    color: #166534;
    font-size: 11px;
    font-weight: 600;
}

.serial-count-badge[hidden] {
    display: none;
}

.autocomplete-suggestions {
    position: absolute;
    inset-inline-start: 0;
    inset-inline-end: 0;
    top: calc(100% + 4px);
    z-index: 40;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    display: none;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
}

.autocomplete-suggestions.is-visible {
    display: block;
}

.autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #0f172a;
    transition: background 0.12s ease;
}

.autocomplete-item:hover,
.autocomplete-item.is-active {
    background: rgba(59, 130, 246, 0.12);
}

.autocomplete-item.is-empty {
    cursor: default;
    justify-content: center;
    color: #64748b;
}

.autocomplete-name {
    font-weight: 600;
}

.autocomplete-meta {
    margin-inline-start: 12px;
    font-size: 12px;
    color: #64748b;
}

.serial-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.serial-modal-backdrop.is-visible {
    display: flex;
}

.serial-modal {
    background: #ffffff;
    width: min(520px, 92%);
    border-radius: 18px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.2);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.serial-modal h3 {
    margin: 0;
    font-size: 18px;
    color: #0f172a;
}

.serial-modal textarea {
    width: 100%;
    min-height: 160px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 12px;
    padding: 10px 12px;
    font-family: var(--admin-font, inherit);
    font-size: 13px;
    resize: vertical;
}

.serial-modal textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.serial-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
