/* HAYDAR V32 — executive home dashboard inspired by the approved navy/gold reference.
   The phone layout is not a scaled desktop: it removes decorative density,
   reduces the hero, simplifies cards, keeps tap targets large, and improves
   scrolling/readability for forms and tables. */
:root{
  --pri:#d9a74b;
  --pri2:#f3cb77;
  --bg:#030d17;
  --card:#071827;
  --card2:#0a2133;
  --ink:#f7f1e7;
  --muted:#a9b6c2;
  --line:#74572f;
  --gold:#e2b45d;
  --gold2:#ffda8b;
  --navy:#03111e;
  --navy2:#08243a;
  --ok:#8bd0a8;
  --warn:#f6c86e;
  --bad:#ff9c92;
  --soft:#102b40;
}
*{box-sizing:border-box}
html{background:#020a12;scrollbar-color:#9e7537 #05121e}
body{
  margin:0;
  font-family:Tahoma,Arial,sans-serif;
  background:
    radial-gradient(circle at 12% 8%,#1b3550aa 0,transparent 24%),
    radial-gradient(circle at 82% 42%,#243c4f55 0,transparent 22%),
    linear-gradient(145deg,#020a12 0%,#061827 48%,#020a12 100%);
  color:var(--ink);
  line-height:1.75;
  min-height:100vh;
}
body::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:-1;opacity:.22;
  background-image:
    linear-gradient(30deg,transparent 24%,#c6984912 25%,#c6984912 26%,transparent 27%,transparent 74%,#c6984912 75%,#c6984912 76%,transparent 77%),
    linear-gradient(150deg,transparent 24%,#c6984912 25%,#c6984912 26%,transparent 27%,transparent 74%,#c6984912 75%,#c6984912 76%,transparent 77%);
  background-size:54px 94px;
}

header{
  position:relative!important;
  top:auto!important;
  margin-right:246px;
  min-height:auto;
  padding:calc(23.5955vw - 46px) 28px 16px!important;
  color:#fff;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  background:#03111f!important;
  border-bottom:1px solid #a97731;
  box-shadow:0 12px 34px #0009;
  z-index:4!important;
  overflow:hidden;
}
header::before{
  content:"";
  position:absolute;
  left:0; right:0; top:0;
  height:calc(23.5955vw - 58px);
  background:
    linear-gradient(180deg,rgba(2,10,17,.06),rgba(2,10,17,.06)),
    url('./haydar-hero.jpg') center top / contain no-repeat;
  background-color:#03111f;
}
header::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:3px;
  background:linear-gradient(90deg,transparent,#e7bd69 22%,#fff0b2 50%,#e7bd69 78%,transparent);
  opacity:.9;
}
header h1{
  position:relative;z-index:1;margin:0!important;padding:10px 14px;border:1px solid #bd8a43aa;border-radius:10px;
  background:#061827;backdrop-filter:blur(8px);font-size:18px!important;color:#ffdfa0;letter-spacing:.2px;
  box-shadow:inset 0 0 18px #d79d2b0c,0 5px 20px #0008;
}
header small{
  position:relative;z-index:1;width:auto!important;order:initial!important;margin:0;padding:9px 11px;border-radius:9px;
  background:#061827;border:1px solid #70522d;color:#f4e8d0;opacity:1!important;font-size:12px;
}
.header-install{
  position:relative;z-index:1;margin-inline-start:auto!important;
  background:linear-gradient(180deg,#ffe4a6,#c58b33)!important;color:#1b1308!important;
  border:1px solid #ffe3a1!important;border-radius:10px!important;padding:10px 15px!important;cursor:pointer;font-weight:800!important;
  box-shadow:0 5px 20px #0008,inset 0 1px #fff9;
}
.connection-badge{
  position:relative;z-index:1;background:#061827;border:1px solid #76562e;border-radius:20px;padding:5px 10px;color:#e9d7b5;font-size:11px;
}
/* Desktop navigation rail */
nav#nav{
  position:fixed!important;right:0;top:0;bottom:0;width:246px;height:100vh;z-index:20;
  display:flex!important;flex-direction:column;gap:4px;overflow-y:auto;overflow-x:hidden;
  padding:22px 13px 24px!important;
  background:
    linear-gradient(180deg,#020b14f8,#041827 52%,#020b14f9),
    radial-gradient(circle at 50% 18%,#23394c55,transparent 34%);
  border-left:1px solid #9b7037;
  box-shadow:-8px 0 28px #0007,inset 1px 0 #e3b65b18;
  scrollbar-width:thin;
}
nav#nav::before{
  content:"مدیر سیستم\A حیدر  •  HAYDAR";
  white-space:pre-line;display:block;flex:0 0 auto;margin:0 5px 15px;padding:12px 13px 14px;
  color:#fff3d3;border-bottom:1px solid #7d5a2f;text-align:right;font-weight:800;line-height:1.9;font-size:13px;
  background:radial-gradient(circle at 90% 40%,#d7a64918,transparent 35%);
}
nav#nav::after{
  content:"کار، عبادت است\A اگر برای خدا باشد";
  white-space:pre-line;display:block;flex:0 0 auto;margin:14px 4px 6px;padding:16px 10px;
  color:#f0c66f;text-align:center;font-weight:700;line-height:2;border:1px solid #77572e;border-radius:12px;
  background:linear-gradient(145deg,#071b2a,#03101b);box-shadow:inset 0 0 24px #b98a3510;
}
nav#nav button{
  position:relative;display:flex;align-items:center;gap:10px;min-height:46px;width:100%;
  white-space:normal;text-align:right;border:1px solid transparent!important;background:transparent!important;
  color:#f0f3f5!important;padding:9px 12px!important;border-radius:10px!important;cursor:pointer;font-size:12.5px!important;font-weight:700!important;
  transition:.18s ease;
}
nav#nav button::before{
  content:"◆";display:grid;place-items:center;flex:0 0 28px;width:28px;height:28px;border-radius:8px;color:#efbd62;
  font-size:18px;font-family:Arial,sans-serif;text-align:center;
}
nav#nav button:hover{background:#0e2a3d!important;border-color:#604725!important;transform:translateX(-2px)}
nav#nav button.active{
  color:#1d1407!important;background:linear-gradient(100deg,#f8d88e,#bd8330)!important;border-color:#ffe3a3!important;
  box-shadow:0 4px 15px #0007,inset 0 1px #fff8;
}
nav#nav button.active::before{color:#2a1a08;background:#6e481d24}
#nav button[data-tab="start"]::before{content:"⌂"}
#nav button[data-tab="dashboard"]::before{content:"▥"}
#nav button[data-tab="catalog"]::before{content:"◇"}
#nav button[data-tab="production"]::before{content:"⚙"}
#nav button[data-tab="inventory"]::before{content:"▣"}
#nav button[data-tab="sales"]::before{content:"▤"}
#nav button[data-tab="performance"]::before{content:"▥"}
#nav button[data-tab="attendance"]::before{content:"◷"}
#nav button[data-tab="employees"]::before{content:"♙"}
#nav button[data-tab="payroll"]::before{content:"﷼";font-size:14px}
#nav button[data-tab="insurance"]::before{content:"◎"}
#nav button[data-tab="promotion"]::before{content:"↑"}
#nav button[data-tab="levels"]::before{content:"◆"}
#nav button[data-tab="rules"]::before{content:"⚖";font-size:16px}
#nav button[data-tab="yearend"]::before{content:"✦"}
#nav button[data-tab="workshop"]::before{content:"⚒"}
#nav button[data-tab="sync"]::before{content:"↻"}
#nav button[data-tab="backup"]::before{content:"⇩"}
#nav button[data-tab="security"]::before{content:"♜"}

.mobile-section{display:none!important}
main{
  max-width:none!important;margin:0 246px 0 0!important;padding:20px 22px 88px!important;position:relative;z-index:2;
}
.tab{animation:haydarFade .22s ease}
@keyframes haydarFade{from{opacity:.4;transform:translateY(3px)}to{opacity:1;transform:none}}

.card,.kpi,.welcome,details.card{
  color:var(--ink)!important;
  background:
    linear-gradient(145deg,rgba(10,34,52,.96),rgba(4,17,29,.98))!important;
  border:1px solid #6f512c!important;border-radius:13px!important;
  box-shadow:0 8px 24px #0005,inset 0 1px #e9be6610!important;
}
.card{padding:17px!important;margin-bottom:15px!important;position:relative;overflow:hidden}
.card::before,.kpi::before{
  content:"";position:absolute;inset:0;pointer-events:none;opacity:.18;
  background:radial-gradient(circle at 8% 0%,#d4a54e33,transparent 20%),linear-gradient(115deg,transparent 0 82%,#c2944110 82% 83%,transparent 83%);
}
.card h2,.card h3{color:#ffe1a1!important;letter-spacing:.1px}
h2{font-size:18px!important} h3{font-size:15px!important}
.muted,label,#homeSyncStatus{color:#aebbc5!important}
.eyebrow{color:#e7b65c!important;font-weight:800!important}
.welcome{padding:22px!important;background:linear-gradient(125deg,#0a2438,#06131f)!important}
.welcome h2{font-size:24px!important;color:#ffe2a4!important;margin:7px 0!important}
.welcome p{color:#bdc9d1!important}

.quick-grid{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:12px!important;margin-top:20px!important}
.quick-grid button{
  position:relative;text-align:right!important;min-height:96px;padding:17px 60px 17px 15px!important;
  border:1px solid #76562f!important;border-radius:12px!important;
  background:linear-gradient(145deg,#0d2c43,#071826)!important;color:#f9f3e7!important;cursor:pointer;overflow:hidden;
  box-shadow:inset 0 1px #ffffff0a;transition:.18s ease!important;
}
.quick-grid button::before{
  content:"✦";position:absolute;right:13px;top:19px;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;
  color:#f8d483;border:1px solid #a87836;background:radial-gradient(circle,#6c4a22,#1e1a14);font-size:18px;box-shadow:0 0 18px #dca74a22;
}
.quick-grid button:hover{transform:translateY(-2px);border-color:#e4b45d!important;box-shadow:0 9px 20px #0006!important}
.quick-grid b{display:block;font-size:15px!important;color:#ffe0a0!important}.quick-grid span{display:block;color:#aebbc5!important;font-size:11.5px!important;margin-top:6px!important}

.kpis{gap:12px!important}
.kpi{position:relative;min-height:108px;padding:16px 18px 15px!important;overflow:hidden;color:#dce5ea!important}
.kpi b{display:block!important;margin-top:7px!important;color:#fff2d3!important;font-size:21px!important;text-shadow:0 1px 8px #0007}
.kpi::after{content:"";position:absolute;left:12px;bottom:12px;width:36px;height:36px;border:1px solid #9a6f35;border-radius:50%;background:radial-gradient(circle,#6b4b25,#22190f);box-shadow:0 0 18px #d59a3822}

input,select,textarea{
  background:#041522!important;color:#f5f0e7!important;border:1px solid #5b4a35!important;border-radius:9px!important;
  box-shadow:inset 0 1px 7px #0005!important;
}
input::placeholder,textarea::placeholder{color:#778896!important}
input:focus,select:focus,textarea:focus{outline:2px solid #e5b45855!important;border-color:#d5a24d!important;box-shadow:0 0 0 3px #d5a24d16!important}
select option{background:#071b2a;color:#fff}
input[type=checkbox]{accent-color:#d6a34c!important;box-shadow:none!important}

button.primary,.primary{
  color:#201607!important;background:linear-gradient(180deg,#ffdfa0,#bf8531)!important;border:1px solid #ffe2a1!important;border-radius:9px!important;
  box-shadow:0 4px 12px #0005,inset 0 1px #fff8!important;font-weight:800!important;
}
button.primary:hover,.primary:hover{filter:brightness(1.06)}
button.secondary{
  color:#f1d49a!important;background:#0b2639!important;border:1px solid #8d6939!important;border-radius:9px!important;font-weight:700!important;
}
button.danger{background:#271416!important;color:#ffb3aa!important;border:1px solid #824248!important}
.actions button{min-height:42px}

.tablewrap{border:1px solid #644b2d!important;border-radius:10px!important;background:#03131f!important;overflow:auto!important}
table{color:#e9edf0!important}th,td{border-bottom:1px solid #243b4c!important}
th{background:#0c2a3e!important;color:#f3cb7a!important;position:sticky!important;top:0}
tbody tr:hover td{background:#0b2233!important}

.notice{background:#2a210f!important;border:1px solid #8b6936!important;color:#f3dfb3!important}
.ok{background:#0f2e25!important;border-color:#356e57!important;color:#a4dfbb!important}
.warn{background:#2d210d!important;border-color:#7f6334!important;color:#f0ce87!important}
.bad{background:#351719!important;border-color:#7d3b42!important;color:#ffb2aa!important}
.badge{background:#112d42!important;color:#b9d9ef!important;border:1px solid #35536a}
.badge.okb{background:#123426!important;color:#a2dfb7!important;border-color:#2e624c}.badge.warnb{background:#33260e!important;color:#f4d083!important;border-color:#7c6031}
.score-preview{background:#0d2a3d!important;color:#ffe0a0!important;border:1px solid #6d512e!important}
hr{border-color:#314454!important}
summary{color:#f3cb78!important}
.checklist-row{border-color:#294153!important}
dialog{background:#071b29!important;color:#f5eee2!important;border:1px solid #8b6636!important;box-shadow:0 20px 80px #000c!important}dialog::backdrop{background:#000b!important}
#toast{background:#0a2233!important;color:#ffe4aa!important;border:1px solid #9b7037!important;box-shadow:0 8px 30px #0009!important}
.sticky-actions{background:#061827ee!important;border-color:#76572f!important;backdrop-filter:blur(12px)!important}

/* compact title treatment for every page */
.tab>.card:first-child>h2,.tab>h2:first-child{padding-bottom:8px;border-bottom:1px solid #594327}

@media(max-width:1050px){
  nav#nav{width:216px}header,main{margin-right:216px!important}.quick-grid{grid-template-columns:1fr 1fr!important}
  header{padding-top:calc(23.5955vw - 41px)!important}
  header::before{height:calc(23.5955vw - 51px)!important}
}
@media(max-width:760px){
  /* Phone-specific visual language: calmer, flatter, and touch-first. */
  html{scroll-padding-top:58px}
  body{
    background:linear-gradient(180deg,#020b13 0%,#061724 48%,#020b13 100%);
    padding-bottom:env(safe-area-inset-bottom);
  }
  body::before{opacity:.08;background-size:72px 124px}
  nav#nav{display:none!important}

  header{
    margin-right:0!important;
    min-height:auto!important;
    padding:calc(23.5955vw + 8px) 12px 10px!important;
    background:#03111f!important;
    border-bottom-color:#6d522f!important;
    box-shadow:0 6px 18px #0008!important;
    align-items:flex-start!important;
    gap:6px!important;
  }
  header::before{
    top:0!important;left:0!important;right:0!important;
    height:23.5955vw!important;
    background:
      linear-gradient(180deg,rgba(2,10,17,.04),rgba(2,10,17,.04)),
      url('./haydar-hero.jpg') center top / contain no-repeat!important;
    background-color:#03111f!important;
    opacity:1!important;
  }
  header::after{height:2px;opacity:.72}
  header h1{
    max-width:100%;
    width:100%;
    font-size:13px!important;
    line-height:1.65!important;
    padding:7px 9px!important;
    border-radius:8px!important;
    background:#061827!important;
    border-color:#8a6639aa!important;
    box-shadow:none!important;
    order:2!important;
  }
  header small{
    display:block!important;
    width:100%!important;
    font-size:10px!important;
    line-height:1.6!important;
    padding:6px 9px!important;
    border-radius:8px!important;
    background:#061827!important;
    border-color:#5f4a2f!important;
    order:3!important;
  }
  .header-install{display:none!important}
  .connection-badge{
    position:absolute!important;
    top:8px!important;left:9px!important;
    font-size:9px!important;
    padding:4px 7px!important;
    background:#041421dd!important;
    border-color:#5c472e!important;
  }

  .mobile-section{
    display:block!important;
    position:sticky;top:0;z-index:18;
    padding:7px 9px!important;
    background:#03101bf2!important;
    border-bottom:1px solid #574328!important;
    backdrop-filter:blur(14px);
    box-shadow:0 4px 14px #0006;
  }
  .mobile-section label{display:none!important}
  .mobile-section select{
    min-height:42px!important;
    height:42px!important;
    padding:6px 11px!important;
    font-size:15px!important;
    font-weight:800!important;
    color:#f4d590!important;
    background:#071b29!important;
    border:1px solid #725631!important;
    border-radius:11px!important;
    box-shadow:none!important;
  }

  main{
    margin-right:0!important;
    padding:10px 9px calc(86px + env(safe-area-inset-bottom))!important;
  }
  .tab{animation:none!important}
  .card,.kpi,.welcome,details.card{
    border-color:#3f382f!important;
    box-shadow:0 4px 14px #00045!important;
    background:linear-gradient(180deg,#081d2c,#05131f)!important;
  }
  .card{padding:13px!important;margin-bottom:10px!important;border-radius:14px!important;overflow:visible!important}
  .card::before,.kpi::before,.kpi::after{display:none!important}
  .tab>.card:first-child>h2,.tab>h2:first-child{border-bottom-color:#3d372f;padding-bottom:7px}
  .card h2{font-size:17px!important;margin-bottom:10px!important}
  .card h3{font-size:14px!important}
  .muted,label,#homeSyncStatus{color:#a7b2bb!important}

  .welcome{
    padding:14px!important;
    background:linear-gradient(180deg,#0a2233,#061522)!important;
  }
  .welcome .eyebrow{font-size:11px!important;letter-spacing:0!important}
  .welcome h2{font-size:18px!important;line-height:1.55!important;margin:5px 0!important}
  .welcome p{font-size:12px!important;line-height:1.8!important;margin:0!important;color:#a9b6bf!important}

  .quick-grid{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
    margin-top:12px!important;
  }
  .quick-grid button{
    min-height:82px!important;
    padding:12px 11px!important;
    border-radius:12px!important;
    border-color:#4b4033!important;
    background:#071a28!important;
    box-shadow:none!important;
  }
  .quick-grid button::before{display:none!important}
  .quick-grid b{font-size:13px!important;line-height:1.55!important;color:#f6d58f!important}
  .quick-grid span{font-size:10.5px!important;line-height:1.6!important;margin-top:5px!important;color:#9eabb5!important}
  .quick-grid button:hover{transform:none!important;box-shadow:none!important}

  .grid,.grid3,.two{grid-template-columns:1fr!important;gap:9px!important}
  .kpis{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
  }
  .kpi{
    min-height:78px!important;
    padding:11px 12px!important;
    border-radius:12px!important;
    font-size:11px!important;
    background:#071a28!important;
  }
  .kpi b{font-size:16px!important;margin-top:4px!important;line-height:1.45!important}

  input,select,textarea{
    font-size:16px!important;
    min-height:46px!important;
    padding:10px 11px!important;
    border-color:#4d4438!important;
    border-radius:11px!important;
    box-shadow:none!important;
  }
  textarea{min-height:88px!important}
  .checkline{min-height:42px!important;padding:5px 1px!important}
  input[type=checkbox]{min-height:auto!important}

  .actions{gap:7px!important;margin-top:10px!important}
  .actions button{
    flex:1 1 calc(50% - 7px)!important;
    min-height:46px!important;
    padding:9px 10px!important;
    font-size:13px!important;
  }
  .actions button:only-child{flex-basis:100%!important}
  .sticky-actions{
    bottom:8px!important;
    padding:7px!important;
    border-radius:12px!important;
    background:#04121df2!important;
    border-color:#5b472e!important;
  }

  .tablewrap{
    margin-inline:-4px!important;
    border-radius:12px!important;
    border-color:#40382e!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
  }
  .tablewrap::after{
    content:"برای دیدن ستون‌های بیشتر، جدول را افقی بکشید";
    display:block;
    position:sticky;right:0;
    padding:5px 9px;
    color:#887b6d;
    font-size:9px;
    text-align:center;
    background:#04131e;
    border-top:1px solid #302c27;
  }
  table{min-width:680px!important}
  th,td{font-size:11px!important;padding:8px 7px!important;white-space:nowrap}
  td .muted{white-space:normal;min-width:120px}
  tbody tr:hover td{background:inherit!important}

  .notice,.ok,.warn,.bad{font-size:12px!important;line-height:1.8!important;padding:9px!important;border-radius:10px!important}
  dialog{
    width:calc(100vw - 18px)!important;
    max-width:none!important;
    max-height:88vh!important;
    padding:14px!important;
    border-radius:14px!important;
  }
  #toast{left:9px!important;right:9px!important;bottom:12px!important;width:auto!important;max-width:none!important}
}
@media(max-width:480px){
  header{padding-top:calc(23.5955vw + 8px)!important}
  header h1{font-size:13px!important}
  .quick-grid{grid-template-columns:1fr!important}
  .quick-grid button{min-height:68px!important}
  .kpis{grid-template-columns:1fr 1fr!important}
  .kpi{min-width:0!important}
  .kpi b{font-size:15px!important}
  .actions button{flex-basis:100%!important}
}


/* ===== V32 executive home dashboard ===== */
body.home-view header h1,
body.home-view header small,
body.home-view .header-install,
body.home-view .connection-badge{display:none!important}
body.home-view header{padding:calc(23.5955vw - 58px) 0 0!important;min-height:0!important;border-bottom:1px solid #8f6938!important}
body.home-view main{padding-top:14px!important}
.home-dashboard{max-width:1480px;margin-inline:auto}
.home-commandbar{display:grid;grid-template-columns:210px minmax(320px,650px);gap:18px;align-items:center;justify-content:space-between;margin-bottom:14px;direction:ltr}.home-date-card,.home-search-wrap{direction:rtl}
.home-date-card{height:58px;display:flex;align-items:center;gap:12px;padding:8px 14px;border:1px solid #63513b;border-radius:12px;background:linear-gradient(145deg,#0a2132,#071724);box-shadow:inset 0 1px #fff1,0 5px 14px #0004}
.home-date-icon{width:40px;height:40px;border-radius:8px;display:grid;place-items:center;border:1px solid #92703d;color:#f3c970;font-size:23px;background:#0a1d2b}
.home-date-card div{display:flex;flex-direction:column;line-height:1.45}.home-date-card b{font-size:12px;color:#dbe2e7}.home-date-card span:last-child{font-size:15px;color:#fff1d1;font-weight:800}
.home-search-wrap{position:relative}.home-search-wrap input{height:48px!important;border-radius:24px!important;padding:8px 50px 8px 18px!important;background:#091b29!important;border-color:#79613f!important;font-size:14px!important}
.home-search-icon{position:absolute;right:18px;top:50%;transform:translateY(-50%);z-index:2;color:#f1d18a;font-size:25px;pointer-events:none}
.home-search-results{position:absolute;top:54px;right:0;left:0;z-index:40;background:#061827;border:1px solid #80643e;border-radius:12px;box-shadow:0 18px 42px #000b;overflow:hidden;max-height:330px;overflow-y:auto}
.home-search-item{width:100%;display:flex;align-items:center;gap:10px;padding:10px 12px;border:0;border-bottom:1px solid #1e3546;background:transparent;color:#f4eee2;text-align:right;cursor:pointer}.home-search-item:hover{background:#0c2a3e}.home-search-item:last-child{border-bottom:0}.home-search-item i{width:31px;height:31px;border-radius:9px;display:grid;place-items:center;background:#352714;color:#f3c66c;border:1px solid #7d6037;font-style:normal}.home-search-item b{display:block;color:#f8d88f;font-size:12px}.home-search-item small{display:block;color:#8fa1ae;font-size:10px}
.home-search-empty{padding:16px;text-align:center;color:#8fa1ae;font-size:12px}
.home-kpi-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:14px;direction:ltr}.home-kpi{direction:rtl}
.home-kpi{position:relative;min-height:112px;text-align:right;border:1px solid #725636;border-radius:12px;background:linear-gradient(145deg,#0b2335,#061523);color:#e8edf0;padding:16px 74px 12px 14px;cursor:pointer;overflow:hidden;box-shadow:0 8px 20px #00035,inset 0 1px #fff1;transition:.18s}.home-kpi:hover{transform:translateY(-2px);border-color:#d6a957}.home-kpi::after{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(circle at 15% 10%,#e3b35c12,transparent 25%),linear-gradient(120deg,transparent 65%,#d5aa5910)}
.home-kpi-icon{position:absolute;right:13px;top:21px;width:50px;height:50px;border-radius:50%;display:grid;place-items:center;font-size:27px;color:#f6cf7e;border:1px solid #a0753a;background:radial-gradient(circle,#735127,#251b11);box-shadow:0 0 22px #d6a44c1f}
.home-kpi-label{display:block;color:#e8e2d8;font-size:13px;white-space:nowrap}.home-kpi b{display:block;color:#fff0cc;font-size:24px;margin-top:4px;line-height:1.3}.home-kpi small{display:block;color:#aab7c0;font-size:10px;margin-top:5px}.home-kpi-sales{border-color:#806039;background:linear-gradient(145deg,#0b263a,#071826)}
.home-main-grid{display:grid;grid-template-columns:1.15fr .9fr 1fr;gap:12px;align-items:stretch;margin-bottom:14px;direction:ltr}.home-main-grid>.home-panel{direction:rtl}
.home-panel{min-height:315px;border:1px solid #694e30;border-radius:13px;background:linear-gradient(145deg,#0a2132,#051522);box-shadow:0 8px 22px #0004;overflow:hidden;position:relative}.home-panel::before{content:"";position:absolute;inset:0;pointer-events:none;opacity:.17;background:radial-gradient(circle at 0 0,#d3a44c28,transparent 24%),linear-gradient(110deg,transparent 72%,#c99b4610)}
.home-panel-head{position:relative;z-index:1;min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 14px;border-bottom:1px solid #3d3b36}.home-panel-head>div{display:flex;align-items:center;gap:8px}.home-panel-head>div>span{color:#f2c66c;font-size:20px}.home-panel-head b{color:#ffe0a0;font-size:15px}.home-link-btn,.home-add-order{border:1px solid #725937;background:#0a2232;color:#efd397;border-radius:8px;padding:7px 10px;font-size:11px;cursor:pointer}.home-add-order{background:linear-gradient(#ffe1a0,#bd8432);color:#201407;border-color:#f4d28a;font-weight:800}
.home-sales-chart{height:255px;padding:18px 13px 12px;display:flex;align-items:flex-end;gap:10px;position:relative;z-index:1;background:repeating-linear-gradient(to top,transparent 0,transparent 49px,#243a492e 50px)}
.home-bar-col{flex:1;min-width:34px;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:6px}.home-bar-value{font-size:9px;color:#d3c4a7;white-space:nowrap}.home-bar{width:min(52px,70%);min-height:3px;border-radius:5px 5px 2px 2px;background:linear-gradient(180deg,#ffd88b,#aa6f29);box-shadow:0 0 16px #eab65c18,inset 0 1px #fff8}.home-bar-label{font-size:10px;color:#c6d0d7;white-space:nowrap}
.home-production-body{display:grid;grid-template-columns:160px 1fr;gap:20px;align-items:center;justify-content:center;padding:30px 18px 24px;position:relative;z-index:1}.home-donut{width:154px;height:154px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(#d7aa58 0 0,#637181 0 100%);position:relative;box-shadow:0 0 26px #0006}.home-donut::after{content:"";position:absolute;width:102px;height:102px;border-radius:50%;background:#071a29;border:1px solid #334757;box-shadow:inset 0 0 22px #0007}.home-donut>div{position:relative;z-index:2;text-align:center}.home-donut b{display:block;font-size:24px;color:#fff0cd}.home-donut span{display:block;font-size:10px;color:#aebcc5;margin-top:3px}.home-status-legend{display:flex;flex-direction:column;gap:14px}.home-legend-row{display:grid;grid-template-columns:12px 1fr auto;align-items:center;gap:8px;font-size:11px;color:#dce3e7}.home-legend-dot{width:10px;height:10px;border-radius:50%}.home-legend-row strong{color:#f4d48d;font-weight:800}
.home-order-list{padding:8px 10px 10px;position:relative;z-index:1}.home-order-row{width:100%;display:grid;grid-template-columns:58px 1fr auto 18px;gap:10px;align-items:center;padding:7px 5px;border:0;border-bottom:1px solid #263b4a;background:transparent;color:inherit;text-align:right;cursor:pointer}.home-order-row:last-child{border-bottom:0}.home-order-thumb{width:54px;height:42px;border-radius:8px;border:1px solid #725738;background:linear-gradient(145deg,#162c3b,#3b2d1b);display:grid;place-items:center;color:#f4cf7e;font-size:25px;box-shadow:inset 0 0 16px #d39e3c12}.home-order-meta b{display:block;color:#f3e6c8;font-size:11.5px}.home-order-meta small{display:block;color:#97a7b2;font-size:9.5px;margin-top:3px}.home-order-status{font-size:9px;padding:4px 7px;border-radius:7px;border:1px solid #4b5a62;white-space:nowrap}.home-order-status.running{color:#b8dd9b;background:#18321d;border-color:#406642}.home-order-status.planned{color:#9fd0ee;background:#132e43;border-color:#315c78}.home-order-status.completed{color:#e9d3a0;background:#312615;border-color:#765a30}.home-order-arrow{color:#e7bd69;font-size:20px}.home-empty-orders{padding:48px 16px;text-align:center;color:#8496a3;font-size:12px}
.home-shortcuts{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:14px;direction:ltr}.home-shortcut{direction:rtl}.home-shortcut{min-height:108px;display:flex;align-items:flex-end;gap:12px;text-align:right;border:1px solid #735534;border-radius:13px;padding:15px;background:linear-gradient(145deg,#0c2537,#071725);color:#f3eee4;cursor:pointer;position:relative;overflow:hidden;box-shadow:0 7px 18px #0004}.home-shortcut::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 15% 25%,#d9aa501e,transparent 30%),linear-gradient(120deg,transparent,#152c3a88)}.home-shortcut>*{position:relative;z-index:1}.shortcut-icon{margin-inline-start:auto;font-size:34px;color:#f3c96f;text-shadow:0 2px 10px #000}.home-shortcut b{display:block;font-size:15px;color:#fff0cc}.home-shortcut small{display:block;color:#aab6be;font-size:10px;margin-top:4px}.shortcut-order{background:linear-gradient(115deg,#39291888,#091c2a),url('./haydar-hero.jpg') 5% 50%/cover}.shortcut-production{background:linear-gradient(115deg,#05131fc7,#0b2435)}.shortcut-stock{background:linear-gradient(115deg,#071928,#152b33)}.shortcut-personnel{background:linear-gradient(115deg,#071928,#2b241c)}
.home-system-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.home-system-card{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #564936;border-radius:11px;padding:11px 13px;background:#061827}.home-system-card div{display:flex;flex-direction:column}.home-system-card b{color:#f0cf8a;font-size:11px}.home-system-card span{color:#98a8b3;font-size:10px;margin-top:2px}.home-system-card button{border:1px solid #705836;background:#0b2536;color:#efd392;border-radius:8px;padding:7px 10px;font-size:10px;cursor:pointer}
@media(max-width:1200px){.home-kpi-grid{grid-template-columns:repeat(3,1fr)}.home-kpi-sales{grid-column:span 1}.home-main-grid{grid-template-columns:1fr 1fr}.home-orders-panel{grid-column:1/-1;min-height:auto}.home-shortcuts{grid-template-columns:1fr 1fr}}
@media(max-width:760px){
  body.home-view header{padding:23.5955vw 0 0!important;min-height:0!important}
  body.home-view .mobile-section{top:0}
  body.home-view main{padding-top:8px!important}
  .home-dashboard{margin:0!important}
  .home-commandbar{grid-template-columns:112px 1fr;gap:7px;margin-bottom:9px}.home-date-card{height:46px;padding:5px 7px;gap:6px;border-radius:10px}.home-date-icon{width:31px;height:31px;font-size:17px}.home-date-card b{font-size:9px}.home-date-card span:last-child{font-size:10px}.home-search-wrap input{height:46px!important;font-size:12px!important;padding-right:39px!important}.home-search-icon{right:12px;font-size:20px}.home-search-results{top:50px}
  .home-kpi-grid{grid-template-columns:1fr 1fr;gap:7px;margin-bottom:9px}.home-kpi-sales{grid-column:1/-1}.home-kpi{min-height:84px;padding:10px 48px 8px 9px;border-radius:11px}.home-kpi-icon{right:8px;top:16px;width:34px;height:34px;font-size:18px}.home-kpi-label{font-size:11px}.home-kpi b{font-size:17px;margin-top:2px}.home-kpi small{font-size:8.5px;margin-top:2px}
  .home-main-grid{grid-template-columns:1fr;gap:8px;margin-bottom:9px}.home-panel{min-height:auto;border-radius:12px}.home-orders-panel{grid-column:auto}.home-panel-head{min-height:48px;padding:9px 10px}.home-panel-head b{font-size:13px}.home-panel-head>div>span{font-size:17px}.home-link-btn,.home-add-order{font-size:9.5px;padding:6px 8px}.home-sales-chart{height:215px;padding:14px 5px 9px;gap:4px}.home-bar-col{min-width:25px}.home-bar{width:min(34px,72%)}.home-bar-value{font-size:7.5px}.home-bar-label{font-size:8px}.home-production-body{grid-template-columns:118px 1fr;gap:13px;padding:18px 11px}.home-donut{width:112px;height:112px}.home-donut::after{width:73px;height:73px}.home-donut b{font-size:18px}.home-donut span{font-size:8px}.home-status-legend{gap:9px}.home-legend-row{font-size:9.5px;grid-template-columns:9px 1fr auto;gap:6px}.home-legend-dot{width:8px;height:8px}.home-order-row{grid-template-columns:45px 1fr auto 12px;gap:6px;padding:6px 2px}.home-order-thumb{width:42px;height:34px;font-size:19px}.home-order-meta b{font-size:10px}.home-order-meta small{font-size:8.5px}.home-order-status{font-size:8px;padding:3px 5px}.home-order-arrow{font-size:15px}
  .home-shortcuts{grid-template-columns:1fr 1fr;gap:7px;margin-bottom:9px}.home-shortcut{min-height:82px;padding:10px;gap:7px;border-radius:11px}.shortcut-icon{font-size:25px}.home-shortcut b{font-size:12px}.home-shortcut small{font-size:8.5px}.home-system-row{grid-template-columns:1fr;gap:7px}.home-system-card{padding:9px 10px}.home-system-card b{font-size:10px}.home-system-card span{font-size:8.5px}.home-system-card button{font-size:9px;padding:5px 8px}
}
@media(max-width:420px){.home-commandbar{grid-template-columns:1fr}.home-date-card{display:none}.home-kpi-grid{grid-template-columns:1fr 1fr}.home-shortcuts{grid-template-columns:1fr 1fr}.home-production-body{grid-template-columns:105px 1fr}.home-donut{width:100px;height:100px}.home-donut::after{width:66px;height:66px}}

@media print{nav#nav,.mobile-section,.header-install,#toast{display:none!important}header{display:none!important}main{margin:0!important;background:#fff!important;color:#000!important}.card,.kpi{background:#fff!important;color:#000!important;border-color:#bbb!important;box-shadow:none!important}table,th,td{color:#000!important;background:#fff!important}}
\n\n/* V32 — Security & Access Control */
nav#nav::before{content:attr(data-user-label)!important;white-space:pre-line!important}
.auth-gate{position:fixed;inset:0;z-index:99999;display:grid;place-items:center;padding:18px;background:radial-gradient(circle at 50% 10%,#183550aa,transparent 32%),rgba(1,7,13,.96);backdrop-filter:blur(9px)}
.auth-gate[hidden]{display:none!important}
.auth-panel{width:min(440px,100%);max-height:94vh;overflow:auto;padding:26px;border:1px solid #9b7037;border-radius:20px;background:linear-gradient(155deg,#0b2639,#04111d 70%);box-shadow:0 30px 90px #000d,inset 0 1px #ffe0a015;color:#f7f1e7}
.auth-mark{font-size:34px;font-weight:900;color:#efc36f;text-align:center;letter-spacing:.5px}.auth-mark span{display:block;font:700 12px/1.5 Georgia,serif;letter-spacing:5px;color:#c69a50}
.auth-panel h2{text-align:center;color:#ffe0a0!important;margin:12px 0 4px}.auth-panel>p{text-align:center;margin:0 0 18px}.auth-panel label{margin-top:10px}.auth-main-btn{width:100%;min-height:48px;margin-top:17px}.auth-server-details{margin-top:12px;border:1px solid #4c4235;border-radius:10px;padding:8px 10px;background:#051724}.auth-server-details summary{cursor:pointer;color:#dcb366}.auth-foot{text-align:center;color:#7e8d98;font-size:10px;margin-top:18px}
.security-hero-card{background:linear-gradient(115deg,#0b2a40,#071724)!important}.security-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);gap:14px}.security-userbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.security-user-identity b{display:block;color:#ffe0a0;font-size:17px}.security-perm-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.security-perm-row{display:grid;grid-template-columns:26px 1fr;gap:8px;align-items:start;padding:9px;border:1px solid #334453;border-radius:10px;background:#061827}.security-perm-row input{margin-top:5px}.security-perm-row b{font-size:12px;color:#f4d48f}.security-perm-row small{display:block;color:#8999a5;font-size:10px;line-height:1.6}.security-scope-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:10px}.security-scope-grid label{border:1px solid #3d4650;padding:8px;border-radius:10px}.security-scope-grid select{margin-top:5px}.security-user-table td,.security-user-table th{white-space:nowrap}.audit-detail{max-width:360px;white-space:normal!important}.security-role-preset{display:flex;gap:7px;flex-wrap:wrap}.security-role-preset button{font-size:11px}.security-stat{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.security-stat .kpi{min-height:86px!important}.permission-denied{border:1px solid #804148;background:#2a1418;color:#ffc0b8;border-radius:10px;padding:12px;margin:10px 0}
#sessionBadge{position:fixed;left:16px;bottom:16px;z-index:35;display:flex;align-items:center;gap:8px;background:#061827e8;border:1px solid #76572f;border-radius:28px;padding:7px 10px;box-shadow:0 8px 24px #0008;font-size:11px;color:#ead7af;backdrop-filter:blur(10px)}#sessionBadge button{border:0;background:#2a1712;color:#ffb9a9;border-radius:20px;padding:5px 9px;cursor:pointer}
@media(max-width:900px){.security-grid{grid-template-columns:1fr}.security-perm-grid{grid-template-columns:1fr}.security-stat{grid-template-columns:1fr 1fr}}
@media(max-width:760px){.auth-panel{padding:18px;border-radius:16px}.auth-mark{font-size:28px}.security-scope-grid{grid-template-columns:1fr}.security-perm-grid{grid-template-columns:1fr}#sessionBadge{left:9px;right:9px;bottom:8px;justify-content:center}.security-stat{grid-template-columns:1fr 1fr}}
