@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Readex+Pro:wght@400;500;600;700&display=swap');

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

html {
    font-size: 16px;
    direction: rtl;
    text-align: right;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* Tabular Numbers for precise alignment in financial and inventory tables */
.tabular-nums, table, .stat-value, .row-total, .tree-node-code {
    font-variant-numeric: tabular-nums;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

img, svg {
    display: block;
    max-width: 100%;
}

button, input, select, textarea {
    font-family: var(--font-body);
    font-size: inherit;
    line-height: inherit;
}

/* Clean, unobtrusive scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #EAECEF;
}

::-webkit-scrollbar-thumb {
    background: #C4C9D2;
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: #9FA7B3;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-text-main);
    line-height: 1.35;
    letter-spacing: -0.01em;
}

h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }

.text-muted { color: var(--color-text-muted); }
.text-subtle { color: var(--color-text-subtle); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }

.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.whitespace-nowrap { white-space: nowrap !important; }

/* SVG Icon System */
.icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
    vertical-align: -0.18em;
    flex-shrink: 0;
}
.icon-sm {
    width: 0.9em;
    height: 0.9em;
}
.icon-lg {
    width: 1.35em;
    height: 1.35em;
}
