/* =====================================================================
   theme.css — سیستم طراحی محلی سامانه مدیریت پرسنل
   پالت "Indigo Ink" — کاملاً آفلاین، بدون وابستگی به CDN
   ===================================================================== */

@import url('../fonts/fonts.css');

:root{
  --color-primary:   #2563eb;
  --color-bg:        #f4f7fb;
  --color-button:    #2563eb;
  --color-sidebar:   #0f2a52;
  --color-text:      #16243a;
  --color-accent:    #3b82f6;

  --color-primary-600: var(--color-primary);
  --color-primary-700: #1d4ed8;
  --color-primary-100: #dbeafe;
  --color-primary-50:  #eff6ff;
  --color-accent-600: var(--color-accent);

  --gray-25:  #fbfbfd;
  --gray-50:  #f6f7fb;
  --gray-100: #eef0f6;
  --gray-150: #e6e8f1;
  --gray-200: #dcdfea;
  --gray-300: #c3c8d6;
  --gray-400: #6c7390;
  --gray-500: #5f6680;
  --gray-600: #555c75;
  --gray-700: #3d4259;
  --gray-800: #282c3e;
  --gray-900: #181a26;

  --success-50:  #ecfbf3;
  --success-500: #16a673;
  --success-600: #0e9163;
  --success-700: #0b7a52;

  --danger-50:  #fdf0f1;
  --danger-500: #e0455a;
  --danger-600: #cc3349;
  --danger-700: #ad2740;

  --warning-50:  #fef7ec;
  --warning-500: #e69323;
  --warning-600: #cf7e12;
  --warning-700: #8f5a0a;

  --info-50:  #eef5fd;
  --info-500: #2f8fe0;
  --info-600: #1f78c7;

  --purple-50:  #f6f0fd;
  --purple-500: #9456e0;
  --purple-600: #7d3fc8;

  --teal-50:  #ecfaf8;
  --teal-500: #14b39e;

  --surface:        #ffffff;
  --surface-muted:  var(--gray-50);
  --surface-sunken: var(--gray-100);
  --border-color:   var(--gray-150);
  --border-strong:  var(--gray-300);

  --font-display: 'Vazirmatn', 'Vazirmatn Static', Tahoma, Arial, sans-serif;
  --font-body:     'Vazirmatn', 'Vazirmatn Static', Tahoma, Arial, sans-serif;
  --font-family:   var(--font-body);

  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px;  --sp-6: 24px;  --sp-7: 28px;  --sp-8: 32px;
  --sp-9: 36px;  --sp-10: 40px; --sp-12: 48px; --sp-14: 56px;
  --sp-16: 64px; --sp-20: 80px;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-2xl: 28px;
  --radius-full: 999px;

  --shadow-xs:  0 1px 2px 0 rgba(24,26,38,.05);
  --shadow-sm:  0 1px 3px 0 rgba(24,26,38,.07), 0 1px 2px -1px rgba(24,26,38,.06);
  --shadow-md:  0 4px 10px -2px rgba(24,26,38,.08), 0 2px 4px -2px rgba(24,26,38,.05);
  --shadow-lg:  0 12px 24px -8px rgba(24,26,38,.12), 0 4px 8px -4px rgba(24,26,38,.06);
  --shadow-xl:  0 20px 40px -12px rgba(24,26,38,.18);
  --shadow-glow: 0 0 0 4px rgba(37,99,235,.13);
  --shadow-focus: 0 0 0 3px rgba(37,99,235,.28);

  --ease: cubic-bezier(.4,0,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --t-fast: 150ms var(--ease);
  --t-base: 200ms var(--ease);
  --t-slow: 300ms var(--ease);
  --t-spring: 320ms var(--ease-spring);

  --tap-min: 44px;

  /* --- افزوده‌های بازطراحی: توکن‌های گرادیان/سایه/لایه، بر پایه همان
     پالت زنده (رنگ‌های بالا) — هیچ متغیر موجودی تغییر نکرده است --- */
  --shadow-primary-sm: 0 2px 8px -2px color-mix(in srgb, var(--color-primary) 35%, transparent);
  --shadow-primary-md: 0 8px 20px -6px color-mix(in srgb, var(--color-primary) 40%, transparent);
  --shadow-card-hover: 0 16px 32px -12px rgba(24,26,38,.16), 0 4px 10px -4px rgba(24,26,38,.08);

  --gradient-primary: linear-gradient(135deg, var(--color-button) 0%, var(--color-primary-700) 100%);
  --gradient-primary-soft: linear-gradient(135deg, var(--color-primary-50) 0%, #ffffff 60%);
  --gradient-sidebar: linear-gradient(195deg, var(--color-sidebar) 0%, color-mix(in srgb, var(--color-sidebar) 80%, #000) 100%);
  --gradient-hero: linear-gradient(135deg, var(--color-sidebar) 0%, var(--color-primary) 55%, var(--color-accent) 100%);

  --z-dropdown: 40;
  --z-sidebar: 30;
  --z-sidebar-toggle: 50;
  --z-backdrop: 25;
  --z-modal: 60;
}

.dark-mode{
  --color-bg:        #11131f;
  --surface:         #1a1c2b;
  --surface-muted:   #1f2233;
  --surface-sunken:  #242740;
  --border-color:    #2c2f45;
  --border-strong:   #3a3d58;
  --color-text:      #e7e9f3;
  --gray-500: #9aa0b8;
  --gray-600: #b4b9cf;
  --gray-700: #cdd0e2;
  --gradient-primary-soft: linear-gradient(135deg, #1f2233 0%, #1a1c2b 60%);
  color-scheme: dark;
}
.dark-mode body{ background-color: var(--color-bg); }

*, *::before, *::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; scroll-behavior: smooth; font-size: 16px; }
body{
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}
img, svg{ display: block; max-width: 100%; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; cursor: pointer; }
input, textarea, select, button{ font-family: inherit; font-size: inherit; color: inherit; }
table{ border-collapse: collapse; width: 100%; }
ul, ol{ margin: 0; padding: 0; list-style: none; }
h1,h2,h3,h4,h5,h6{ margin: 0; font-weight: 700; line-height: 1.3; }
p{ margin: 0; }
fieldset{ border: 0; margin: 0; padding: 0; }
legend{ padding: 0; }

::-webkit-scrollbar{ width: 8px; height: 8px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{ background: var(--gray-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover{ background: var(--gray-400); }

:focus-visible{
  outline: 2.5px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible{
  box-shadow: var(--shadow-focus);
}

body{ animation: pageFade .25s var(--ease); }
@keyframes pageFade{ from{ opacity: .94; } to{ opacity: 1; } }
@keyframes fadeInUp{ from{ opacity:0; transform: translateY(8px); } to{ opacity:1; transform: translateY(0); } }
@keyframes scaleIn{ from{ opacity:0; transform: scale(.96); } to{ opacity:1; transform: scale(1); } }
@keyframes softPulse{ 0%,100%{ opacity:1; } 50%{ opacity:.55; } }

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

.icon{
  width: 1em; height: 1em;
  display: inline-block;
  vertical-align: -0.14em;
  fill: none;
  flex-shrink: 0;
}
.icon-lg{ width: 1.5em; height: 1.5em; }
.icon-xl{ width: 2.25em; height: 2.25em; }
