html {
    background: #f1f5f9;
}

body {
    font-family: Vazirmatn, ui-sans-serif, system-ui, sans-serif;
}

.erp-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(148, 163, 184, 0.18), transparent 28rem),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    color: #0f172a;
}

.erp-top-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(10px);
}

.erp-nav-inner,
.erp-top-nav > div:first-child {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 80rem;
    min-height: 3.5rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.erp-top-nav a,
.erp-top-nav button {
    text-decoration: none;
}

.erp-top-nav .bg-teal-600 {
    background: #334155 !important;
}

.erp-top-nav .text-teal-700 {
    color: #334155 !important;
}

.erp-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    padding: 0.375rem 0.5rem;
    color: #0f172a;
    font-size: 0.875rem;
    font-weight: 800;
}

.erp-brand:hover {
    background: #f1f5f9;
}

.erp-brand-mark {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: #334155;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
}

.erp-nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    overflow-x: auto;
    border: 0;
    border-radius: 0.65rem;
    background: #f1f5f9;
    padding: 0.25rem;
}

.erp-nav-link {
    flex: 0 0 auto;
    border-radius: 0.375rem;
    padding: 0.45rem 0.75rem;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
}

.erp-nav-link:hover,
.erp-nav-link.is-active {
    background: #fff;
    color: #111827;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.erp-nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.erp-user-link,
.erp-logout {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #fff;
    padding: 0.4rem 0.7rem;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
}

.erp-user-link:hover,
.erp-logout:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #111827;
}

@media (max-width: 900px) {
    .erp-nav-inner {
        align-items: stretch;
        flex-wrap: wrap;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .erp-nav-menu {
        order: 3;
        flex-basis: 100%;
        justify-content: flex-start;
    }

    .erp-nav-user {
        margin-inline-start: auto;
    }
}

.erp-shell main,
body.erp-shell > main {
    max-width: 80rem;
    margin: 0 auto;
    padding: 1rem;
}

.erp-shell .overflow-x-auto {
    border-radius: 0.85rem;
    padding: 0.25rem;
    scrollbar-color: #cbd5e1 transparent;
}

.erp-shell .overflow-x-auto::-webkit-scrollbar {
    height: 0.5rem;
}

.erp-shell .overflow-x-auto::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cbd5e1;
}

.erp-shell header h2,
.erp-shell main h2 {
    font-size: 1rem !important;
    line-height: 1.5rem !important;
    letter-spacing: 0;
}

.erp-shell .py-12 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.erp-shell .bg-white.rounded-lg,
.erp-shell .bg-white.overflow-hidden,
.erp-shell form.bg-white,
.erp-shell .shadow-md,
.erp-shell .shadow-sm {
    border: 0 !important;
    border-radius: 0.85rem !important;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

.erp-shell .p-6 {
    padding: 1rem !important;
}

.erp-shell .mb-6 {
    margin-bottom: 1rem !important;
}

.erp-shell table {
    min-width: 780px;
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 0.5rem;
    border: 0 !important;
    border-radius: 0;
    background: transparent;
    font-size: 0.8125rem;
}

.erp-shell thead,
.erp-shell .bg-gray-200 {
    background: transparent !important;
}

.erp-shell th {
    border: 0 !important;
    padding: 0.35rem 0.75rem !important;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: right;
}

.erp-shell td {
    border: 0 !important;
    padding: 0.625rem 0.75rem !important;
    color: #334155;
    vertical-align: top;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.erp-shell tbody tr td:first-child {
    border-top-right-radius: 0.65rem;
    border-bottom-right-radius: 0.65rem;
}

.erp-shell tbody tr td:last-child {
    border-top-left-radius: 0.65rem;
    border-bottom-left-radius: 0.65rem;
}

.erp-shell tbody tr:hover {
    background: transparent !important;
}

.erp-shell tbody tr:hover td {
    background: #f8fafc !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.erp-shell input,
.erp-shell select,
.erp-shell textarea {
    border-color: #cbd5e1 !important;
    border-radius: 0.5rem !important;
    font-size: 0.875rem !important;
}

.erp-shell input:focus,
.erp-shell select:focus,
.erp-shell textarea:focus {
    border-color: #94a3b8 !important;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18) !important;
}

.erp-shell a[class*="bg-blue"],
.erp-shell button[class*="bg-blue"],
.erp-shell .bg-blue-500,
.erp-shell .bg-blue-600 {
    background-color: #475569 !important;
    color: #fff !important;
}

.erp-shell a[class*="bg-blue"]:hover,
.erp-shell button[class*="bg-blue"]:hover {
    background-color: #334155 !important;
}

.erp-shell a[class*="bg-yellow"],
.erp-shell button[class*="bg-yellow"] {
    background-color: #e2e8f0 !important;
    color: #334155 !important;
}

.erp-shell a[class*="bg-purple"],
.erp-shell button[class*="bg-purple"] {
    background-color: #cbd5e1 !important;
    color: #1f2937 !important;
}

.erp-shell a[class*="bg-red"],
.erp-shell button[class*="bg-red"] {
    background-color: #f1f5f9 !important;
    color: #b91c1c !important;
}

.erp-shell a[class*="bg-green"],
.erp-shell button[class*="bg-green"],
.erp-shell a[class*="bg-orange"],
.erp-shell button[class*="bg-orange"],
.erp-shell a[class*="bg-gray"],
.erp-shell button[class*="bg-gray"] {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
}

.erp-shell a[class*="bg-yellow"]:hover,
.erp-shell button[class*="bg-yellow"]:hover,
.erp-shell a[class*="bg-purple"]:hover,
.erp-shell button[class*="bg-purple"]:hover,
.erp-shell a[class*="bg-green"]:hover,
.erp-shell button[class*="bg-green"]:hover,
.erp-shell a[class*="bg-orange"]:hover,
.erp-shell button[class*="bg-orange"]:hover,
.erp-shell a[class*="bg-gray"]:hover,
.erp-shell button[class*="bg-gray"]:hover,
.erp-shell a[class*="bg-red"]:hover,
.erp-shell button[class*="bg-red"]:hover {
    background-color: #e2e8f0 !important;
}

.erp-shell a[class*="bg-"],
.erp-shell button[class*="bg-"] {
    border: 0 !important;
    border-radius: 0.5rem !important;
    padding: 0.45rem 0.8rem !important;
    font-size: 0.75rem !important;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.erp-shell a[class*="bg-"]:hover,
.erp-shell button[class*="bg-"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.10);
}

.erp-shell .text-2xl {
    font-size: 1.125rem !important;
    line-height: 1.75rem !important;
}

.erp-shell .text-lg {
    font-size: 0.95rem !important;
}

.erp-shell .gap-4 {
    gap: 0.75rem !important;
}

.erp-shell .bg-blue-50,
.erp-shell .bg-green-50,
.erp-shell .bg-red-50,
.erp-shell .bg-purple-50,
.erp-shell .bg-orange-50,
.erp-shell .bg-yellow-50,
.erp-shell .bg-gray-50,
.erp-shell .bg-slate-50 {
    border: 0 !important;
    border-radius: 0.85rem !important;
    background-color: rgba(255, 255, 255, 0.72) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.065);
}

.erp-shell nav[role="navigation"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.78);
    padding: 0.75rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.erp-shell nav[role="navigation"] a,
.erp-shell nav[role="navigation"] span {
    border: 0 !important;
    border-radius: 0.5rem !important;
}

.erp-shell nav[role="navigation"] a {
    color: #334155 !important;
}

.erp-shell nav[role="navigation"] a:hover {
    background: #e2e8f0 !important;
}

.erp-shell table.erp-compact-table {
    font-size: 0.75rem;
    border-spacing: 0 0.35rem;
}

.erp-shell table.erp-compact-table th {
    padding: 0.25rem 0.5rem !important;
}

.erp-shell table.erp-compact-table td {
    padding: 0.35rem 0.5rem !important;
}

.erp-shell table.erp-compact-table a[class*="bg-"],
.erp-shell table.erp-compact-table button[class*="bg-"] {
    min-height: 1.75rem;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.7rem !important;
}

.erp-shell .erp-filter-panel {
    margin-bottom: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.86);
    padding: 0.8rem;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
}

.erp-shell .erp-filter-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 0.65rem;
}

.erp-shell .erp-filter-row + .erp-filter-row {
    margin-top: 0.65rem;
}

.erp-shell .erp-filter-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.erp-shell .erp-filter-row-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.erp-shell .erp-filter-field {
    display: grid;
    gap: 0.3rem;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
}

.erp-shell .erp-filter-field input,
.erp-shell .erp-filter-field select {
    min-height: 2.15rem;
    width: 100%;
    background: #fff;
    padding: 0.4rem 0.65rem;
    color: #0f172a;
    font-size: 0.78rem !important;
}

.erp-shell .erp-filter-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 0.5rem;
    min-width: 0;
}

.erp-shell .erp-filter-actions-full {
    grid-column: 1 / -1;
}

.erp-shell .erp-filter-submit,
.erp-shell .erp-filter-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    border-radius: 0.55rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.erp-shell .erp-filter-submit {
    border: 1px solid #334155;
    background: #334155;
    color: #fff;
    box-shadow: 0 10px 20px rgba(51, 65, 85, 0.18);
}

.erp-shell .erp-filter-reset {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
}

.erp-shell .erp-filter-submit:hover,
.erp-shell .erp-filter-reset:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.11);
}

.erp-shell .erp-filter-submit:hover {
    background: #1f2937;
}

.erp-shell .erp-filter-reset:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #1f2937;
}

.erp-shell .erp-filter-error {
    margin-bottom: 0.75rem;
    border-radius: 0.65rem;
    background: #fef2f2;
    padding: 0.55rem 0.75rem;
    color: #b91c1c;
    font-size: 0.75rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden;
    }

    .erp-shell main,
    body.erp-shell > main {
        width: 100%;
        max-width: 100%;
        padding: 0.625rem;
    }

    .erp-shell header > div {
        padding: 0.75rem !important;
    }

    .erp-shell .bg-white.rounded-lg,
    .erp-shell .bg-white.overflow-hidden,
    .erp-shell form.bg-white,
    .erp-shell .shadow-md,
    .erp-shell .shadow-sm {
        border-radius: 0.75rem !important;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07) !important;
    }

    .erp-shell .flex.justify-between.items-center {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .erp-shell .flex.gap-2,
    .erp-shell .flex.gap-4,
    .erp-shell .flex.flex-wrap {
        flex-wrap: wrap;
    }

    .erp-shell a[class*="bg-"],
    .erp-shell button[class*="bg-"] {
        min-height: 2.25rem;
        max-width: 100%;
        white-space: normal;
    }

    .erp-shell .overflow-x-auto {
        overflow-x: visible;
        padding: 0;
    }

    .erp-shell table {
        min-width: 0;
        width: 100% !important;
        border-spacing: 0;
        font-size: 0.8125rem;
    }

    .erp-shell table thead {
        display: none;
    }

    .erp-shell table,
    .erp-shell table tbody,
    .erp-shell table tr,
    .erp-shell table td {
        display: block;
        width: 100%;
    }

    .erp-shell table tbody {
        display: grid;
        gap: 0.75rem;
    }

    .erp-shell table tbody tr {
        overflow: hidden;
        border-radius: 0.9rem;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
    }

    .erp-shell table tbody tr td,
    .erp-shell table tbody tr td:first-child,
    .erp-shell table tbody tr td:last-child {
        display: grid;
        grid-template-columns: minmax(5rem, 34%) minmax(0, 1fr);
        align-items: center;
        gap: 0.75rem;
        min-height: 2.65rem;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border-bottom: 1px solid #eef2f7 !important;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .erp-shell table tbody tr td:last-child {
        border-bottom: 0 !important;
    }

    .erp-shell table tbody tr td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 0.75rem;
        font-weight: 800;
        text-align: right;
    }

    .erp-shell table tbody tr td > .flex {
        justify-content: flex-start;
        flex-wrap: wrap;
        width: 100%;
    }

    .erp-shell table tbody tr td select,
    .erp-shell table tbody tr td input {
        min-width: 0;
        width: 100%;
    }

    .erp-shell table tbody tr:hover td {
        background: transparent !important;
        box-shadow: none !important;
    }

    .erp-shell td,
    .erp-shell th {
        padding: 0.55rem 0.65rem !important;
    }

    .erp-shell nav[role="navigation"] {
        align-items: stretch;
        flex-direction: column;
    }

    .erp-shell .erp-filter-row,
    .erp-shell .erp-filter-row-3,
    .erp-shell .erp-filter-row-5 {
        grid-template-columns: 1fr;
    }

    .erp-shell .erp-filter-actions {
        align-items: stretch;
        justify-content: stretch;
    }

    .erp-shell .erp-filter-submit,
    .erp-shell .erp-filter-reset {
        flex: 1;
        min-height: 2.3rem;
    }
}

@media (max-width: 520px) {
    .erp-nav-inner {
        gap: 0.5rem;
    }

    .erp-brand {
        max-width: 100%;
        justify-content: flex-start;
    }

    .erp-nav-user {
        width: 100%;
        justify-content: space-between;
        margin-inline-start: 0;
    }

    .erp-user-link,
    .erp-logout {
        flex: 1;
        text-align: center;
    }

    .erp-nav-link {
        padding: 0.5rem 0.7rem;
        font-size: 0.75rem;
    }

    .erp-shell main,
    body.erp-shell > main {
        padding: 0.55rem;
    }

    .erp-shell .p-6 {
        padding: 0.75rem !important;
    }

    .erp-shell table tbody tr td,
    .erp-shell table tbody tr td:first-child,
    .erp-shell table tbody tr td:last-child {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .erp-shell table tbody tr td::before {
        font-size: 0.7rem;
    }
}
