@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100..900&display=swap');

:root {
    --ayan-bg: #eef2f7;
    --ayan-bg-2: #e6ecf7;
    --ayan-card: #ffffff;
    --ayan-card-soft: #f8fafc;
    --ayan-border: #e2e8f0;
    --ayan-text: #111827;
    --ayan-muted: #64748b;
    --ayan-primary: #4f46e5;
    --ayan-primary-dark: #1e1b4b;
    --ayan-navy: #0f172a;
    --ayan-success: #059669;
    --ayan-warning: #d97706;
    --ayan-danger: #dc2626;
    --ayan-sidebar-width: 18rem;
    --ayan-radius: 22px;
    --ayan-shadow: 0 22px 55px rgba(15, 23, 42, .09);
}

/* Proforma item grid. This intentionally avoids table layout on mobile. */
.ayan-proforma-items-shell,
.ayan-proforma-items-body,
.ayan-proforma-item-row,
.ayan-proforma-item-field {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.ayan-proforma-items-shell {
    width: 100%;
}

.ayan-proforma-items-head,
.ayan-proforma-item-row {
    display: grid;
    grid-template-columns: minmax(240px, 2.4fr) minmax(90px, .65fr) minmax(160px, 1.15fr) minmax(130px, 1fr) minmax(100px, .8fr) 72px;
    align-items: stretch;
}

.ayan-proforma-items-head {
    background: #f1f5ff;
    color: #1e1b4b;
    border-bottom: 1px solid var(--ayan-border);
}

.ayan-proforma-items-head span {
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.ayan-proforma-item-row {
    background: rgba(255, 255, 255, .84);
    border-bottom: 1px solid #edf2f7;
}

.ayan-proforma-item-row:hover {
    background: #fbfdff;
}

.ayan-proforma-item-field {
    display: flex;
    align-items: center;
    padding: 14px 16px;
}

.ayan-proforma-item-field > * {
    min-width: 0;
    max-width: 100%;
}

.ayan-proforma-item-actions {
    justify-content: center;
}

@media (max-width: 900px) {
    [data-pp-proforma-form],
    [data-pp-proforma-form] .ayan-invoice-builder-card,
    [data-pp-proforma-form] .ayan-proforma-items-shell,
    [data-pp-proforma-form] .ayan-proforma-items-body {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    [data-pp-proforma-form] .ayan-invoice-builder-head {
        align-items: stretch;
        flex-direction: column;
        padding: 16px;
    }

    [data-pp-proforma-form] .ayan-invoice-builder-head .ayan-btn {
        width: 100%;
    }

    [data-pp-proforma-form] .ayan-proforma-items-head {
        display: none !important;
    }

    [data-pp-proforma-form] .ayan-proforma-items-body {
        display: block !important;
        padding: 12px;
    }

    [data-pp-proforma-form] .ayan-proforma-item-row {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 0 14px;
        padding: 12px;
        overflow: visible !important;
        border: 1px solid #dbe3ef;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
    }

    [data-pp-proforma-form] .ayan-proforma-item-row:last-child {
        margin-bottom: 0;
    }

    [data-pp-proforma-form] .ayan-proforma-item-field {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 10px 0;
        overflow: visible !important;
        border-bottom: 1px solid #eef2f7;
    }

    [data-pp-proforma-form] .ayan-proforma-item-field::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 7px;
        color: #64748b;
        font-size: 11px;
        font-weight: 800;
    }

    [data-pp-proforma-form] .ayan-proforma-item-field:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    [data-pp-proforma-form] .ayan-invoice-product-cell,
    [data-pp-proforma-form] .ayan-searchable-select,
    [data-pp-proforma-form] .ayan-searchable-select-input,
    [data-pp-proforma-form] .ayan-money-input-wrap,
    [data-pp-proforma-form] .ayan-input,
    [data-pp-proforma-form] .ayan-select:not(.ayan-searchable-native) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    [data-pp-proforma-form] .ayan-searchable-native {
        width: 1px !important;
        min-width: 1px !important;
        max-width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
    }

    [data-pp-proforma-form] .ayan-proforma-item-actions {
        text-align: left;
    }

    [data-pp-proforma-form] .ayan-proforma-item-actions .ayan-small-btn {
        width: 100%;
        min-height: 42px;
    }

    .ayan-searchable-menu.is-floating {
        min-width: 0 !important;
        max-width: calc(100vw - 16px) !important;
    }
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    font-family: Vazirmatn, Tahoma, Arial, sans-serif;
    color: var(--ayan-text);
    background:
        radial-gradient(circle at 20% 0%, rgba(79, 70, 229, .16), transparent 34%),
        radial-gradient(circle at 78% 18%, rgba(14, 165, 233, .12), transparent 28%),
        linear-gradient(135deg, var(--ayan-bg) 0%, var(--ayan-bg-2) 100%);
}
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.ayan-auth-body { min-height: 100vh; background: linear-gradient(135deg, #eef2ff, #f8fafc); }
.ayan-auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.ayan-auth-hero { display: grid; place-items: center; padding: 48px; background: linear-gradient(135deg, #1e1b4b 0%, #312e81 48%, #0f172a 100%); color: #fff; position: relative; overflow: hidden; }
.ayan-auth-hero::before, .ayan-auth-hero::after { content:""; position:absolute; border-radius:999px; background:rgba(255,255,255,.08); }
.ayan-auth-hero::before { width:360px; height:360px; top:-100px; right:-90px; }
.ayan-auth-hero::after { width:430px; height:430px; bottom:-150px; left:-120px; }
.ayan-auth-hero-content { position:relative; z-index:1; text-align:center; max-width:460px; }
.ayan-logo-mark { width:88px; height:88px; border-radius:28px; margin:0 auto 22px; display:grid; place-items:center; font-weight:900; font-size:36px; border:1px solid rgba(255,255,255,.25); background:rgba(255,255,255,.12); box-shadow:inset 0 1px 0 rgba(255,255,255,.3), 0 30px 70px rgba(0,0,0,.18); }
.ayan-auth-title { margin:0; font-size:clamp(30px,4vw,45px); line-height:1.75; font-weight:900; }
.ayan-auth-title span { color:#c7d2fe; }
.ayan-auth-subtitle { color:rgba(255,255,255,.8); line-height:2; font-size:17px; }
.ayan-auth-panel { display:grid; place-items:center; padding:42px; }
.ayan-login-card { width:min(450px,100%); background:rgba(255,255,255,.74); border:1px solid rgba(255,255,255,.7); border-radius:32px; padding:36px; box-shadow:var(--ayan-shadow); backdrop-filter: blur(18px); }
.ayan-login-heading h2 { margin:0; font-size:30px; }
.ayan-login-heading p { margin:10px 0 28px; color:var(--ayan-muted); }
.ayan-copy { margin-top:22px; text-align:center; color:#94a3b8; font-size:13px; }

.ayan-app { min-height: 100vh; display: flex; overflow: hidden; }
.ayan-sidebar {
    width: var(--ayan-sidebar-width);
    min-width: var(--ayan-sidebar-width);
    height: 100vh;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.94));
    border-left: 1px solid rgba(226,232,240,.9);
    box-shadow: 22px 0 60px rgba(15,23,42,.08);
    position: relative;
    z-index: 40;
}
.ayan-sidebar-brand { min-height:76px; padding:16px 18px; display:flex; align-items:center; gap:12px; border-bottom:1px solid var(--ayan-border); }
.ayan-brand-mark { width:46px; height:46px; border-radius:16px; display:grid; place-items:center; background:linear-gradient(135deg,#4f46e5,#0f172a); color:#fff; font-weight:900; box-shadow:0 14px 28px rgba(79,70,229,.22); }
.ayan-sidebar-brand strong { display:block; font-size:17px; letter-spacing:.04em; }
.ayan-sidebar-brand span { color:var(--ayan-muted); font-size:12px; }
.ayan-sidebar-close { display:none; margin-right:auto; border:0; background:#f1f5f9; width:36px; height:36px; border-radius:12px; font-size:24px; cursor:pointer; }
.ayan-sidebar-profile { margin:16px; padding:15px; display:flex; align-items:center; gap:12px; border-radius:22px; background:linear-gradient(135deg,#f8fafc,#eef2ff); border:1px solid #e0e7ff; }
.ayan-profile-ring { width:44px; height:44px; border-radius:16px; display:grid; place-items:center; background:#fff; color:var(--ayan-primary); font-weight:900; box-shadow:0 12px 25px rgba(15,23,42,.08); }
.ayan-sidebar-profile strong { display:block; font-size:14px; }
.ayan-sidebar-profile span { display:block; color:var(--ayan-muted); font-size:12px; margin-top:3px; }
.ayan-menu { padding: 0 12px 20px; }
.ayan-menu-link { width:100%; min-height:48px; border-radius:16px; display:flex; align-items:center; gap:10px; padding:0 13px; color:#334155; font-size:14px; font-weight:750; border:1px solid transparent; transition:.18s ease; }
.ayan-menu-link:hover { background:#f1f5f9; color:#111827; }
.ayan-menu-link.active, .ayan-submenu a.active { background:#eef2ff; color:#3730a3; border-color:#c7d2fe; }
.ayan-menu-icon { width:28px; height:28px; border-radius:10px; display:grid; place-items:center; background:#fff; box-shadow:0 8px 18px rgba(15,23,42,.06); }
.ayan-menu-button { background:transparent; cursor:pointer; text-align:right; }
.ayan-menu-arrow { margin-right:auto; color:#94a3b8; transform:rotate(0); transition:.2s ease; }
.ayan-menu-group.is-open .ayan-menu-arrow { transform:rotate(-90deg); }
.ayan-submenu { display:none; margin:6px 38px 10px 0; padding:6px; border-right:2px solid #e0e7ff; }
.ayan-menu-group.is-open .ayan-submenu { display:grid; gap:4px; }
.ayan-submenu a { min-height:38px; display:flex; align-items:center; padding:0 12px; border-radius:12px; color:#64748b; font-size:13px; font-weight:700; }
.ayan-submenu a:hover { background:#f8fafc; color:#111827; }
.ayan-sidebar-note { margin: 12px 16px 22px; padding:16px; border-radius:20px; background:#0f172a; color:#fff; }
.ayan-sidebar-note p { margin:8px 0 0; font-size:12px; color:#cbd5e1; line-height:1.9; }

.ayan-main { flex:1; min-width:0; height:100vh; overflow:hidden; display:flex; flex-direction:column; }
.ayan-topbar { min-height:76px; padding:14px 24px; display:flex; align-items:center; justify-content:space-between; gap:16px; color:#fff; background:linear-gradient(270deg, #0f172a 0%, #1e1b4b 48%, #312e81 100%); border-bottom:1px solid rgba(255,255,255,.1); box-shadow:0 18px 45px rgba(15,23,42,.12); }
.ayan-topbar-right, .ayan-topbar-left { display:flex; align-items:center; gap:14px; }
.ayan-topbar-kicker { color:#c7d2fe; font-size:12px; margin-bottom:4px; }
.ayan-topbar h1 { margin:0; font-size:20px; }
.ayan-icon-btn { width:42px; height:42px; border-radius:14px; border:1px solid rgba(255,255,255,.16); color:#fff; background:rgba(255,255,255,.08); cursor:pointer; }
.ayan-mobile-toggle { display:none; }
.ayan-user-chip { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:18px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.07); }
.ayan-user-avatar { width:34px; height:34px; border-radius:12px; display:grid; place-items:center; background:#fff; color:#312e81; font-weight:900; }
.ayan-user-chip strong { display:block; font-size:13px; }
.ayan-user-chip small { display:block; color:#cbd5e1; font-size:11px; margin-top:2px; }
.ayan-logout { min-height:42px; border:1px solid rgba(248,113,113,.28); color:#fee2e2; background:rgba(239,68,68,.12); border-radius:14px; padding:0 14px; cursor:pointer; font-weight:800; }
.ayan-content { flex:1; overflow-y:auto; padding:26px; }
.ayan-container { max-width:1380px; margin:0 auto; }

.ayan-alert { margin-bottom:16px; border-radius:18px; padding:14px 16px; border:1px solid; line-height:1.9; }
.ayan-alert ul { margin:8px 20px 0 0; }
.ayan-alert-success { background:#ecfdf5; color:#065f46; border-color:#a7f3d0; }
.ayan-alert-error { background:#fef2f2; color:#991b1b; border-color:#fecaca; }

.ayan-hero-card, .ayan-lookup-hero { border-radius:30px; padding:26px; color:#fff; background:linear-gradient(135deg,#1e1b4b,#3730a3 55%,#0f172a); box-shadow:var(--ayan-shadow); display:flex; align-items:flex-end; justify-content:space-between; gap:20px; overflow:hidden; position:relative; }
.ayan-hero-card::after, .ayan-lookup-hero::after { content:""; position:absolute; left:-90px; bottom:-130px; width:330px; height:330px; border-radius:999px; background:rgba(255,255,255,.08); }
.ayan-hero-card > *, .ayan-lookup-hero > * { position:relative; z-index:1; }
.ayan-hero-card h2, .ayan-lookup-hero h2 { margin:10px 0 8px; font-size:28px; }
.ayan-hero-card p, .ayan-lookup-hero p { margin:0; max-width:720px; color:#cbd5e1; line-height:2; }
.ayan-hero-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ayan-pill { display:inline-flex; align-items:center; min-height:32px; padding:0 12px; border-radius:999px; background:#eef2ff; color:#3730a3; font-size:12px; font-weight:850; }
.ayan-pill-light { background:rgba(255,255,255,.12); color:#fff; border:1px solid rgba(255,255,255,.18); }

.ayan-page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:18px; }
.ayan-page-head h2 { margin:0; font-size:25px; }
.ayan-page-head p { margin:8px 0 0; color:var(--ayan-muted); line-height:1.9; }
.ayan-page-actions { display:flex; gap:8px; flex-wrap:wrap; }

.ayan-card { background:rgba(255,255,255,.9); border:1px solid rgba(226,232,240,.95); border-radius:var(--ayan-radius); box-shadow:0 16px 44px rgba(15,23,42,.06); }
.ayan-panel-card, .ayan-form-card { padding:22px; }
.ayan-table-card { overflow:hidden; }
.ayan-card-header { padding:20px 22px; display:flex; align-items:center; justify-content:space-between; gap:14px; border-bottom:1px solid var(--ayan-border); }
.ayan-card-header h3 { margin:0; font-size:18px; }
.ayan-card-header p { margin:6px 0 0; color:var(--ayan-muted); font-size:13px; }
.ayan-mt { margin-top:18px; }
.ayan-grid { display:grid; gap:18px; }
.ayan-grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.ayan-grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.ayan-stats-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-top:18px; }
.ayan-stats-grid.compact { margin-top:0; margin-bottom:18px; }
.ayan-stat-card { background:rgba(255,255,255,.92); border:1px solid var(--ayan-border); border-radius:22px; padding:18px; box-shadow:0 14px 35px rgba(15,23,42,.05); }
.ayan-stat-card span { display:block; color:var(--ayan-muted); font-size:13px; font-weight:750; }
.ayan-stat-card strong { display:block; margin-top:8px; font-size:25px; color:#111827; }
.ayan-stat-card small { color:#94a3b8; }
.ayan-stat-card.success { background:linear-gradient(135deg,#ecfdf5,#fff); border-color:#bbf7d0; }
.ayan-stat-card.warning { background:linear-gradient(135deg,#fffbeb,#fff); border-color:#fde68a; }
.ayan-action-card { display:block; padding:22px; border-radius:24px; background:rgba(255,255,255,.9); border:1px solid var(--ayan-border); box-shadow:0 14px 35px rgba(15,23,42,.05); transition:.2s ease; }
.ayan-action-card:hover { transform:translateY(-2px); box-shadow:var(--ayan-shadow); }
.ayan-action-icon { width:48px; height:48px; display:grid; place-items:center; border-radius:17px; background:#eef2ff; margin-bottom:14px; font-size:22px; }
.ayan-action-card strong { display:block; font-size:17px; }
.ayan-action-card p { margin:9px 0 0; color:var(--ayan-muted); line-height:1.9; font-size:13px; }
.ayan-mini-list { display:grid; gap:12px; padding:2px 0; }
.ayan-mini-list div { display:flex; align-items:center; justify-content:space-between; min-height:48px; padding:0 14px; border-radius:16px; background:#f8fafc; }
.ayan-mini-list span { color:var(--ayan-muted); }
.ayan-quick-links { display:grid; gap:10px; }
.ayan-quick-links a { min-height:46px; display:flex; align-items:center; padding:0 14px; border-radius:15px; background:#f8fafc; color:#334155; font-weight:800; }
.ayan-quick-links a:hover { background:#eef2ff; color:#3730a3; }

.ayan-form, .ayan-form-grid { display:grid; gap:16px; }
.ayan-form-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.ayan-field { display:grid; gap:7px; }
.ayan-field.inline { min-width:210px; }
.ayan-field-full { grid-column:1 / -1; }
.ayan-label { color:#334155; font-size:13px; font-weight:850; }
.ayan-label span { color:var(--ayan-danger); }
.ayan-input, .ayan-select, .ayan-textarea { width:100%; min-height:50px; border:1px solid var(--ayan-border); border-radius:17px; background:#fff; color:#111827; padding:0 14px; outline:none; font-size:14px; transition:.16s ease; }
.ayan-textarea { min-height:110px; padding-top:12px; resize:vertical; }
.ayan-input:focus, .ayan-select:focus, .ayan-textarea:focus { border-color:var(--ayan-primary); box-shadow:0 0 0 4px rgba(79,70,229,.12); }
.ayan-form-actions { margin-top:18px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ayan-filter-bar { padding:16px; display:flex; gap:10px; flex-wrap:wrap; align-items:end; }
.ayan-filter-bar .ayan-input { max-width:280px; }
.ayan-check, .ayan-check-card { display:inline-flex; align-items:center; gap:8px; }
.ayan-check-card { min-height:50px; padding:0 14px; border:1px solid var(--ayan-border); border-radius:17px; background:#fff; color:#475569; font-size:13px; font-weight:750; }
.ayan-check input, .ayan-check-card input { width:17px; height:17px; accent-color:var(--ayan-primary); }

.ayan-btn { min-height:48px; border-radius:16px; border:1px solid transparent; padding:0 17px; display:inline-flex; align-items:center; justify-content:center; gap:8px; cursor:pointer; font-size:14px; font-weight:850; transition:.18s ease; }
.ayan-btn:hover { transform:translateY(-1px); }
.ayan-btn-primary { background:var(--ayan-primary); color:#fff; box-shadow:0 12px 25px rgba(79,70,229,.22); }
.ayan-btn-primary:hover { background:#4338ca; }
.ayan-btn-secondary { background:#fff; color:#334155; border-color:var(--ayan-border); }
.ayan-btn-light { background:rgba(255,255,255,.92); color:#1e1b4b; }
.ayan-btn-block { width:100%; }
.ayan-small-btn { min-height:34px; border-radius:12px; border:1px solid #cbd5e1; background:#fff; color:#334155; display:inline-flex; align-items:center; justify-content:center; padding:0 10px; font-size:12px; font-weight:850; cursor:pointer; }
.ayan-small-btn.danger { color:#991b1b; border-color:#fecaca; background:#fef2f2; }
.ayan-actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.ayan-actions form { margin:0; }

.ayan-table-wrap { width:100%; overflow-x:auto; }
.ayan-table { width:100%; border-collapse:separate; border-spacing:0; }
.ayan-table th { background:#f8fafc; color:#475569; text-align:right; padding:14px 16px; font-size:12px; font-weight:900; white-space:nowrap; border-bottom:1px solid var(--ayan-border); }
.ayan-table td { padding:14px 16px; border-bottom:1px solid #edf2f7; font-size:14px; vertical-align:middle; }
.ayan-table td strong { display:block; color:#111827; }
.ayan-table td small { display:block; color:#94a3b8; margin-top:4px; }
.ayan-table tr:hover td { background:#fbfdff; }
.ayan-empty { text-align:center; color:#94a3b8; padding:28px!important; }
.ayan-pagination { padding:16px 20px; }
.ayan-badge { display:inline-flex; min-height:30px; align-items:center; border-radius:999px; padding:0 10px; font-size:12px; font-weight:850; background:#f1f5f9; color:#475569; }
.ayan-badge.success { background:#ecfdf5; color:#047857; }
.ayan-badge.danger { background:#fef2f2; color:#b91c1c; }
.ayan-badge.muted { background:#f8fafc; color:#94a3b8; }
.ayan-badge.soft { background:#eef2ff; color:#3730a3; }

.ayan-invoice-form { display:block; }
.ayan-invoice-table .ayan-input { min-width:220px; }
.ayan-invoice-summary { padding:18px 22px; display:flex; gap:12px; justify-content:flex-end; flex-wrap:wrap; border-top:1px solid var(--ayan-border); background:#fbfdff; }
.ayan-invoice-summary div { min-width:190px; padding:14px; border-radius:18px; background:#fff; border:1px solid var(--ayan-border); }
.ayan-invoice-summary span, .ayan-total-box span, .ayan-info-grid span, .ayan-invoice-footer span { display:block; color:var(--ayan-muted); font-size:12px; margin-bottom:6px; }
.ayan-invoice-summary strong, .ayan-total-box strong, .ayan-info-grid strong { font-size:18px; }
.ayan-invoice-top { display:flex; align-items:center; justify-content:space-between; gap:20px; padding-bottom:18px; border-bottom:1px dashed #cbd5e1; }
.ayan-invoice-top h3 { margin:0; }
.ayan-invoice-top p, .ayan-invoice-top span { color:var(--ayan-muted); }
.ayan-info-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:18px; }
.ayan-info-grid div { background:#f8fafc; border:1px solid var(--ayan-border); border-radius:18px; padding:14px; }
.ayan-invoice-footer { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-top:18px; }
.ayan-total-box { min-width:280px; display:grid; gap:10px; }
.ayan-total-box div { padding:14px; background:#f8fafc; border-radius:18px; border:1px solid var(--ayan-border); }

.ayan-search-card { padding:18px; }
.ayan-search-line { display:flex; gap:10px; }
.ayan-price-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.ayan-price-card { padding:18px; border-radius:22px; background:rgba(255,255,255,.92); border:1px solid var(--ayan-border); box-shadow:0 14px 35px rgba(15,23,42,.05); }
.ayan-price-card.low { border-color:#fecaca; background:linear-gradient(135deg,#fff,#fef2f2); }
.ayan-price-card span { color:var(--ayan-primary); font-size:12px; font-weight:900; }
.ayan-price-card h3 { margin:8px 0 4px; font-size:17px; }
.ayan-price-card small { color:#94a3b8; }
.ayan-price-value { margin-top:16px; font-size:24px; font-weight:950; color:#111827; }
.ayan-price-value small { font-size:12px; color:var(--ayan-muted); }
.ayan-stock-line { margin-top:12px; min-height:34px; display:flex; align-items:center; padding:0 10px; border-radius:14px; background:#f8fafc; color:#475569; font-size:13px; }

.ayan-datepicker { position:absolute; z-index:1000; width:292px; padding:12px; border-radius:20px; background:#fff; box-shadow:0 24px 60px rgba(15,23,42,.2); border:1px solid var(--ayan-border); direction:rtl; }
.ayan-datepicker-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.ayan-datepicker-head button { width:34px; height:34px; border:0; border-radius:12px; background:#eef2ff; color:#3730a3; cursor:pointer; font-weight:900; }
.ayan-datepicker-title { font-weight:900; color:#111827; }
.ayan-datepicker-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; }
.ayan-datepicker-day-name { color:#94a3b8; font-size:11px; text-align:center; padding:5px 0; }
.ayan-datepicker-day { height:34px; border:0; border-radius:11px; background:#f8fafc; color:#334155; cursor:pointer; font-weight:750; }
.ayan-datepicker-day:hover { background:#eef2ff; color:#3730a3; }
.ayan-datepicker-day.is-empty { visibility:hidden; }
.ayan-datepicker-day.is-today { box-shadow:inset 0 0 0 2px #c7d2fe; }
.ayan-datepicker-day.is-selected { background:#4f46e5; color:#fff; }
.ayan-datepicker-foot { margin-top:10px; display:flex; gap:6px; }
.ayan-datepicker-foot button { flex:1; min-height:34px; border:1px solid var(--ayan-border); background:#fff; border-radius:12px; cursor:pointer; font-weight:800; }

@media print {
    body { background:#fff; }
    .ayan-sidebar, .ayan-topbar, .ayan-page-head, .ayan-alert { display:none!important; }
    .ayan-app, .ayan-main, .ayan-content { display:block; height:auto; overflow:visible; padding:0; }
    .ayan-card { box-shadow:none; border:0; }
}

@media (max-width: 1160px) {
    .ayan-stats-grid, .ayan-price-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .ayan-grid-3 { grid-template-columns:1fr 1fr; }
    .ayan-form-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width: 900px) {
    .ayan-mobile-toggle, .ayan-sidebar-close { display:grid; place-items:center; }
    .ayan-sidebar { position:fixed; inset:0 auto 0 0; right:0; transform:translateX(110%); transition:.25s ease; }
    body.ayan-sidebar-open .ayan-sidebar { transform:translateX(0); }
    .ayan-mobile-backdrop { display:none; position:fixed; inset:0; background:rgba(15,23,42,.44); z-index:35; }
    body.ayan-sidebar-open .ayan-mobile-backdrop { display:block; }
    .ayan-topbar { padding:12px 14px; }
    .ayan-user-chip { display:none; }
    .ayan-content { padding:16px; }
    .ayan-hero-card, .ayan-lookup-hero, .ayan-page-head, .ayan-invoice-footer { flex-direction:column; align-items:stretch; }
    .ayan-grid-2, .ayan-grid-3, .ayan-stats-grid, .ayan-price-grid, .ayan-info-grid { grid-template-columns:1fr; }
    .ayan-form-grid { grid-template-columns:1fr; }
    .ayan-filter-bar .ayan-input { max-width:none; }
    .ayan-search-line { flex-direction:column; }
}
@media (max-width: 780px) {
    .ayan-auth-shell { grid-template-columns:1fr; }
    .ayan-auth-hero { min-height:320px; }
    .ayan-login-card { padding:24px; border-radius:24px; }
}

/* Ayan invoice UI edit patch v1 */
:root {
    --ayan-midnight: #191970;
    --ayan-midnight-2: #11115c;
    --ayan-midnight-soft: #23238a;
    --ayan-sidebar-text: rgba(255,255,255,.9);
    --ayan-sidebar-muted: rgba(255,255,255,.58);
}

body {
    background:
        radial-gradient(circle at 16% 2%, rgba(25, 25, 112, .18), transparent 34%),
        radial-gradient(circle at 82% 14%, rgba(79, 70, 229, .12), transparent 30%),
        linear-gradient(135deg, #e8edf7 0%, #f5f7fb 55%, #e9edf6 100%);
}

.ayan-sidebar {
    background:
        radial-gradient(circle at 20% 0%, rgba(255,255,255,.14), transparent 30%),
        linear-gradient(180deg, var(--ayan-midnight) 0%, var(--ayan-midnight-2) 58%, #09093e 100%) !important;
    border-left: 1px solid rgba(255,255,255,.09) !important;
    box-shadow: 24px 0 70px rgba(25,25,112,.28) !important;
}

.ayan-sidebar-brand {
    border-bottom-color: rgba(255,255,255,.10) !important;
}
.ayan-brand-mark {
    background: rgba(255,255,255,.13) !important;
    border: 1px solid rgba(255,255,255,.20);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 18px 34px rgba(0,0,0,.20) !important;
}
.ayan-sidebar-brand strong,
.ayan-sidebar-profile strong {
    color: #fff !important;
}
.ayan-sidebar-brand span,
.ayan-sidebar-profile span {
    color: var(--ayan-sidebar-muted) !important;
}
.ayan-sidebar-profile {
    background: rgba(255,255,255,.08) !important;
    border-color: rgba(255,255,255,.12) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.ayan-profile-ring {
    background: rgba(255,255,255,.14) !important;
    color: #fff !important;
    box-shadow: none !important;
}
.ayan-menu-link {
    color: var(--ayan-sidebar-text) !important;
    border-color: transparent !important;
}
.ayan-menu-link:hover {
    background: rgba(255,255,255,.09) !important;
    color: #fff !important;
}
.ayan-menu-link.active,
.ayan-submenu a.active {
    background: rgba(255,255,255,.16) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,.24) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.ayan-menu-icon {
    background: rgba(255,255,255,.12) !important;
    color: #fff !important;
    box-shadow: none !important;
}
.ayan-menu-arrow { color: rgba(255,255,255,.46) !important; }
.ayan-submenu {
    border-right-color: rgba(255,255,255,.18) !important;
}
.ayan-submenu a {
    color: rgba(255,255,255,.70) !important;
}
.ayan-submenu a:hover {
    background: rgba(255,255,255,.08) !important;
    color: #fff !important;
}
.ayan-sidebar-note {
    background: rgba(255,255,255,.10) !important;
    border: 1px solid rgba(255,255,255,.12);
}
.ayan-sidebar-note p { color: rgba(255,255,255,.66) !important; }
.ayan-sidebar-close {
    background: rgba(255,255,255,.13) !important;
    color: #fff;
}

.ayan-topbar {
    background: linear-gradient(270deg, #10105d 0%, #191970 48%, #272795 100%) !important;
}
.ayan-content {
    background:
        radial-gradient(circle at 90% 4%, rgba(25,25,112,.10), transparent 24%),
        linear-gradient(180deg, rgba(255,255,255,.20), rgba(255,255,255,0));
}

.ayan-page-head-pro {
    background: rgba(255,255,255,.62);
    border: 1px solid rgba(226,232,240,.92);
    border-radius: 28px;
    padding: 18px 20px;
    box-shadow: 0 18px 45px rgba(15,23,42,.06);
    backdrop-filter: blur(12px);
}
.ayan-section-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--ayan-midnight);
    font-size: 11px;
    font-weight: 900;
    margin-bottom: 8px;
}
.ayan-btn-light-solid {
    background: #f8fafc;
    color: #111827;
    border-color: #e2e8f0;
}

.ayan-invoice-meta-card,
.ayan-invoice-builder-card,
.ayan-invoice-submit-card {
    border-color: rgba(203,213,225,.92) !important;
    background: rgba(255,255,255,.94) !important;
}
.ayan-invoice-builder-head {
    background: linear-gradient(180deg,#fff,#f8fafc);
}
.ayan-invoice-builder-head kbd,
.ayan-shortcut-note strong {
    min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 2px 7px;
    background: #eef2ff;
    color: var(--ayan-midnight);
    border: 1px solid #c7d2fe;
    font-size: 11px;
    font-weight: 900;
}
.ayan-invoice-table-pro th {
    background: #f1f5ff !important;
    color: #1e1b4b !important;
}
.ayan-invoice-table-pro td {
    background: rgba(255,255,255,.84);
}
.ayan-invoice-table-pro tr:hover td {
    background: #fbfdff !important;
}
.ayan-invoice-table-pro tr.has-stock-error td {
    background: #fff7f7 !important;
}
.ayan-invoice-product-cell {
    display: grid;
    gap: 6px;
}
.ayan-invoice-product-cell small,
.js-product-help {
    color: #64748b;
    font-size: 12px;
}
.ayan-stock-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border-radius: 999px;
    padding: 0 10px;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
    font-weight: 800;
    font-size: 12px;
}
.ayan-money-input-wrap {
    position: relative;
    min-width: 170px;
}
.ayan-money-input-wrap small {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 11px;
    pointer-events: none;
}
.ayan-price-input {
    padding-left: 58px !important;
    font-weight: 900;
    color: #111827;
}
.ayan-qty-input {
    min-width: 108px !important;
    font-weight: 900;
}
.ayan-line-total {
    white-space: nowrap;
    color: var(--ayan-midnight) !important;
    font-size: 15px;
}
.ayan-invoice-summary-pro {
    background: linear-gradient(180deg,#fbfdff,#f1f5f9) !important;
}
.ayan-invoice-summary-pro div {
    background: #fff !important;
    box-shadow: 0 10px 24px rgba(15,23,42,.04);
}
.ayan-form-actions-between {
    justify-content: space-between;
    align-items: center;
}
.ayan-shortcut-note {
    color: #64748b;
    font-size: 12px;
    line-height: 2;
}

.ayan-invoice-page-shell {
    display: grid;
    place-items: start center;
}
.ayan-invoice-receipt {
    width: min(100%, 1080px);
    position: relative;
    overflow: hidden;
    background: #fff;
    border-radius: 34px;
    border: 1px solid rgba(203,213,225,.95);
    box-shadow: 0 26px 70px rgba(15,23,42,.10);
}
.ayan-receipt-ribbon {
    height: 10px;
    background: linear-gradient(90deg, #191970, #4f46e5, #60a5fa);
}
.ayan-receipt-company-name {
    padding: 18px 30px 4px;
    color: #191970;
    direction: ltr;
    text-align: center;
    font-size: 24px;
    font-weight: 950;
    letter-spacing: 0;
}
.ayan-receipt-header {
    padding: 28px 30px 22px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid #e2e8f0;
    background:
        radial-gradient(circle at 0% 0%, rgba(25,25,112,.08), transparent 28%),
        linear-gradient(180deg,#fff,#fbfdff);
}
.ayan-receipt-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.ayan-receipt-logo {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg,#191970,#3030a0);
    color: #fff;
    font-size: 24px;
    font-weight: 950;
    box-shadow: 0 18px 34px rgba(25,25,112,.25);
}
.ayan-receipt-brand h3 {
    margin: 0;
    font-size: 22px;
}
.ayan-receipt-brand p {
    margin: 6px 0 0;
    color: #64748b;
}
.ayan-receipt-number {
    min-width: 210px;
    padding: 14px 16px;
    border: 1px solid #e0e7ff;
    background: #eef2ff;
    border-radius: 22px;
    text-align: left;
    direction: ltr;
}
.ayan-receipt-number span,
.ayan-receipt-number small {
    display: block;
    color: #64748b;
    font-size: 12px;
}
.ayan-receipt-number strong {
    display: block;
    margin: 5px 0;
    color: #191970;
    font-size: 22px;
    letter-spacing: .04em;
}
.ayan-receipt-meta-grid {
    padding: 22px 30px 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 12px;
}
.ayan-receipt-meta-grid div,
.ayan-receipt-notes,
.ayan-receipt-totals div {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 20px;
    padding: 14px;
}
.ayan-receipt-meta-grid span,
.ayan-receipt-notes span,
.ayan-receipt-totals span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 6px;
}
.ayan-receipt-meta-grid strong,
.ayan-receipt-totals strong {
    display: block;
    color: #111827;
    font-size: 17px;
}
.ayan-receipt-table-wrap {
    margin: 22px 30px;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
}
.ayan-receipt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.ayan-receipt-table th {
    background: #191970;
    color: #fff;
    text-align: right;
    padding: 15px 14px;
    font-size: 12px;
    white-space: nowrap;
}
.ayan-receipt-table td {
    padding: 15px 14px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}
.ayan-receipt-table tr:last-child td {
    border-bottom: 0;
}
.ayan-receipt-table td strong {
    color: #111827;
}
.ayan-receipt-table td small {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
}
.ayan-profit-cell {
    color: #047857;
    font-weight: 900;
}
.ayan-receipt-bottom {
    padding: 0 30px 30px;
    display: grid;
    grid-template-columns: minmax(0,1fr) 320px;
    gap: 16px;
    align-items: start;
}
.ayan-receipt-notes p {
    margin: 0;
    color: #334155;
    line-height: 2;
}
.ayan-receipt-totals {
    display: grid;
    gap: 10px;
}
.ayan-receipt-totals div {
    background: #fff;
}
.ayan-receipt-totals div:first-child {
    background: #eef2ff;
    border-color: #c7d2fe;
}
.ayan-receipt-totals .success {
    background: #ecfdf5;
    border-color: #bbf7d0;
}
.ayan-receipt-totals strong {
    font-size: 22px;
    color: #191970;
}
.ayan-receipt-totals .success strong {
    color: #047857;
}
.ayan-receipt-totals .warning {
    background: #fff7ed;
    border-color: #fed7aa;
}
.ayan-receipt-totals .warning strong {
    color: #c2410c;
}

@media print {
    .ayan-no-print,
    .ayan-sidebar,
    .ayan-topbar,
    .ayan-alert { display: none !important; }
    body { background: #fff !important; }
    .ayan-app,
    .ayan-main,
    .ayan-content,
    .ayan-container,
    .ayan-invoice-page-shell { display: block !important; height: auto !important; overflow: visible !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
    .ayan-invoice-receipt { width: 100% !important; border-radius: 0 !important; box-shadow: none !important; border: 0 !important; }
    .ayan-receipt-header,
    .ayan-receipt-meta-grid,
    .ayan-receipt-table-wrap,
    .ayan-receipt-bottom { margin-left: 0 !important; margin-right: 0 !important; }
}

@media (max-width: 900px) {
    .ayan-receipt-header,
    .ayan-page-head-pro,
    .ayan-form-actions-between { flex-direction: column; align-items: stretch; }
    .ayan-receipt-meta-grid,
    .ayan-receipt-bottom { grid-template-columns: 1fr; }
    .ayan-receipt-number { text-align: right; direction: rtl; }
}

/* Compact, readable A4 invoice print layout */
@page {
    size: A4 portrait;
    margin: 9mm;
}

@media print {
    html,
    body {
        background: #fff !important;
        color: #111827 !important;
        font-size: 10.5pt !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .ayan-invoice-page-shell {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .ayan-invoice-receipt {
        width: 100% !important;
        max-width: none !important;
        overflow: visible !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        font-size: 10.5pt !important;
    }

    .ayan-receipt-ribbon {
        height: 4px !important;
        background: #191970 !important;
    }

    .ayan-receipt-company-name {
        padding: 5px 0 2px !important;
        font-size: 16pt !important;
        line-height: 1.2 !important;
    }

    .ayan-receipt-header {
        padding: 10px 0 9px !important;
        gap: 12px !important;
        border-bottom: 1px solid #cbd5e1 !important;
        background: #fff !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .ayan-receipt-brand {
        gap: 9px !important;
    }

    .ayan-receipt-logo {
        width: 36px !important;
        height: 36px !important;
        border-radius: 9px !important;
        background: #191970 !important;
        box-shadow: none !important;
        font-size: 16px !important;
    }

    .ayan-receipt-brand h3 {
        font-size: 15pt !important;
    }

    .ayan-receipt-brand p {
        margin-top: 2px !important;
        font-size: 8.5pt !important;
    }

    .ayan-receipt-number {
        min-width: 140px !important;
        padding: 7px 9px !important;
        border-radius: 9px !important;
        background: #f1f5ff !important;
    }

    .ayan-receipt-number span,
    .ayan-receipt-number small {
        font-size: 8pt !important;
    }

    .ayan-receipt-number strong {
        margin: 2px 0 !important;
        font-size: 13pt !important;
    }

    .ayan-receipt-meta-grid {
        padding: 8px 0 0 !important;
        gap: 6px !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .ayan-receipt-meta-grid div {
        min-height: 0 !important;
        padding: 7px 8px !important;
        border-radius: 8px !important;
    }

    .ayan-receipt-meta-grid span,
    .ayan-receipt-notes span,
    .ayan-receipt-totals span {
        margin-bottom: 3px !important;
        font-size: 8pt !important;
    }

    .ayan-receipt-meta-grid strong {
        font-size: 9.5pt !important;
    }

    .ayan-receipt-table-wrap {
        margin: 10px 0 !important;
        border-radius: 10px !important;
        overflow: visible !important;
    }

    .ayan-receipt-table {
        font-size: 9.5pt !important;
    }

    .ayan-receipt-table th {
        padding: 7px 8px !important;
        background: #191970 !important;
        font-size: 8.5pt !important;
    }

    .ayan-receipt-table td {
        padding: 7px 8px !important;
        border-bottom-color: #e2e8f0 !important;
    }

    .ayan-receipt-table td small {
        margin-top: 2px !important;
        font-size: 8pt !important;
    }

    .ayan-receipt-table thead {
        display: table-header-group;
    }

    .ayan-receipt-table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .ayan-receipt-bottom {
        padding: 0 0 4px !important;
        grid-template-columns: minmax(0, 1fr) 220px !important;
        gap: 8px !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .ayan-receipt-notes,
    .ayan-receipt-totals div {
        padding: 8px !important;
        border-radius: 8px !important;
    }

    .ayan-receipt-notes p {
        line-height: 1.6 !important;
        font-size: 9pt !important;
    }

    .ayan-receipt-totals {
        gap: 5px !important;
    }

    .ayan-receipt-totals strong {
        font-size: 11pt !important;
    }
}


/* FIFO purchase/inventory patch */
.ayan-sidebar{
    background:#191970 !important;
    border-left:1px solid rgba(255,255,255,.12) !important;
    box-shadow:-18px 0 45px rgba(25,25,112,.28) !important;
}
.ayan-sidebar-brand,
.ayan-sidebar-profile,
.ayan-sidebar-note{
    background:rgba(255,255,255,.08) !important;
    border-color:rgba(255,255,255,.12) !important;
    color:#fff !important;
}
.ayan-sidebar-brand span,
.ayan-sidebar-profile span,
.ayan-sidebar-note p{color:rgba(255,255,255,.72) !important;}
.ayan-menu-link{color:rgba(255,255,255,.78) !important;}
.ayan-menu-link:hover,
.ayan-menu-link.active{
    background:rgba(255,255,255,.14) !important;
    color:#fff !important;
}
.ayan-submenu{
    background:rgba(0,0,0,.14) !important;
    border-color:rgba(255,255,255,.08) !important;
}
.ayan-submenu a{color:rgba(255,255,255,.72) !important;}
.ayan-submenu a.active,.ayan-submenu a:hover{color:#fff !important;background:rgba(255,255,255,.12) !important;}
.ayan-brand-mark,.ayan-profile-ring{background:rgba(255,255,255,.16) !important;color:#fff !important;}
.ayan-micro-input{margin-top:8px;}
.ayan-help{display:block;margin-top:7px;color:#64748b;font-size:12px;line-height:1.8;}
.ayan-purchase-table th:nth-child(1){min-width:260px;}
.ayan-purchase-table th:nth-child(2){min-width:190px;}
.ayan-purchase-table th:nth-child(3){min-width:150px;}
.ayan-purchase-table input{min-width:110px;}
.ayan-danger-zone{margin-top:18px;padding-top:18px;border-top:1px dashed #fecaca;display:flex;justify-content:flex-end;}
.ayan-btn-danger{background:#dc2626;color:#fff;border-color:#dc2626;}
.ayan-btn-danger:hover{background:#b91c1c;border-color:#b91c1c;}
.ayan-fifo-detail-row td{background:#f8fafc !important;border-top:0 !important;}
.ayan-fifo-detail{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:12px;color:#475569;}
.ayan-fifo-detail strong{color:#1e293b;margin-left:4px;}
.ayan-fifo-detail span{padding:7px 10px;border-radius:999px;background:#fff;border:1px solid #e2e8f0;}
.ayan-check-field{display:flex;align-items:center;gap:8px;margin-top:28px;color:#334155;font-size:13px;}
.ayan-filter-actions{align-self:end;}
.ayan-badge.success{background:#dcfce7;color:#166534;}
.ayan-badge.muted{background:#f1f5f9;color:#64748b;}
@media print{
    .no-print,.ayan-sidebar,.ayan-navbar{display:none !important;}
    .ayan-main{margin:0 !important;padding:0 !important;}
    .ayan-content{padding:0 !important;}
    .ayan-receipt-card{box-shadow:none !important;border:0 !important;}
}

/* Ayan debt/invoice cleanup patch */
.ayan-info-strip{
    display:flex;
    gap:10px;
    align-items:center;
    background:#eef2ff;
    border:1px solid #c7d2fe;
    border-radius:18px;
    padding:14px 16px;
    color:#334155;
}
.ayan-info-strip strong{color:#191970;white-space:nowrap;}
.ayan-credit-toggle{
    display:flex;
    flex-direction:column;
    gap:4px;
    padding:14px 16px;
    border:1px solid #c7d2fe;
    border-radius:18px;
    background:#eef2ff;
    cursor:pointer;
    min-height:70px;
    justify-content:center;
}
.ayan-credit-toggle input{width:18px;height:18px;margin:0 0 4px 0;accent-color:#191970;}
.ayan-credit-toggle span{font-weight:900;color:#191970;}
.ayan-credit-toggle small{color:#64748b;line-height:1.7;}
.ayan-badge.warning{background:#fef3c7;color:#92400e;}
.ayan-btn-success{background:#059669;color:#fff;border-color:#059669;}
.ayan-btn-success:hover{background:#047857;border-color:#047857;}
.ayan-small-btn.success{background:#ecfdf5;color:#047857;border-color:#bbf7d0;}
.ayan-small-btn.success:hover{background:#d1fae5;color:#065f46;}
.ayan-receipt-totals .warning{background:#fff7ed;border-color:#fed7aa;}
.ayan-receipt-totals .warning strong{color:#c2410c;}
.ayan-stat-card small{display:block;margin-top:8px;color:#64748b;font-size:12px;font-weight:500;}
.ayan-purchase-table-clean th:nth-child(1){min-width:300px;}
.ayan-purchase-table-clean th:nth-child(2){min-width:120px;}
.ayan-purchase-table-clean th:nth-child(3),
.ayan-purchase-table-clean th:nth-child(4),
.ayan-purchase-table-clean th:nth-child(5){min-width:150px;}
.ayan-row-actions form,
.ayan-page-actions form{display:inline-flex;margin:0;}
@media (max-width:900px){
    .ayan-credit-toggle{min-height:auto;}
    .ayan-info-strip{align-items:flex-start;flex-direction:column;}
}

/* Purchase credit tracking patch */
.ayan-credit-toggle{
    display:flex;
    gap:12px;
    align-items:flex-start;
    padding:16px;
    border:1px solid #dbe3ff;
    background:linear-gradient(135deg,#f8faff,#eef2ff);
    border-radius:18px;
    cursor:pointer;
}
.ayan-credit-toggle input{
    width:20px;
    height:20px;
    margin-top:3px;
    accent-color:#191970;
}
.ayan-credit-toggle strong{
    display:block;
    color:#191970;
    font-size:14px;
    margin-bottom:4px;
}
.ayan-credit-toggle small{
    display:block;
    color:#64748b;
    line-height:1.9;
}
.ayan-mt-mini{margin-top:14px;}
.ayan-mb{margin-bottom:18px;}
.ayan-badge.warning{background:#fef3c7;color:#92400e;border:1px solid #fde68a;}
.ayan-small-btn.success{background:#dcfce7;color:#166534;border-color:#bbf7d0;}
.ayan-credit-followup-box{
    margin:20px 30px 0;
    padding:18px;
    border:1px solid #fde68a;
    background:#fffbeb;
    border-radius:18px;
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:center;
}
.ayan-credit-followup-box strong{color:#92400e;display:block;margin-bottom:5px;}
.ayan-credit-followup-box p{margin:0;color:#78350f;line-height:1.8;}
.ayan-row-actions form{display:inline-flex;margin:0;}
@media(max-width:780px){.ayan-credit-followup-box{flex-direction:column;align-items:stretch;margin:16px;}}

/* Purchase Excel import patch */
.ayan-import-card {
    border: 1px solid rgba(25, 25, 112, .10);
    background: linear-gradient(135deg, rgba(25, 25, 112, .055), rgba(255,255,255,.96));
}
.ayan-excel-import-form {
    margin-top: 16px;
}
.ayan-import-grid {
    align-items: end;
}
.ayan-import-card small {
    display: block;
    margin-top: 7px;
    color: #64748b;
    line-height: 1.9;
}
.ayan-import-action-field .ayan-btn {
    width: 100%;
    min-height: 45px;
}
.ayan-import-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.ayan-import-summary > div {
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(15, 23, 42, .08);
}
.ayan-import-summary span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
}
.ayan-import-summary strong {
    color: #191970;
    font-size: 18px;
    font-weight: 900;
}
@media (max-width: 900px) {
    .ayan-import-summary {
        grid-template-columns: 1fr;
    }
}

/* Discount + negative stock patch */
.ayan-discount-box {
    margin-top: 18px;
    padding: 16px;
    border: 1px dashed rgba(25, 25, 112, .22);
    border-radius: 18px;
    background: rgba(25, 25, 112, .035);
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(220px, 360px);
    gap: 12px 18px;
    align-items: end;
}
.ayan-discount-box .ayan-label { margin-bottom: 0; }
.ayan-invoice-summary-pro div:last-child {
    background: #f3f6ff;
    border-color: rgba(25, 25, 112, .14);
}
.ayan-invoice-summary-pro div:last-child strong { color: #191970; }
.has-stock-warning { background: rgba(245, 158, 11, .06); }
.has-stock-warning .ayan-stock-pill { border-color: rgba(245, 158, 11, .35); color: #92400e; background: rgba(245, 158, 11, .08); }
.ayan-row-actions small,
.ayan-table td small { display:block; margin-top:4px; color:#64748b; font-size:11px; }
@media (max-width: 760px) {
    .ayan-discount-box { grid-template-columns: 1fr; }
}


/* Ayan purchase total / stock card / partial credit patch */
.ayan-purchase-table .js-purchase-line-total-input{min-width:150px;font-weight:850;color:#191970;}
.ayan-purchase-table .js-purchase-price{min-width:145px;}
.ayan-purchase-table .js-purchase-quantity{min-width:105px;}
.ayan-purchase-meta-grid{grid-template-columns:repeat(4,minmax(0,1fr));}
.ayan-receipt-inline-box{margin:20px 30px 0;}
.ayan-receipt-danger-zone{
    margin:0 30px 30px;
    padding:18px;
    border:1px solid #fecaca;
    border-radius:20px;
    background:#fff7f7;
    align-items:center;
    justify-content:space-between;
    gap:18px;
}
.ayan-receipt-danger-zone strong{display:block;color:#991b1b;margin-bottom:5px;}
.ayan-receipt-danger-zone p{margin:0;color:#7f1d1d;font-size:12px;line-height:1.8;}

.ayan-credit-payment-box{
    margin:18px 0 0;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:17px 18px;
    border:1px solid #c7d2fe;
    border-radius:20px;
    background:linear-gradient(135deg,#f8faff,#eef2ff);
}
.ayan-credit-payment-box p{margin:5px 0 0;color:#64748b;font-size:12px;line-height:1.8;}
.ayan-credit-payment-box .ayan-money-input-wrap{width:min(100%,300px);}
.ayan-credit-payment-box.is-disabled{opacity:.58;filter:grayscale(.25);}
.ayan-credit-payment-box.is-disabled input{background:#f1f5f9;cursor:not-allowed;}
.ayan-invoice-summary-five{grid-template-columns:repeat(5,minmax(0,1fr));}
.ayan-invoice-summary-five .warning{background:#fff7ed!important;border-color:#fed7aa!important;}
.ayan-invoice-summary-five .warning strong{color:#c2410c!important;}

.ayan-payment-followup-card{
    margin:20px 30px 0;
    padding:18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    border:1px solid #fed7aa;
    background:#fff7ed;
    border-radius:22px;
}
.ayan-payment-followup-card strong{color:#9a3412;}
.ayan-payment-followup-card p{margin:5px 0 0;color:#7c2d12;font-size:12px;}
.ayan-payment-followup-form{display:flex;align-items:center;gap:10px;min-width:min(100%,390px);}
.ayan-payment-followup-form .ayan-money-input-wrap{flex:1;}
.ayan-payment-history{margin:0 30px 30px;border:1px solid #e2e8f0;border-radius:22px;overflow:hidden;}
.ayan-payment-history .ayan-card-header{padding:18px;border-bottom:1px solid #e2e8f0;background:#f8fafc;}
.ayan-payment-history h3{margin:0;}
.ayan-payment-history p{margin:4px 0 0;color:#64748b;font-size:12px;}
.ayan-inline-payment-form{display:flex;align-items:center;gap:8px;min-width:260px;}
.ayan-inline-payment-form .ayan-money-input-wrap{min-width:170px;}
.ayan-credit-table td small{display:block;margin-top:4px;color:#64748b;}
.ayan-text-success{color:#047857!important;}
.ayan-text-danger{color:#dc2626!important;}

.ayan-stock-card-filter .ayan-field-span-2{grid-column:span 2;}
.ayan-stock-card-title{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:20px 22px;
    border-radius:24px;
    color:#fff;
    background:linear-gradient(135deg,#191970,#3131a8);
    box-shadow:0 18px 38px rgba(25,25,112,.2);
}
.ayan-stock-card-title span,.ayan-stock-card-title small{color:rgba(255,255,255,.72);}
.ayan-stock-card-title h3{margin:5px 0;font-size:23px;}
.ayan-stock-card-range{padding:10px 14px;border:1px solid rgba(255,255,255,.2);border-radius:14px;background:rgba(255,255,255,.1);white-space:nowrap;}
.ayan-stock-card-table th{white-space:nowrap;}
.ayan-stock-card-table .ayan-opening-row td{background:#f8fafc;font-weight:700;}
.ayan-stock-card-table .ayan-qty-in{color:#047857;font-weight:900;}
.ayan-stock-card-table .ayan-qty-out{color:#b45309;font-weight:900;}
.ayan-table-link{color:#191970;font-weight:850;text-decoration:none;}
.ayan-table-link:hover{text-decoration:underline;}

@media(max-width:1100px){
    .ayan-invoice-summary-five{grid-template-columns:repeat(2,minmax(0,1fr));}
    .ayan-purchase-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:760px){
    .ayan-credit-payment-box,
    .ayan-payment-followup-card,
    .ayan-payment-followup-form,
    .ayan-stock-card-title,
    .ayan-receipt-danger-zone{flex-direction:column;align-items:stretch;}
    .ayan-credit-payment-box .ayan-money-input-wrap,
    .ayan-payment-followup-form{width:100%;min-width:0;}
    .ayan-invoice-summary-five,
    .ayan-purchase-meta-grid{grid-template-columns:1fr;}
    .ayan-stock-card-filter .ayan-field-span-2{grid-column:auto;}
    .ayan-receipt-inline-box,
    .ayan-payment-followup-card,
    .ayan-payment-history,
    .ayan-receipt-danger-zone{margin-left:16px;margin-right:16px;}
}

/* global live table filters and bulk actions */
.ayan-table-filterbar{display:flex;align-items:center;gap:12px;padding:12px 14px;margin:0 0 12px;border:1px solid #dbe4f0;border-radius:14px;background:#f8fafc}.ayan-table-filterbar[hidden]{display:none}.ayan-table-filterbar .ayan-input{max-width:360px}.ayan-column-search{border:0;background:transparent;color:#4654a3;cursor:pointer;font-size:18px;margin-right:6px}.ayan-bulk-toolbar{display:flex;justify-content:flex-end;padding:12px 16px;border-bottom:1px solid #edf1f6}.ayan-btn-danger{background:#b42318;color:#fff;border-color:#b42318}.ayan-btn-danger:disabled{opacity:.45;cursor:not-allowed}.ayan-table tfoot td,.pp-table tfoot td{background:#f8fafc;border-top:2px solid #d8e0ed;padding:12px;font-weight:700}.ayan-customer-payment-card{margin-top:18px;padding:18px;border:1px solid #dfe6f0;border-radius:16px;background:#fbfcfe}.ayan-customer-payment-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.ayan-settled-check{display:flex;align-items:center;gap:8px;margin-top:10px;font-weight:700}.ayan-invoice-summary-three{grid-template-columns:repeat(3,minmax(0,1fr))}.pp-invoice-footer-single{grid-template-columns:1.5fr 1fr}.pp-summary-grid-three{grid-template-columns:repeat(3,minmax(0,1fr))}@media(max-width:900px){.ayan-customer-payment-grid{grid-template-columns:1fr 1fr}.pp-invoice-footer-single{grid-template-columns:1fr}}@media(max-width:600px){.ayan-customer-payment-grid,.ayan-invoice-summary-three,.pp-summary-grid-three{grid-template-columns:1fr}}


/* Table filter and financial totals refinement */
.ayan-table-filterbar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 16px;margin:0 0 12px;border:1px solid #dbe4f0;border-radius:16px;background:#f8fafc;position:relative;z-index:2}
.ayan-table-filterbar[hidden]{display:none}
.ayan-table-filterbar-title{display:flex;flex-direction:column;gap:3px;min-width:150px}.ayan-table-filterbar-title span{font-size:11px;color:#64748b}.ayan-table-filterbar-title strong{font-size:14px;color:#1e293b}
.ayan-table-filterbar-controls{display:flex;align-items:center;gap:8px;flex:1}.ayan-table-filterbar-controls .ayan-input{max-width:420px}
.ayan-bulk-select-cell{width:42px;text-align:center!important}.ayan-bulk-select-cell input{width:17px;height:17px;accent-color:#4f46e5}
.ayan-table tfoot[data-ayan-generated-sums] td,.pp-table tfoot[data-ayan-generated-sums] td{background:#f8fafc;border-top:2px solid #d8e0ed;padding:12px;font-weight:700;white-space:nowrap}
.ayan-datepicker{z-index:10000}
@media(max-width:760px){.ayan-table-filterbar{align-items:stretch;flex-direction:column}.ayan-table-filterbar-controls{flex-wrap:wrap}.ayan-table-filterbar-controls .ayan-input{max-width:none;flex:1 1 100%}}

/* Multi-column live filters + invoice footer layout */
.ayan-filterable-head{
    min-width:128px;
    position:relative;
}
.ayan-filterable-head .ayan-header-title{
    display:inline-flex;
    align-items:center;
    min-height:31px;
}
.ayan-column-search{
    width:30px;
    height:30px;
    margin-right:7px;
    border:1px solid #dbe3ef;
    border-radius:9px;
    background:#fff;
    color:#475569;
    cursor:pointer;
    font-size:17px;
    line-height:1;
    vertical-align:middle;
    transition:.18s ease;
}
.ayan-column-search:hover,
.ayan-filterable-head.is-filter-open .ayan-column-search,
.ayan-filterable-head.has-active-filter .ayan-column-search{
    background:#eef2ff;
    border-color:#818cf8;
    color:#3730a3;
    box-shadow:0 0 0 3px rgba(99,102,241,.10);
}
.ayan-filter-row{display:none}
.ayan-filter-row.is-visible{display:table-row}
.ayan-filter-row th{
    padding:7px 8px!important;
    background:#f3f6fb!important;
    border-bottom:1px solid #dbe3ef!important;
    vertical-align:middle;
}
.ayan-column-filter-cell .ayan-column-filter-input{
    display:none;
    width:100%;
    min-width:110px;
    height:38px;
    border:1px solid #dbe3ef;
    border-radius:10px;
    background:#fff;
    padding:8px 10px;
    color:#0f172a;
    font:inherit;
    outline:none;
}
.ayan-column-filter-cell.is-open .ayan-column-filter-input,
.ayan-column-filter-cell.has-value .ayan-column-filter-input{display:block}
.ayan-column-filter-cell .ayan-column-filter-input:focus{
    border-color:#6366f1;
    box-shadow:0 0 0 3px rgba(99,102,241,.10);
}
.ayan-column-filter-cell.has-value .ayan-column-filter-input{
    border-color:#818cf8;
    background:#f8faff;
}
.ayan-column-filter-cell.is-disabled{min-width:38px}
.ayan-active-filters{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin:0 0 10px;
    padding:11px 14px;
    border:1px solid #c7d2fe;
    border-radius:13px;
    background:linear-gradient(180deg,#f8faff,#eef2ff);
}
.ayan-active-filters[hidden]{display:none!important}
.ayan-active-filters>div{min-width:0}
.ayan-active-filters strong{display:block;color:#312e81;font-size:12px;margin-bottom:3px}
.ayan-active-filters span{display:block;color:#64748b;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:900px}
.ayan-table tr[hidden],.pp-table tr[hidden]{display:none!important}
.ayan-invoice-footer-grid{
    display:grid;
    grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr);
    gap:16px;
    align-items:stretch;
    margin-top:18px;
}
.ayan-invoice-footer-grid .ayan-customer-payment-card{margin-top:0;height:100%}
.ayan-summary-side-card{padding:18px;height:100%}
.ayan-summary-side-card h3{margin:0 0 14px;color:#1e293b;font-size:16px}
.ayan-summary-side-card .ayan-invoice-summary{height:calc(100% - 34px)}
.ayan-payment-inline-form{
    display:grid;
    grid-template-columns:minmax(150px,1fr) minmax(150px,1fr) minmax(180px,1.4fr) auto;
    gap:9px;
    align-items:end;
    margin-top:10px;
    padding:12px;
    border:1px solid #dbe3ef;
    border-radius:14px;
    background:#f8fafc;
}
.ayan-payment-inline-form .ayan-field{margin:0}
.ayan-payment-history{margin-top:14px}
@media(max-width:980px){
    .ayan-invoice-footer-grid{grid-template-columns:1fr}
    .ayan-payment-inline-form{grid-template-columns:1fr 1fr}
}
@media(max-width:620px){
    .ayan-active-filters{align-items:stretch;flex-direction:column}
    .ayan-active-filters .ayan-small-btn{width:100%}
    .ayan-payment-inline-form{grid-template-columns:1fr}
}

/* Payment modal for financial report tables */
body.ayan-modal-open{overflow:hidden}
.ayan-payment-trigger{display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap}
.ayan-payment-trigger::before{content:'+';display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:6px;background:rgba(255,255,255,.22);font-weight:900;line-height:1}
.ayan-payment-modal-backdrop{position:fixed;inset:0;z-index:2200;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(15,23,42,.58);backdrop-filter:blur(5px)}
.ayan-payment-modal-backdrop.is-open{display:flex;animation:ayanPaymentFade .16s ease-out}
.ayan-payment-modal{width:min(560px,100%);max-height:calc(100vh - 40px);overflow:auto;background:#fff;border:1px solid rgba(226,232,240,.9);border-radius:26px;box-shadow:0 34px 100px rgba(15,23,42,.32);animation:ayanPaymentRise .2s ease-out}
.ayan-payment-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:22px 24px 18px;border-bottom:1px solid #edf1f6;background:linear-gradient(180deg,#fff,#fbfdff)}
.ayan-payment-modal-head h3{margin:5px 0 0;font-size:20px;color:#172554}
.ayan-payment-modal-kicker{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;background:#eef2ff;color:#4338ca;font-size:11px;font-weight:900}
.ayan-payment-modal-close{width:38px;height:38px;min-width:38px;border:0;border-radius:12px;background:#f1f5f9;color:#475569;font:700 24px/1 inherit;cursor:pointer;transition:.2s}
.ayan-payment-modal-close:hover{background:#fee2e2;color:#991b1b}
.ayan-payment-modal-body{padding:22px 24px}
.ayan-payment-modal-context{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px;padding:13px 15px;border:1px solid #dbeafe;border-radius:16px;background:#f8fbff}
.ayan-payment-modal-context span{color:#475569;font-size:13px;line-height:1.8}
.ayan-payment-modal-context strong{color:#1d4ed8;font-size:13px;white-space:nowrap}
.ayan-payment-modal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.ayan-payment-modal-grid .ayan-field{margin:0}
.ayan-payment-modal-notes{grid-column:1/-1}
.ayan-payment-modal-textarea{min-height:92px;resize:vertical;line-height:1.8}
.ayan-payment-modal-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:0 24px 24px}
.ayan-payment-modal-actions .ayan-btn{min-width:118px}
.ayan-payment-modal-actions [disabled]{opacity:.65;cursor:not-allowed}
@keyframes ayanPaymentFade{from{opacity:0}to{opacity:1}}
@keyframes ayanPaymentRise{from{opacity:0;transform:translateY(16px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:640px){.ayan-payment-modal-backdrop{padding:10px;align-items:flex-end}.ayan-payment-modal{max-height:92vh;border-radius:24px 24px 0 0}.ayan-payment-modal-grid{grid-template-columns:1fr}.ayan-payment-modal-notes{grid-column:auto}.ayan-payment-modal-context{align-items:flex-start;flex-direction:column}.ayan-payment-modal-head,.ayan-payment-modal-body{padding-left:18px;padding-right:18px}.ayan-payment-modal-actions{padding-left:18px;padding-right:18px}.ayan-payment-modal-actions .ayan-btn{flex:1;min-width:0}}


/* Ayan final minimal dashboard and supermarket footer parity */
.ayan-supermarket-payment-footer{align-items:stretch}
.ayan-supermarket-payment-footer>.pp-card{height:100%}
.ayan-supermarket-payment-footer>.pp-card>h3{margin:0 0 16px;color:#1e293b;font-size:17px}
.ayan-minimal-dashboard{position:relative;min-height:calc(100vh - 190px);display:grid;place-items:center;overflow:hidden;border:1px solid rgba(226,232,240,.9);border-radius:30px;background:radial-gradient(circle at 50% 42%,rgba(99,102,241,.09),transparent 34%),linear-gradient(180deg,#ffffff 0%,#f8fafc 100%);box-shadow:0 24px 70px rgba(15,23,42,.06)}
.ayan-minimal-dashboard-glow{position:absolute;width:340px;height:340px;border-radius:50%;background:radial-gradient(circle,rgba(79,70,229,.14),rgba(79,70,229,0) 70%);filter:blur(8px);animation:ayanDashboardPulse 5s ease-in-out infinite}
.ayan-minimal-dashboard-content{position:relative;z-index:1;text-align:center;padding:40px}
.ayan-minimal-dashboard-dot{display:block;width:9px;height:9px;margin:0 auto 22px;border-radius:50%;background:#4f46e5;box-shadow:0 0 0 9px rgba(79,70,229,.08);animation:ayanDashboardDot 2.4s ease-in-out infinite}
.ayan-minimal-dashboard h2{margin:0;color:#111827;font-size:clamp(34px,6vw,72px);font-weight:800;letter-spacing:-2.5px;text-transform:lowercase}
.ayan-minimal-clock{margin-top:20px;color:#475569;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;font-size:clamp(24px,4vw,46px);font-weight:500;letter-spacing:4px;direction:ltr;font-variant-numeric:tabular-nums}
@keyframes ayanDashboardPulse{0%,100%{transform:scale(.92);opacity:.68}50%{transform:scale(1.08);opacity:1}}
@keyframes ayanDashboardDot{0%,100%{transform:scale(.9);opacity:.7}50%{transform:scale(1.15);opacity:1}}
@media(max-width:640px){.ayan-minimal-dashboard{min-height:calc(100vh - 150px);border-radius:22px}.ayan-minimal-dashboard h2{letter-spacing:-1.5px}.ayan-minimal-clock{letter-spacing:2px}}

/* Searchable list boxes */
.ayan-searchable-native{position:absolute!important;opacity:0!important;pointer-events:none!important;width:1px!important;height:1px!important}
.ayan-searchable-select{position:relative;width:100%;min-width:0}
.ayan-searchable-select-input{width:100%;min-height:50px;border:1px solid var(--ayan-border);border-radius:17px;background:#fff;padding:0 42px 0 14px;color:#111827;font:inherit;outline:none}
.ayan-searchable-select-input:focus,.ayan-searchable-select.is-open .ayan-searchable-select-input{border-color:var(--ayan-primary);box-shadow:0 0 0 4px rgba(79,70,229,.12)}
.ayan-searchable-clear{position:absolute;right:12px;top:50%;transform:translateY(-50%);border:0;background:transparent;color:#94a3b8;font-size:20px;cursor:pointer;z-index:3}
.ayan-searchable-menu{position:absolute;z-index:1200;right:0;left:0;top:calc(100% + 6px);max-height:260px;overflow:auto;border:1px solid #dbe3ef;border-radius:15px;background:#fff;box-shadow:0 18px 45px rgba(15,23,42,.16);padding:6px}
.ayan-searchable-option{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;border:0;background:#fff;text-align:right;padding:10px 12px;border-radius:10px;color:#334155;font:inherit;cursor:pointer}
.ayan-searchable-option-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ayan-searchable-option-price{flex:0 0 auto;color:#64748b;font-size:12px;white-space:nowrap;direction:rtl}
.ayan-searchable-option:hover,.ayan-searchable-option.is-selected,.ayan-searchable-option.is-active{background:#eef2ff;color:#3730a3}
.ayan-searchable-option:hover .ayan-searchable-option-price,.ayan-searchable-option.is-selected .ayan-searchable-option-price,.ayan-searchable-option.is-active .ayan-searchable-option-price{color:#3730a3}
.ayan-searchable-empty{padding:14px;text-align:center;color:#94a3b8;font-size:12px}
.pp-field .ayan-searchable-select-input{min-height:48px;border-radius:14px}

/* Stable Laravel pagination */
.ayan-pagination-nav{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;width:100%;direction:rtl}
.ayan-pagination-info{font-size:12px;color:#64748b}
.ayan-pagination-links{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.ayan-page-link{min-width:38px;height:38px;padding:0 11px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #dbe3ef;border-radius:11px;background:#fff;color:#334155;font-size:12px;font-weight:800;line-height:1;text-decoration:none}
.ayan-page-link:hover{border-color:#818cf8;background:#eef2ff;color:#3730a3}
.ayan-page-link.is-active{background:#4f46e5;border-color:#4f46e5;color:#fff}
.ayan-page-link.is-disabled{opacity:.45;cursor:not-allowed}
.ayan-inline-price-form{display:flex;align-items:center;gap:6px;margin-top:8px;min-width:230px}
.ayan-inline-price-form .ayan-money-input-wrap{flex:1;min-width:0}
.ayan-inline-price-form .ayan-input{min-height:38px;padding:0 9px;border-radius:10px;font-size:12px}
.ayan-inline-price-form .ayan-money-input-wrap small{font-size:10px}
.ayan-inline-price-form .ayan-small-btn{white-space:nowrap}
.pp-pagination,.ayan-pagination{padding:16px 20px;overflow:visible!important}
.pp-pagination svg,.ayan-pagination svg{width:16px;height:16px}

/* Supplier delivery portal */
.ayan-card-pad{padding:20px}
.ayan-product-plus{display:grid;grid-template-columns:minmax(180px,1fr) 40px;gap:8px;align-items:center}
.ayan-supplier-delivery-table th:nth-child(1){width:38%}
.ayan-supplier-delivery-table th:last-child{width:76px}
.ayan-modal{position:fixed;inset:0;z-index:2000;display:grid;place-items:center;padding:18px}
.ayan-modal[hidden]{display:none!important}
.ayan-modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.55);backdrop-filter:blur(3px)}
.ayan-modal-dialog{position:relative;width:min(520px,100%);background:#fff;border-radius:22px;box-shadow:0 28px 80px rgba(15,23,42,.3);overflow:hidden}
.ayan-modal-header,.ayan-modal-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;border-bottom:1px solid #edf2f7}
.ayan-modal-header h3{margin:0}.ayan-modal-header button{border:0;background:#f1f5f9;border-radius:10px;width:34px;height:34px;cursor:pointer;font-size:20px}
.ayan-modal-body{padding:20px}.ayan-modal-actions{justify-content:flex-end;border-bottom:0;border-top:1px solid #edf2f7}
@media(max-width:640px){.ayan-pagination-nav{align-items:stretch;flex-direction:column}.ayan-pagination-links{justify-content:center}.ayan-product-plus{grid-template-columns:1fr 40px}}

@media(max-width:720px){
    .ayan-invoice-builder-card,
    .ayan-invoice-builder-card .ayan-table-wrap{
        overflow:visible!important;
    }

    .ayan-invoice-table-pro{
        display:block;
        width:100%;
        min-width:0!important;
    }

    .ayan-invoice-table-pro thead{
        display:none;
    }

    .ayan-invoice-table-pro tbody{
        display:block;
        width:100%;
    }

    .ayan-invoice-table-pro tbody tr[data-pp-proforma-row]{
        display:block;
        width:100%;
        margin:0 0 14px;
        padding:10px 12px;
        border:1px solid #dbe3ef;
        border-radius:14px;
        background:#fff;
        box-shadow:0 8px 22px rgba(15,23,42,.06);
    }

    .ayan-invoice-table-pro tbody tr[data-pp-proforma-row] td{
        display:grid;
        grid-template-columns:7.5rem minmax(0,1fr);
        align-items:center;
        gap:8px;
        width:100%;
        min-width:0;
        padding:9px 0;
        border-bottom:1px solid #eef2f7;
        text-align:right;
        vertical-align:middle;
    }

    .ayan-invoice-table-pro tbody tr[data-pp-proforma-row] td::before{
        content:attr(data-label);
        color:#64748b;
        font-size:11px;
        font-weight:800;
    }

    .ayan-invoice-table-pro tbody tr[data-pp-proforma-row] td:first-child{
        display:block;
        padding-top:2px;
    }

    .ayan-invoice-table-pro tbody tr[data-pp-proforma-row] td:first-child::before{
        display:block;
        margin-bottom:6px;
    }

    .ayan-invoice-table-pro tbody tr[data-pp-proforma-row] td:last-child{
        display:flex;
        justify-content:space-between;
        align-items:center;
        border-bottom:0;
        padding-bottom:2px;
    }

    .ayan-invoice-table-pro tbody tr[data-pp-proforma-row] td:last-child::before{
        margin-left:auto;
    }

    .ayan-invoice-table-pro .ayan-invoice-product-cell,
    .ayan-invoice-table-pro .ayan-searchable-select,
    .ayan-invoice-table-pro .ayan-searchable-select-input,
    .ayan-invoice-table-pro .ayan-money-input-wrap,
    .ayan-invoice-table-pro .ayan-input{
        width:100%;
        min-width:0;
    }

    .ayan-invoice-table-pro .js-pp-proforma-help{
        display:block;
        margin-top:4px;
    }
}

/* Supplier searchable product dropdown overlay hotfix */
.ayan-searchable-menu.is-floating{
    position:fixed!important;
    z-index:10050!important;
    right:auto!important;
    top:auto;
    max-height:260px;
    overscroll-behavior:contain;
    animation:ayanSearchableMenuIn .14s ease-out;
}
.ayan-searchable-menu.is-floating.opens-upward{
    transform-origin:center bottom;
}
[data-supplier-delivery-form] .ayan-searchable-select.is-open{
    z-index:25;
}
[data-supplier-delivery-form] .ayan-searchable-select.is-open .ayan-searchable-select-input{
    background:#fff;
}
@keyframes ayanSearchableMenuIn{
    from{opacity:0;transform:translateY(-4px)}
    to{opacity:1;transform:translateY(0)}
}
@media(max-width:640px){
    .ayan-searchable-menu.is-floating{
        min-width:220px;
        max-width:calc(100vw - 16px);
    }
}

/* AYAN_DASHBOARD_LOGO_IMAGE_V1_START */
.ayan-brand-dashboard{
    min-height:calc(100vh - 190px);
    display:grid;
    place-items:center;
    padding:24px;
    overflow:hidden;
    border-radius:30px;
    background:#061a42;
    box-shadow:0 24px 70px rgba(15,23,42,.13);
}
.ayan-brand-dashboard-media{
    position:relative;
    width:min(100%,860px);
    display:flex;
    align-items:center;
    justify-content:center;
}
.ayan-brand-dashboard-image{
    display:block;
    width:100%;
    height:auto;
    max-height:calc(100vh - 238px);
    object-fit:contain;
    border-radius:24px;
}
.ayan-brand-dashboard-clock{
    position:absolute;
    right:50%;
    bottom:26px;
    transform:translateX(50%);
    min-width:164px;
    padding:9px 17px;
    border:1px solid rgba(255,255,255,.16);
    border-radius:999px;
    background:rgba(2,13,38,.62);
    color:#fff;
    box-shadow:0 10px 28px rgba(0,0,0,.22);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
    font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
    font-size:clamp(18px,2.2vw,27px);
    font-weight:600;
    letter-spacing:3px;
    line-height:1.35;
    text-align:center;
    direction:ltr;
    font-variant-numeric:tabular-nums;
}
@media(max-width:640px){
    .ayan-brand-dashboard{
        min-height:calc(100vh - 150px);
        padding:10px;
        border-radius:22px;
    }
    .ayan-brand-dashboard-image{
        max-height:calc(100vh - 180px);
        border-radius:17px;
    }
    .ayan-brand-dashboard-clock{
        bottom:15px;
        min-width:138px;
        padding:7px 13px;
        font-size:17px;
        letter-spacing:2px;
    }
}
/* AYAN_DASHBOARD_LOGO_IMAGE_V1_END */

/* Supermarket database-backed lookup menus */
.ayan-remote-lookup-input.is-lookup-open{
    border-color:var(--ayan-primary);
    box-shadow:0 0 0 4px rgba(79,70,229,.12);
}
.ayan-remote-lookup-menu{
    position:fixed;
    z-index:100000;
    overflow:auto;
    padding:7px;
    border:1px solid rgba(148,163,184,.34);
    border-radius:16px;
    background:#fff;
    box-shadow:0 22px 55px rgba(15,23,42,.2);
    direction:rtl;
    overscroll-behavior:contain;
}
.ayan-remote-lookup-menu[hidden]{display:none!important}
.ayan-remote-lookup-option{
    width:100%;
    border:0;
    border-radius:12px;
    background:transparent;
    padding:10px 11px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    text-align:right;
    color:#172033;
    font:inherit;
    cursor:pointer;
}
.ayan-remote-lookup-option:hover,
.ayan-remote-lookup-option.is-active{
    background:#eef2ff;
    color:#312e81;
}
.ayan-remote-lookup-copy{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:3px;
}
.ayan-remote-lookup-copy strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:13px;
    font-weight:800;
}
.ayan-remote-lookup-copy small{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:#64748b;
    font-size:11px;
}
.ayan-remote-lookup-price{
    flex:0 0 auto;
    color:#4338ca;
    font-size:11px;
    font-weight:800;
    white-space:nowrap;
}
.ayan-remote-lookup-state{
    padding:14px 12px;
    color:#64748b;
    text-align:center;
    font-size:12px;
}
.ayan-remote-lookup-state.is-error{color:#b91c1c}
@media(max-width:640px){
    .ayan-remote-lookup-menu{
        max-width:calc(100vw - 16px);
        border-radius:14px;
    }
    .ayan-remote-lookup-option{padding:11px 9px}
    .ayan-remote-lookup-price{font-size:10px}
}


/* settlement by selected table rows */
.ayan-bulk-toolbar-actions{align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.ayan-bulk-selected-count{font-size:13px;font-weight:700;color:#64748b}
.ayan-bulk-action-buttons{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.ayan-inline-form{display:inline-flex;margin:0}
@media(max-width:640px){.ayan-bulk-toolbar-actions{align-items:stretch}.ayan-bulk-selected-count{width:100%;text-align:center}.ayan-bulk-action-buttons{width:100%;display:grid;grid-template-columns:1fr}.ayan-bulk-action-buttons .ayan-btn{width:100%;justify-content:center}}


/* AYAN_SUPPLIER_DELIVERY_MOBILE_CARDS_V1_START */
@media (max-width: 700px) {
    .ayan-supplier-delivery-page-head {
        gap: 14px;
    }

    .ayan-supplier-delivery-page-head > .ayan-btn {
        width: 100%;
    }

    .ayan-supplier-delivery-meta,
    .ayan-supplier-delivery-card {
        border-radius: 20px;
    }

    .ayan-supplier-delivery-card .ayan-card-header {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
        padding: 17px 16px;
    }

    .ayan-supplier-delivery-card .ayan-card-header .ayan-btn {
        width: 100%;
    }

    .ayan-supplier-delivery-card .ayan-table-wrap {
        overflow: visible;
        padding: 0 12px 14px;
    }

    .ayan-supplier-delivery-table,
    .ayan-supplier-delivery-table tbody,
    .ayan-supplier-delivery-table tr,
    .ayan-supplier-delivery-table td {
        display: block;
        width: 100%;
    }

    .ayan-supplier-delivery-table {
        min-width: 0 !important;
        border-collapse: separate;
    }

    .ayan-supplier-delivery-table thead {
        display: none;
    }

    .ayan-supplier-delivery-table tbody {
        display: grid;
        gap: 14px;
    }

    .ayan-supplier-delivery-table tr[data-supplier-row] {
        padding: 14px;
        border: 1px solid #dfe6f0;
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 9px 24px rgba(15, 23, 42, .055);
    }

    .ayan-supplier-delivery-table tr[data-supplier-row]:hover td {
        background: transparent;
    }

    .ayan-supplier-delivery-table td {
        padding: 0 0 13px;
        border: 0;
    }

    .ayan-supplier-delivery-table td:last-child {
        padding-bottom: 0;
    }

    .ayan-supplier-delivery-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 7px;
        color: #475569;
        font-size: 12px;
        font-weight: 900;
    }

    .ayan-supplier-delivery-table .ayan-input,
    .ayan-supplier-delivery-table .ayan-select,
    .ayan-supplier-delivery-table .ayan-searchable-select,
    .ayan-supplier-delivery-table .ayan-searchable-select-input {
        width: 100%;
        min-width: 0 !important;
    }

    .ayan-supplier-delivery-table .ayan-product-plus {
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    .ayan-supplier-delivery-table .ayan-product-plus > .ayan-small-btn {
        width: 44px;
        min-height: 50px;
        font-size: 20px;
    }

    .ayan-supplier-row-actions .ayan-small-btn {
        width: 100%;
        min-height: 42px;
    }

    .ayan-supplier-delivery-card .ayan-invoice-summary {
        padding: 14px 12px;
    }

    .ayan-supplier-delivery-card .ayan-invoice-summary > div {
        width: 100%;
        min-width: 0;
    }

    [data-supplier-delivery-form] > .ayan-card-pad:last-of-type {
        padding: 16px;
    }

    [data-supplier-delivery-form] .ayan-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    [data-supplier-delivery-form] .ayan-form-actions .ayan-btn {
        width: 100%;
    }

    [data-quick-product-modal] {
        align-items: end;
        padding: 10px;
    }

    [data-quick-product-modal] .ayan-modal-dialog {
        width: 100%;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        border-radius: 22px 22px 14px 14px;
    }

    [data-quick-product-modal] .ayan-modal-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    [data-quick-product-modal] .ayan-modal-actions .ayan-btn {
        width: 100%;
    }
}
/* AYAN_SUPPLIER_DELIVERY_MOBILE_CARDS_V1_END */

/* Equipment invoice/proforma rows: use a true single-column mobile layout. */
@media (max-width: 900px) {
    .ayan-invoice-builder-card,
    .ayan-invoice-builder-card.ayan-table-card,
    .ayan-invoice-builder-card .ayan-table-wrap {
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .ayan-invoice-builder-card table.ayan-invoice-table-pro,
    .ayan-invoice-builder-card table.ayan-invoice-table-pro tbody,
    .ayan-invoice-builder-card table.ayan-invoice-table-pro tr[data-pp-proforma-row],
    .ayan-invoice-builder-card table.ayan-invoice-table-pro td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .ayan-invoice-builder-card table.ayan-invoice-table-pro {
        border-spacing: 0 !important;
        table-layout: auto !important;
    }

    .ayan-invoice-builder-card table.ayan-invoice-table-pro thead {
        display: none !important;
    }

    .ayan-invoice-builder-card table.ayan-invoice-table-pro tr[data-pp-proforma-row] {
        overflow: visible !important;
        margin: 0 0 14px !important;
        padding: 10px 12px !important;
        border: 1px solid #dbe3ef !important;
        border-radius: 14px !important;
        background: #fff !important;
        box-shadow: 0 8px 22px rgba(15, 23, 42, .06) !important;
    }

    .ayan-invoice-builder-card table.ayan-invoice-table-pro tr[data-pp-proforma-row] td {
        display: grid !important;
        grid-template-columns: 7.5rem minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 9px 0 !important;
        border-bottom: 1px solid #eef2f7 !important;
        text-align: right !important;
        vertical-align: middle !important;
    }

    .ayan-invoice-builder-card table.ayan-invoice-table-pro tr[data-pp-proforma-row] td::before {
        content: attr(data-label) !important;
        color: #64748b !important;
        font-size: 11px !important;
        font-weight: 800 !important;
    }

    .ayan-invoice-builder-card table.ayan-invoice-table-pro tr[data-pp-proforma-row] td:first-child {
        display: block !important;
        padding-top: 2px !important;
    }

    .ayan-invoice-builder-card table.ayan-invoice-table-pro tr[data-pp-proforma-row] td:first-child::before {
        display: block !important;
        margin-bottom: 6px !important;
    }

    .ayan-invoice-builder-card table.ayan-invoice-table-pro tr[data-pp-proforma-row] td:last-child {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-bottom: 0 !important;
        padding-bottom: 2px !important;
    }

    .ayan-invoice-builder-card table.ayan-invoice-table-pro .ayan-invoice-product-cell,
    .ayan-invoice-builder-card table.ayan-invoice-table-pro .ayan-searchable-select,
    .ayan-invoice-builder-card table.ayan-invoice-table-pro .ayan-searchable-select-input,
    .ayan-invoice-builder-card table.ayan-invoice-table-pro .ayan-money-input-wrap,
    .ayan-invoice-builder-card table.ayan-invoice-table-pro .ayan-input {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .ayan-invoice-builder-card table.ayan-invoice-table-pro .js-pp-proforma-help {
        display: block !important;
        margin-top: 4px !important;
    }

    .ayan-invoice-builder-card .ayan-searchable-menu.is-floating {
        min-width: 0 !important;
        max-width: calc(100vw - 16px) !important;
    }
}
