@import url("https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap");

:root {
    color-scheme: light;
    --nexa-primary: #b88a16;
    --nexa-primary-hover: #9d7410;
    --nexa-primary-soft: #fff8df;
    --nexa-primary-border: #ead48d;
    --nexa-success: #16834a;
    --nexa-success-hover: #10683a;
    --nexa-success-soft: #eaf8f0;
    --nexa-danger: #cf3434;
    --nexa-danger-hover: #ac2525;
    --nexa-danger-soft: #fff0f0;
    --nexa-warning: #d98b08;
    --nexa-warning-soft: #fff7e7;
    --nexa-info: #2877c7;
    --nexa-info-soft: #eef6ff;
    --nexa-bg: #f4f6f9;
    --nexa-bg-secondary: #eef1f5;
    --nexa-surface: #ffffff;
    --nexa-surface-secondary: #fafbfc;
    --nexa-surface-hover: #f7f8fa;
    --nexa-text: #20242b;
    --nexa-text-secondary: #59616d;
    --nexa-text-muted: #858d98;
    --nexa-text-inverse: #ffffff;
    --nexa-border: #e2e6eb;
    --nexa-border-strong: #cfd5dc;
    --nexa-sidebar-bg: #171a20;
    --nexa-sidebar-surface: #22262e;
    --nexa-sidebar-text: #d9dde4;
    --nexa-sidebar-muted: #9098a4;
    --nexa-sidebar-active: #c49a2c;
    --nexa-header-bg: rgba(255, 255, 255, 0.94);
    --nexa-overlay: rgba(18, 22, 29, 0.52);
    --nexa-shadow-xs: 0 1px 2px rgba(25, 31, 39, 0.04);
    --nexa-shadow-sm: 0 4px 12px rgba(25, 31, 39, 0.06);
    --nexa-shadow-md: 0 10px 30px rgba(25, 31, 39, 0.08);
    --nexa-shadow-lg: 0 18px 50px rgba(25, 31, 39, 0.12);
    --nexa-radius-xs: 6px;
    --nexa-radius-sm: 10px;
    --nexa-radius-md: 14px;
    --nexa-radius-lg: 18px;
    --nexa-radius-xl: 24px;
    --nexa-radius-round: 999px;
    --nexa-space-1: 4px;
    --nexa-space-2: 8px;
    --nexa-space-3: 12px;
    --nexa-space-4: 16px;
    --nexa-space-5: 20px;
    --nexa-space-6: 24px;
    --nexa-space-7: 28px;
    --nexa-space-8: 32px;
    --nexa-space-10: 40px;
    --nexa-space-12: 48px;
    --nexa-font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
    --nexa-font-xs: 0.72rem;
    --nexa-font-sm: 0.82rem;
    --nexa-font-md: 0.92rem;
    --nexa-font-lg: 1.05rem;
    --nexa-font-xl: 1.25rem;
    --nexa-font-2xl: 1.55rem;
    --nexa-font-3xl: 1.9rem;
    --nexa-transition-fast: 140ms ease;
    --nexa-transition-normal: 220ms ease;
    --nexa-transition-slow: 340ms ease;
    --nexa-header-height: 74px;
    --nexa-sidebar-width: 258px;
    --nexa-sidebar-collapsed-width: 78px;
    --nexa-content-max-width: 1800px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    direction: rtl;
    font-family: var(--nexa-font-family);
    background: var(--nexa-bg);
    color: var(--nexa-text);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 95% 0%, rgba(196, 154, 44, 0.08), transparent 26rem),
        linear-gradient(180deg, #f8f9fb 0%, var(--nexa-bg) 100%);
    color: var(--nexa-text);
    font-family: var(--nexa-font-family);
    font-size: var(--nexa-font-md);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a,
[role="button"] {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--nexa-text);
    font-weight: 700;
    line-height: 1.5;
}

h1 {
    font-size: var(--nexa-font-3xl);
}

h2 {
    font-size: var(--nexa-font-2xl);
}

h3 {
    font-size: var(--nexa-font-xl);
}

h4 {
    font-size: var(--nexa-font-lg);
}

p {
    color: var(--nexa-text-secondary);
}

::selection {
    color: #2d2206;
    background: #f3dc91;
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    /*background: #eef1f4;*/
}

::-webkit-scrollbar-thumb {
    background: #c2c8d0;
    border: 2px solid #eef1f4;
    border-radius: var(--nexa-radius-round);
}

::-webkit-scrollbar-thumb:hover {
    background: #aeb5bf;
}

.nexa-page {
    width: 100%;
    max-width: var(--nexa-content-max-width);
    margin: 0 auto;
}

.nexa-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--nexa-space-4);
    margin-bottom: var(--nexa-space-6);
}

.nexa-page-title {
    margin: 0;
    font-size: var(--nexa-font-2xl);
    font-weight: 800;
    letter-spacing: -0.025em;
}

.nexa-page-subtitle {
    margin: var(--nexa-space-1) 0 0;
    color: var(--nexa-text-muted);
    font-size: var(--nexa-font-sm);
}

.nexa-card {
    position: relative;
    overflow: hidden;
    background: var(--nexa-surface);
    border: 1px solid var(--nexa-border);
    border-radius: var(--nexa-radius-lg);
    box-shadow: var(--nexa-shadow-sm);
    transition:
        box-shadow var(--nexa-transition-normal),
        transform var(--nexa-transition-normal),
        border-color var(--nexa-transition-normal);
}

.nexa-card:hover {
    border-color: #d6dbe2;
    box-shadow: var(--nexa-shadow-md);
}

.nexa-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--nexa-space-3);
    min-height: 62px;
    padding: var(--nexa-space-4) var(--nexa-space-5);
    border-bottom: 1px solid var(--nexa-border);
}

.nexa-card-title {
    margin: 0;
    font-size: var(--nexa-font-lg);
    font-weight: 700;
}

.nexa-card-subtitle {
    color: var(--nexa-text-muted);
    font-size: var(--nexa-font-xs);
}

.nexa-card-body {
    padding: var(--nexa-space-5);
}

.nexa-card-footer {
    padding: var(--nexa-space-4) var(--nexa-space-5);
    background: var(--nexa-surface-secondary);
    border-top: 1px solid var(--nexa-border);
}

.nexa-panel {
    padding: var(--nexa-space-5);
    background: var(--nexa-surface);
    border: 1px solid var(--nexa-border);
    border-radius: var(--nexa-radius-lg);
    box-shadow: var(--nexa-shadow-sm);
}

.nexa-grid {
    display: grid;
    gap: var(--nexa-space-4);
}

.nexa-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nexa-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nexa-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.nexa-stack {
    display: flex;
    flex-direction: column;
    gap: var(--nexa-space-4);
}

.nexa-inline {
    display: flex;
    align-items: center;
    gap: var(--nexa-space-3);
}

.nexa-section {
    margin-bottom: var(--nexa-space-6);
}

.nexa-section:last-child {
    margin-bottom: 0;
}

.nexa-divider {
    height: 1px;
    margin: var(--nexa-space-4) 0;
    background: var(--nexa-border);
}

.nexa-muted {
    color: var(--nexa-text-muted);
}

.nexa-positive {
    color: var(--nexa-success);
}

.nexa-negative {
    color: var(--nexa-danger);
}

.nexa-warning {
    color: var(--nexa-warning);
}

.nexa-number {
    direction: ltr;
    display: inline-block;
    font-variant-numeric: tabular-nums;
    unicode-bidi: isolate;
}

.nexa-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--nexa-space-1);
    min-height: 25px;
    padding: 2px 9px;
    border-radius: var(--nexa-radius-round);
    font-size: var(--nexa-font-xs);
    font-weight: 700;
    white-space: nowrap;
}

.nexa-badge-primary {
    color: #72550a;
    background: var(--nexa-primary-soft);
    border: 1px solid var(--nexa-primary-border);
}

.nexa-badge-success {
    color: #0c6837;
    background: var(--nexa-success-soft);
    border: 1px solid #b9e5cb;
}

.nexa-badge-danger {
    color: #a02323;
    background: var(--nexa-danger-soft);
    border: 1px solid #f0c3c3;
}

.nexa-badge-warning {
    color: #985c00;
    background: var(--nexa-warning-soft);
    border: 1px solid #f2d393;
}

.nexa-badge-info {
    color: #1e5f9e;
    background: var(--nexa-info-soft);
    border: 1px solid #c3dcf6;
}

.nexa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--nexa-space-2);
    min-height: 40px;
    padding: 8px 16px;
    color: var(--nexa-text);
    background: var(--nexa-surface);
    border: 1px solid var(--nexa-border-strong);
    border-radius: var(--nexa-radius-sm);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition:
        color var(--nexa-transition-fast),
        background-color var(--nexa-transition-fast),
        border-color var(--nexa-transition-fast),
        box-shadow var(--nexa-transition-fast),
        transform var(--nexa-transition-fast);
}

.nexa-btn:hover:not(:disabled) {
    background: var(--nexa-surface-hover);
    box-shadow: var(--nexa-shadow-xs);
    transform: translateY(-1px);
}

.nexa-btn:active:not(:disabled) {
    transform: translateY(0);
}

.nexa-btn:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.nexa-btn-primary {
    color: #fff;
    background: var(--nexa-primary);
    border-color: var(--nexa-primary);
}

.nexa-btn-primary:hover:not(:disabled) {
    color: #fff;
    background: var(--nexa-primary-hover);
    border-color: var(--nexa-primary-hover);
}

.nexa-btn-success {
    color: #fff;
    background: var(--nexa-success);
    border-color: var(--nexa-success);
}

.nexa-btn-success:hover:not(:disabled) {
    color: #fff;
    background: var(--nexa-success-hover);
    border-color: var(--nexa-success-hover);
}

.nexa-btn-danger {
    color: #fff;
    background: var(--nexa-danger);
    border-color: var(--nexa-danger);
}

.nexa-btn-danger:hover:not(:disabled) {
    color: #fff;
    background: var(--nexa-danger-hover);
    border-color: var(--nexa-danger-hover);
}

.nexa-btn-ghost {
    color: var(--nexa-text-secondary);
    background: transparent;
    border-color: transparent;
}

.nexa-btn-ghost:hover:not(:disabled) {
    color: var(--nexa-text);
    background: var(--nexa-bg-secondary);
}

.nexa-icon-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--nexa-radius-round);
}

.nexa-input-label {
    display: block;
    margin-bottom: var(--nexa-space-2);
    color: var(--nexa-text-secondary);
    font-size: var(--nexa-font-sm);
    font-weight: 600;
}

.nexa-form-hint {
    margin-top: var(--nexa-space-1);
    color: var(--nexa-text-muted);
    font-size: var(--nexa-font-xs);
}

.nexa-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 210px;
    padding: var(--nexa-space-8);
    text-align: center;
}

.nexa-empty-state-icon {
    margin-bottom: var(--nexa-space-3);
    color: #b7bdc6;
    font-size: 2.6rem;
}

.nexa-empty-state-title {
    margin-bottom: var(--nexa-space-1);
    font-size: var(--nexa-font-lg);
    font-weight: 700;
}

.nexa-empty-state-text {
    max-width: 480px;
    margin: 0;
    color: var(--nexa-text-muted);
    font-size: var(--nexa-font-sm);
}

.nexa-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--nexa-space-3);
    min-height: 160px;
    color: var(--nexa-text-muted);
}

.nexa-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid #e5e8ed;
    border-top-color: var(--nexa-primary);
    border-radius: 50%;
    animation: nexa-spin 0.8s linear infinite;
}

@keyframes nexa-spin {
    to {
        transform: rotate(360deg);
    }
}

.dxbl-btn {
    font-family: var(--nexa-font-family) !important;
    border-radius: var(--nexa-radius-sm) !important;
}

.dxbl-text-edit,
.dxbl-combobox,
.dxbl-date-edit {
    font-family: var(--nexa-font-family) !important;
    border-radius: var(--nexa-radius-sm) !important;
}

.dxbl-grid {
    font-family: var(--nexa-font-family) !important;
    background: var(--nexa-surface) !important;
    border: 1px solid var(--nexa-border) !important;
    border-radius: var(--nexa-radius-md) !important;
    overflow: hidden;
}

.dxbl-grid .dxbl-grid-header-row {
    background: #f7f8fa !important;
}

.dxbl-grid .dxbl-grid-header-row > td,
.dxbl-grid .dxbl-grid-header-row > th {
    color: var(--nexa-text-secondary) !important;
    font-weight: 700 !important;
    border-color: var(--nexa-border) !important;
}

.dxbl-grid .dxbl-grid-data-row:hover {
    background: #fbfaf6 !important;
}

.dxbl-tabs {
    font-family: var(--nexa-font-family) !important;
}

.dxbl-popup {
    font-family: var(--nexa-font-family) !important;
    border-radius: var(--nexa-radius-lg) !important;
    box-shadow: var(--nexa-shadow-lg) !important;
}

@media (max-width: 1200px) {
    :root {
        --nexa-sidebar-width: 230px;
    }

    .nexa-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nexa-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    :root {
        --nexa-header-height: 64px;
    }

    body {
        font-size: var(--nexa-font-sm);
    }

    .nexa-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .nexa-grid-2,
    .nexa-grid-3,
    .nexa-grid-4 {
        grid-template-columns: 1fr;
    }

    .nexa-card-header,
    .nexa-card-body,
    .nexa-card-footer,
    .nexa-panel {
        padding-right: var(--nexa-space-4);
        padding-left: var(--nexa-space-4);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
