:root{--navy:#0d3b66;--blue:#1475e3;--green:#169b62;--red:#d9485f;--orange:#e58d16;--purple:#8d43c7;--bg:#eef3f8;--card:#fff;--text:#132238;--muted:#6f7d91;--line:#dfe5ed;--safe-bottom:env(safe-area-inset-bottom,0px)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html{background:#dfe7ef}body{margin:0;background:var(--bg);color:var(--text);font-family:Tahoma,"Segoe UI",sans-serif;overscroll-behavior-y:none}button,input,select,textarea{font:inherit}button{cursor:pointer;touch-action:manipulation}.hidden{display:none!important}
#app{min-height:100dvh}.shell{width:min(100%,600px);min-height:100dvh;margin:auto;background:var(--bg);padding-bottom:calc(84px + var(--safe-bottom));box-shadow:0 0 28px #20364d16}.topbar{position:sticky;top:0;z-index:30;background:linear-gradient(135deg,#0b3158,#145b93);color:#fff;padding:12px 14px;padding-top:max(12px,env(safe-area-inset-top));display:flex;align-items:center;justify-content:space-between;box-shadow:0 2px 10px #0002}.brand{font-weight:900;font-size:15px}.userbox{font-size:11px;opacity:.9;margin-top:3px}.top-actions{display:flex;gap:6px;align-items:center}.btn{border:0;border-radius:13px;padding:12px 15px;background:#e9eef5;color:#18304e;font-weight:800;min-height:44px}.btn.primary{background:var(--blue);color:white}.btn.green{background:var(--green);color:white}.btn.red{background:var(--red);color:white}.btn.orange{background:var(--orange);color:white}.btn.ghost{background:#fff1;color:white;border:1px solid #fff5}.btn.small{padding:8px 10px;border-radius:10px;font-size:12px;min-height:36px}.btn:disabled{opacity:.5;cursor:not-allowed}
.nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);z-index:40;width:min(100%,600px);display:flex;gap:4px;overflow-x:auto;padding:8px 8px calc(8px + var(--safe-bottom));background:#fff;border-top:1px solid var(--line);box-shadow:0 -5px 18px #19344d14;scrollbar-width:none}.nav::-webkit-scrollbar{display:none}.nav button{flex:1 0 74px;white-space:nowrap;border:0;border-radius:12px;padding:9px 7px;background:transparent;color:#617087;font-weight:800;font-size:11px;min-height:50px}.nav button.active{background:#e8f2ff;color:#0759a8}.nav button:before{display:block;font-size:18px;margin-bottom:3px}.nav button[data-r="dashboard"]:before{content:"⌂"}.nav button[data-r="cuts"]:before{content:"✂"}.nav button[data-r="newcut"]:before{content:"＋"}.nav button[data-r="corrections"]:before{content:"↺"}.nav button[data-r="settings"]:before{content:"⚙"}
.page{padding:11px}.card{background:var(--card);border:1px solid #e5eaf0;border-radius:17px;padding:14px;margin-bottom:11px;box-shadow:0 3px 11px #172b4d0b}.card h2,.card h3,.card h4{margin:0 0 12px}.sub{color:var(--muted);font-size:12px}.grid{display:grid;gap:10px}.grid.two,.grid.three{grid-template-columns:1fr}.field{display:flex;flex-direction:column;gap:6px}.field label{font-size:12px;color:#52637a;font-weight:800}.field input,.field select,.field textarea{width:100%;border:1px solid #cbd7e5;border-radius:12px;padding:12px 11px;background:white;color:#172b4d;min-height:48px;font-size:16px;outline:none}.field input:focus,.field select:focus,.field textarea:focus{border-color:#3b8eea;box-shadow:0 0 0 3px #1475e319}.field textarea{min-height:88px;resize:vertical}.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.actions .btn{flex:1}.kpis{display:grid;grid-template-columns:1fr 1fr;gap:8px}.kpi{background:white;border-radius:15px;padding:12px;border:1px solid #e0e6ee;min-height:92px}.kpi .n{font-size:24px;font-weight:900;margin-top:6px}.kpi.blue{border-right:5px solid var(--blue)}.kpi.green{border-right:5px solid var(--green)}.kpi.red{border-right:5px solid var(--red)}.kpi.orange{border-right:5px solid var(--orange)}
.tablewrap{overflow:auto;border:1px solid var(--line);border-radius:13px;background:#fff;-webkit-overflow-scrolling:touch}.table{width:100%;border-collapse:collapse;min-width:600px}.table th,.table td{padding:10px 8px;border-bottom:1px solid #edf0f4;text-align:center;font-size:13px}.table th{background:#eaf2fb;color:#26486e;position:sticky;top:0;z-index:3}.table input,.table select{width:82px;padding:9px;border:1px solid #ccd7e5;border-radius:9px;font-size:16px}.table tr:last-child td{border-bottom:0}.badge{display:inline-block;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:900;background:#e7edf5;color:#3a506b}.badge.green{background:#dff4e9;color:#11663f}.badge.red{background:#fde5e9;color:#9f283d}.badge.orange{background:#fff0d6;color:#9c5a00}.badge.blue{background:#dfeeff;color:#0b5eac}.badge.purple{background:#efe4f7;color:#6e2f9d}.list{display:flex;flex-direction:column;gap:8px}.item{background:white;border:1px solid #e1e6ed;border-radius:14px;padding:13px;display:flex;justify-content:space-between;gap:10px;align-items:flex-start;box-shadow:0 2px 7px #172b4d08}.item:active{transform:scale(.995)}.item-main{min-width:0}.item-title{font-weight:900}.item-meta{font-size:12px;color:var(--muted);margin-top:5px;line-height:1.7}.ltr{direction:ltr;text-align:left}.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.section-title{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:2px 0 10px}.section-title h2{font-size:18px;margin:0}.notice{padding:11px 12px;border-radius:12px;background:#fff7df;border:1px solid #ffe2a1;color:#795100;font-size:12px;line-height:1.8}.error{padding:12px;border-radius:12px;background:#fee9ed;border:1px solid #ffc9d2;color:#8e2134}.ok{padding:12px;border-radius:12px;background:#e7f8ef;border:1px solid #bfead2;color:#156942}.tabs{display:flex;gap:6px;overflow:auto;margin-bottom:10px;scrollbar-width:none;padding-bottom:2px}.tabs::-webkit-scrollbar{display:none}.tabs button{border:0;border-radius:11px;padding:10px 12px;background:#eef2f7;white-space:nowrap;min-height:42px}.tabs button.active{background:#d8ebff;color:#075aa7;font-weight:900}.login{min-height:100dvh;display:grid;place-items:center;padding:18px;background:linear-gradient(145deg,#dbeeff,#f8fbff)}.login-card{width:min(430px,100%);background:white;border-radius:24px;padding:23px;box-shadow:0 18px 45px #16365f20}.logo{width:76px;height:76px;border-radius:22px;margin:auto;background:#0e4f86;color:white;display:grid;place-items:center;font-size:36px}.login h1{text-align:center;margin:12px 0 4px;font-size:22px}.login p{text-align:center;color:var(--muted);margin:0 0 18px}.demo{font-size:11px;background:#f5f8fc;padding:10px;border-radius:10px;margin-top:12px;line-height:1.9}.matrix th:first-child,.matrix td:first-child{position:sticky;right:0;background:#fff;z-index:2}.matrix th:first-child{background:#eaf2fb}.matrix input{width:68px}.muted{color:var(--muted)}.danger-text{color:var(--red);font-weight:900}.good-text{color:var(--green);font-weight:900}.divider{height:1px;background:var(--line);margin:12px 0}.timeline{border-right:3px solid #d7e6f6;margin-right:7px;padding-right:15px}.event{position:relative;margin:0 0 12px}.event:before{content:"";position:absolute;right:-21px;top:5px;width:10px;height:10px;border-radius:50%;background:var(--blue)}.event .time{font-size:11px;color:var(--muted)}
#toast{position:fixed;bottom:calc(78px + var(--safe-bottom));right:50%;transform:translateX(50%);z-index:100;width:max-content;max-width:88%;padding:11px 15px;border-radius:12px;background:#172b4d;color:white;opacity:0;pointer-events:none;transition:.2s}#toast.show{opacity:1}.install-banner{display:none;background:#e9f4ff;border:1px solid #bedcff;color:#124f84;border-radius:12px;padding:9px 11px;font-size:12px;align-items:center;gap:8px}.install-banner.show{display:flex}.install-banner button{margin-right:auto}
@media(min-width:560px){.grid.two{grid-template-columns:1fr 1fr}.grid.three{grid-template-columns:repeat(2,1fr)}}


/* ===== ALMATEEN UI V2 ===== */

:root{
  --shadow-soft:0 8px 24px rgba(25,52,77,.07);
  --shadow-hover:0 12px 30px rgba(25,52,77,.11);
  --radius-lg:20px;
}

/* صفحه و فضای کلی */
.page{
  padding:14px;
}

.card{
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-soft);
  border-color:#e2e9f1;
  transition:box-shadow .18s ease,transform .18s ease;
}

/* عنوان بخش‌ها */
.section-title{
  margin:4px 0 14px;
}

.section-title h2{
  font-size:20px;
  letter-spacing:-.2px;
}

.section-title h3{
  margin:0;
  font-size:16px;
}

/* کارت‌های آماری */
.kpis{
  gap:10px;
  margin-bottom:14px;
}

.kpi{
  min-height:100px;
  padding:14px;
  border-radius:17px;
  box-shadow:0 4px 14px rgba(25,52,77,.045);
  position:relative;
  overflow:hidden;
}

.kpi:after{
  content:"";
  position:absolute;
  width:70px;
  height:70px;
  border-radius:50%;
  left:-28px;
  bottom:-32px;
  background:rgba(20,117,227,.035);
}

.kpi .n{
  font-size:25px;
  line-height:1.25;
}

/* لیست‌ها */
.item{
  border-radius:15px;
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}

.item[onclick]{
  cursor:pointer;
}

.item[onclick]:active{
  background:#f7faff;
}

/* جدول‌ها */
.tablewrap{
  border-radius:15px;
  box-shadow:0 2px 9px rgba(25,52,77,.035);
}

.table th{
  background:linear-gradient(180deg,#edf5fd,#e7f0fa);
  font-weight:900;
}

.table tbody tr:nth-child(even){
  background:#fbfcfe;
}

.table td{
  vertical-align:middle;
}

/* دکمه‌ها */
.btn{
  transition:transform .12s ease,filter .12s ease,box-shadow .12s ease;
}

.btn:active{
  transform:scale(.98);
}

.btn.primary,
.btn.green,
.btn.red,
.btn.orange{
  box-shadow:0 5px 13px rgba(25,52,77,.10);
}

/* نوار بالا */
.topbar{
  padding-inline:16px;
}

.brand{
  font-size:17px;
  letter-spacing:.2px;
}

/* منوی پایین */
.nav button{
  transition:background .15s ease,color .15s ease,transform .15s ease;
}

.nav button.active{
  box-shadow:inset 0 0 0 1px #c9e2ff;
}

.nav button[data-r="wages"]:before{
  content:"﷼";
  font-size:17px;
}

/* فرم‌ها */
.field input,
.field select,
.field textarea{
  transition:border-color .15s ease,box-shadow .15s ease,background .15s ease;
}

.field input:hover,
.field select:hover,
.field textarea:hover{
  border-color:#afc3d8;
}

/* تب‌ها */
.tabs button{
  transition:background .15s ease,color .15s ease;
}

.tabs button.active{
  box-shadow:inset 0 0 0 1px #bcdcff;
}

/* تایم‌لاین */
.timeline{
  background:#fbfdff;
  border-radius:14px;
  padding-top:10px;
  padding-bottom:4px;
  padding-left:10px;
}

/* صفحه ورود */
.login-card{
  border:1px solid #e4ebf3;
  box-shadow:0 24px 60px rgba(22,54,95,.16);
}

.logo{
  box-shadow:0 10px 25px rgba(14,79,134,.20);
}

/* دسکتاپ و تبلت بزرگ */
@media(min-width:900px){
  html{
    background:#e5edf5;
  }

  .shell{
    width:min(1180px,calc(100% - 34px));
    border-left:1px solid #dce5ee;
    border-right:1px solid #dce5ee;
  }

  .nav{
    width:min(1180px,calc(100% - 34px));
  }

  .page{
    padding:20px 22px;
  }

  .topbar{
    padding-left:22px;
    padding-right:22px;
  }

  .kpis{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }

  .grid.two{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .grid.three{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .table{
    min-width:100%;
  }

  .card{
    padding:18px;
    margin-bottom:15px;
  }

  .actions .btn{
    flex:0 1 auto;
  }
}

/* نمایش متوسط */
@media(min-width:560px) and (max-width:899px){
  .kpis{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

/* موبایل کوچک */
@media(max-width:420px){
  .page{
    padding:9px;
  }

  .card{
    padding:12px;
    border-radius:15px;
  }

  .kpi{
    min-height:88px;
    padding:11px;
  }

  .kpi .n{
    font-size:21px;
  }

  .section-title h2{
    font-size:18px;
  }
}


/* ===== ADMIN DASHBOARD V2 ===== */

.admin-panel{
  position:relative;
  overflow:hidden;
  border-width:1px;
  border-style:solid;
  padding-top:17px;
}

.admin-panel:before{
  content:"";
  position:absolute;
  top:0;
  right:0;
  left:0;
  height:4px;
  border-radius:20px 20px 0 0;
}

/* نیاز به توجه مدیریت */
.admin-attention{
  background:linear-gradient(180deg,#fffdfb 0,#fff 120px);
  border-color:#f1dfcf;
}

.admin-attention:before{
  background:linear-gradient(90deg,#e58d16,#d9485f);
}

.admin-attention > .section-title h3{
  color:#9b4c20;
}

.admin-attention .grid.two > .card{
  box-shadow:none;
  border-color:#f0e4da;
  background:#fff;
  margin-bottom:0;
}

.admin-attention .grid.two > .card h4{
  font-size:13px;
  color:#6f4b35;
}

/* خلاصه مالی */
.admin-wages{
  background:linear-gradient(180deg,#f8fffb 0,#fff 130px);
  border-color:#d9eee3;
}

.admin-wages:before{
  background:linear-gradient(90deg,#169b62,#37b77c);
}

.admin-wages > .section-title h3{
  color:#116a45;
}

.admin-wages .list .item{
  border-color:#dcebe3;
}

.admin-wages .list .item > b{
  color:#116a45;
  white-space:nowrap;
}

/* میانبرها */
.admin-shortcuts{
  background:linear-gradient(180deg,#f8fbff 0,#fff 125px);
  border-color:#d8e7f7;
}

.admin-shortcuts:before{
  background:linear-gradient(90deg,#1475e3,#0d3b66);
}

.admin-shortcuts > .section-title h3{
  color:#0b5eac;
}

.admin-shortcuts .actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
  margin-top:4px;
}

.admin-shortcuts .actions .btn{
  width:100%;
  min-height:50px;
  flex:none;
}

/* فعالیت‌های اخیر */
.admin-activity{
  background:linear-gradient(180deg,#fcf9ff 0,#fff 125px);
  border-color:#e7dbf1;
}

.admin-activity:before{
  background:linear-gradient(90deg,#8d43c7,#62309b);
}

.admin-activity > .section-title h3{
  color:#6e2f9d;
}

.admin-activity .timeline{
  border-right-color:#dfcdf0;
  background:transparent;
}

.admin-activity .event{
  padding:9px 10px;
  border-radius:11px;
  transition:background .15s ease;
}

.admin-activity .event[onclick]:active{
  background:#f5effa;
}

.admin-activity .event:before{
  background:var(--purple);
}

/* تیترهای پنل */
.admin-panel > .section-title{
  padding-bottom:10px;
  border-bottom:1px solid #edf1f5;
}

.admin-panel > .section-title .sub{
  margin-top:4px;
}

/* روی دسکتاپ */
@media(min-width:900px){
  .admin-shortcuts .actions{
    grid-template-columns:repeat(5,minmax(0,1fr));
  }

  .admin-attention .grid.two{
    gap:12px;
  }

  .admin-panel{
    padding:20px;
  }

  .admin-panel:hover{
    box-shadow:var(--shadow-hover);
  }
}

/* روی موبایل */
@media(max-width:420px){
  .admin-shortcuts .actions{
    grid-template-columns:1fr 1fr;
  }

  .admin-shortcuts .btn{
    padding:10px 7px;
    font-size:12px;
  }

  .admin-panel > .section-title{
    align-items:flex-start;
  }
}


/* ===== SETTINGS V2 ===== */

.settings-main-title{
  margin-bottom:14px;
}

/* کارت‌های آماری بالا */
.settings-stats{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:14px;
}

.settings-stat{
  background:#fff;
  border:1px solid #e2e9f1;
  border-radius:18px;
  padding:14px;
  display:flex;
  align-items:center;
  gap:12px;
  min-height:92px;
  box-shadow:var(--shadow-soft);
  position:relative;
  overflow:hidden;
}

.settings-stat:after{
  content:"";
  position:absolute;
  width:70px;
  height:70px;
  border-radius:50%;
  left:-30px;
  bottom:-35px;
  opacity:.08;
  background:currentColor;
}

.settings-stat-icon{
  width:45px;
  height:45px;
  border-radius:14px;
  display:grid;
  place-items:center;
  font-size:21px;
  flex:0 0 45px;
}

.settings-stat-number{
  font-size:24px;
  font-weight:900;
  line-height:1.15;
}

.settings-stat-label{
  color:var(--muted);
  font-size:11px;
  margin-top:5px;
  font-weight:800;
}

.stat-model{
  color:#1475e3;
  border-right:4px solid #1475e3;
}

.stat-model .settings-stat-icon{
  background:#e7f2ff;
}

.stat-workshop{
  color:#169b62;
  border-right:4px solid #169b62;
}

.stat-workshop .settings-stat-icon{
  background:#e4f7ed;
}

.stat-user{
  color:#8d43c7;
  border-right:4px solid #8d43c7;
}

.stat-user .settings-stat-icon{
  background:#f1e8f8;
}

.stat-inactive{
  color:#d9485f;
  border-right:4px solid #d9485f;
}

.stat-inactive .settings-stat-icon{
  background:#fde9ed;
  font-weight:900;
}

/* تب‌های مدیریت */
.settings-tabs{
  display:flex;
  gap:7px;
  overflow-x:auto;
  scrollbar-width:none;
  padding:4px 1px 10px;
  margin-bottom:5px;
}

.settings-tabs::-webkit-scrollbar{
  display:none;
}

.settings-tab{
  border:1px solid #dbe4ee;
  background:#fff;
  color:#5f6f83;
  border-radius:13px;
  min-height:44px;
  padding:9px 13px;
  white-space:nowrap;
  font-weight:900;
  display:flex;
  align-items:center;
  gap:6px;
  transition:.15s ease;
}

.settings-tab span{
  font-size:16px;
}

.settings-tab.active{
  color:#0759a8;
  background:#e8f3ff;
  border-color:#bcdcff;
  box-shadow:0 4px 12px rgba(20,117,227,.08);
}

/* نمای کلی */
.settings-overview-grid{
  display:grid;
  gap:12px;
}

.settings-welcome{
  background:linear-gradient(135deg,#f6faff,#fff);
  border-color:#d9e8f7;
  display:flex;
  align-items:center;
  gap:14px;
}

.settings-welcome-icon{
  width:60px;
  height:60px;
  border-radius:18px;
  background:linear-gradient(135deg,#0d3b66,#1475e3);
  color:#fff;
  display:grid;
  place-items:center;
  font-size:28px;
  flex:0 0 60px;
  box-shadow:0 8px 20px rgba(20,117,227,.18);
}

.settings-welcome h3{
  margin-bottom:6px;
}

.settings-quick-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

.settings-quick-actions .btn{
  width:100%;
}

/* کارت افزودن */
.settings-add-grid{
  align-items:start;
}

.settings-add-card{
  position:relative;
  overflow:hidden;
}

.settings-add-card:before{
  content:"";
  position:absolute;
  right:0;
  top:0;
  bottom:0;
  width:4px;
}

.settings-add-card.model-card:before{
  background:var(--blue);
}

.settings-add-card.workshop-card:before{
  background:var(--green);
}

.settings-add-card.user-card:before{
  background:var(--purple);
}

.settings-card-head{
  display:flex;
  align-items:center;
  gap:11px;
  margin-bottom:15px;
  padding-bottom:12px;
  border-bottom:1px solid #edf1f5;
}

.settings-card-icon{
  width:46px;
  height:46px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:#edf4fc;
  font-size:22px;
  flex:0 0 46px;
}

.workshop-card .settings-card-icon{
  background:#e7f7ef;
}

.user-card .settings-card-icon{
  background:#f1e8f8;
}

.settings-card-head h3{
  margin:0 0 4px;
}

/* عنوان لیست */
.settings-list-title{
  margin-bottom:12px;
}

/* جستجو */
.settings-search{
  display:flex;
  align-items:center;
  gap:8px;
  background:#f7f9fc;
  border:1px solid #dbe4ee;
  border-radius:13px;
  padding:0 11px;
  margin-bottom:12px;
  min-height:48px;
}

.settings-search span{
  font-size:22px;
  color:#738399;
}

.settings-search input{
  border:0;
  outline:0;
  background:transparent;
  min-width:0;
  flex:1;
  min-height:46px;
  font-size:15px;
  color:var(--text);
}

.settings-search:focus-within{
  border-color:#7eb5ee;
  box-shadow:0 0 0 3px rgba(20,117,227,.09);
  background:#fff;
}

/* جدول مدیریت */
.settings-table th{
  white-space:nowrap;
}

.settings-table td{
  vertical-align:middle;
}

.settings-row-actions{
  display:flex;
  justify-content:center;
  gap:6px;
  flex-wrap:wrap;
}

.settings-row-actions .btn{
  min-width:76px;
}

/* دسکتاپ */
@media(min-width:900px){
  .settings-stats{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }

  .settings-overview-grid{
    grid-template-columns:1.1fr .9fr;
  }

  .settings-tabs{
    overflow:visible;
  }

  .settings-tab{
    flex:1;
    justify-content:center;
  }

  .settings-add-card{
    min-height:100%;
  }

  .settings-quick-actions{
    grid-template-columns:1fr 1fr;
  }
}

/* موبایل */
@media(max-width:480px){
  .settings-stats{
    gap:7px;
  }

  .settings-stat{
    min-height:82px;
    padding:11px;
    gap:8px;
    border-radius:15px;
  }

  .settings-stat-icon{
    width:38px;
    height:38px;
    flex-basis:38px;
    font-size:18px;
    border-radius:12px;
  }

  .settings-stat-number{
    font-size:20px;
  }

  .settings-stat-label{
    font-size:10px;
  }

  .settings-tab{
    min-height:42px;
    padding:8px 10px;
    font-size:11px;
  }

  .settings-quick-actions{
    grid-template-columns:1fr;
  }

  .settings-welcome{
    align-items:flex-start;
  }

  .settings-welcome-icon{
    width:48px;
    height:48px;
    flex-basis:48px;
    font-size:22px;
  }

  .settings-row-actions{
    min-width:155px;
  }
}


/* ===== ALMATEEN MODAL SYSTEM ===== */

.app-modal-root{
  position:fixed;
  inset:0;
  z-index:1000;
  display:grid;
  place-items:center;
  padding:18px;
  opacity:0;
  transition:opacity .14s ease;
}

.app-modal-root.show{
  opacity:1;
}

.app-modal-root.closing{
  opacity:0;
}

.app-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(7,24,43,.58);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
}

.app-modal{
  position:relative;
  z-index:1;
  width:min(620px,100%);
  max-height:min(88dvh,850px);
  overflow:auto;
  background:#fff;
  border-radius:24px;
  border:1px solid #dfe8f1;
  box-shadow:0 28px 80px rgba(4,24,44,.30);
  transform:translateY(12px) scale(.985);
  transition:transform .16s ease;
  direction:rtl;
}

.app-modal-root.show .app-modal{
  transform:translateY(0) scale(1);
}

.app-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:18px 20px;
  background:linear-gradient(135deg,#f4f9ff,#edf6ff);
  border-bottom:1px solid #e3ebf3;
  position:sticky;
  top:0;
  z-index:3;
}

.app-modal-title-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.app-modal-title-wrap h3{
  margin:0 0 4px;
  font-size:19px;
}

.app-modal-icon{
  width:46px;
  height:46px;
  border-radius:15px;
  background:#dceeff;
  color:#0b66b7;
  display:grid;
  place-items:center;
  font-size:23px;
  font-weight:900;
  flex:0 0 46px;
}

.app-modal-x{
  width:42px;
  height:42px;
  border:0;
  border-radius:50%;
  background:#e7edf4;
  color:#52657a;
  font-size:27px;
  line-height:1;
  display:grid;
  place-items:center;
  flex:0 0 42px;
}

.app-modal-body{
  padding:20px;
}

.app-modal-fields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:15px 12px;
}

.modal-field{
  display:flex;
  flex-direction:column;
  gap:7px;
}

.modal-field-full{
  grid-column:1/-1;
}

.modal-field label{
  font-size:13px;
  font-weight:900;
  color:#24364c;
}

.modal-required{
  color:var(--red);
  margin-right:3px;
}

.modal-field input,
.modal-field select,
.modal-field textarea{
  width:100%;
  border:1px solid #ccd8e5;
  border-radius:13px;
  background:#fff;
  color:#172b4d;
  min-height:50px;
  padding:12px 13px;
  font-size:16px;
  outline:none;
  transition:border-color .15s ease,box-shadow .15s ease;
}

.modal-field textarea{
  min-height:100px;
  resize:vertical;
}

.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus{
  border-color:#5a9fe8;
  box-shadow:0 0 0 3px rgba(20,117,227,.11);
}

.modal-help{
  font-size:11px;
  color:var(--muted);
  line-height:1.7;
}

.modal-switch-row{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  border:1px solid #dfe6ee;
  border-radius:14px;
  padding:12px 14px;
  background:#f9fbfd;
  cursor:pointer;
}

.modal-switch-row input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.modal-switch{
  width:48px;
  height:28px;
  background:#bfc9d5;
  border-radius:999px;
  position:relative;
  transition:.15s ease;
  flex:0 0 48px;
}

.modal-switch:after{
  content:"";
  position:absolute;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#fff;
  top:3px;
  left:3px;
  box-shadow:0 2px 5px #0002;
  transition:.15s ease;
}

.modal-switch-row input:checked + .modal-switch{
  background:var(--green);
}

.modal-switch-row input:checked + .modal-switch:after{
  transform:translateX(20px);
}

.app-modal-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  padding:14px 20px 20px;
  position:sticky;
  bottom:0;
  background:linear-gradient(180deg,rgba(255,255,255,.88),#fff 28%);
}

.app-modal-actions .btn{
  min-height:50px;
}

.app-modal-cancel{
  background:#edf1f5;
}

@media(max-width:520px){
  .app-modal-root{
    padding:10px;
    align-items:end;
  }

  .app-modal{
    width:100%;
    max-height:92dvh;
    border-radius:22px 22px 12px 12px;
  }

  .app-modal-head{
    padding:15px;
  }

  .app-modal-body{
    padding:15px;
  }

  .app-modal-fields{
    grid-template-columns:1fr;
  }

  .modal-field-full{
    grid-column:auto;
  }

  .app-modal-actions{
    padding:12px 15px calc(15px + env(safe-area-inset-bottom,0px));
  }
}


/* ===== ALMATEEN UI V18 ===== */

:root{
  --v18-navy:#092f50;
  --v18-navy2:#0f527f;
  --v18-blue:#1976e8;
  --v18-soft:#f4f7fa;
  --v18-line:#dfe7ef;
}

/* هدر جدید */
.topbar-v18{
  background:linear-gradient(135deg,var(--v18-navy),var(--v18-navy2));
  min-height:74px;
  padding:12px 17px;
  box-shadow:0 5px 20px rgba(9,47,80,.18);
}

.topbar-brand-wrap{
  display:flex;
  align-items:center;
  gap:10px;
}

.topbar-logo{
  width:43px;
  height:43px;
  border-radius:13px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.18);
  color:#fff;
}

.topbar-logo svg{
  width:27px;
  height:27px;
}

.topbar-v18 .brand{
  font-size:18px;
}

.topbar-v18 .userbox{
  opacity:.82;
}

/* منوی پایین */
.nav-v18{
  border-top:1px solid #e1e8ef;
  padding-top:7px;
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(12px);
}

.nav-v18 button{
  position:relative;
  min-height:57px;
  border-radius:14px;
  padding-top:8px;
}

.nav-v18 button:before{
  width:30px;
  height:27px;
  margin:0 auto 3px;
  display:grid;
  place-items:center;
  border-radius:9px;
  font-size:18px;
}

.nav-v18 button.active{
  background:#eaf4ff;
  color:#0961b2;
}

.nav-v18 button.active:before{
  background:#d9ebff;
}

/* آیکون‌های منوی پایین */
.nav-v18 button[data-r="dashboard"]:before{content:"⌂"}
.nav-v18 button[data-r="cuts"]:before{content:"✂"}
.nav-v18 button[data-r="newcut"]:before{content:"＋"}
.nav-v18 button[data-r="corrections"]:before{content:"↺"}
.nav-v18 button[data-r="wages"]:before{content:"﷼"}
.nav-v18 button[data-r="settings"]:before{content:"⚙"}

/* صفحه ورود */
.login-v18{
  padding:0;
  background:
    radial-gradient(circle at 20% 20%,rgba(36,126,192,.20),transparent 34%),
    linear-gradient(145deg,#071d30,#0d4169);
}

.login-card-v18{
  width:min(900px,94%);
  padding:0;
  overflow:hidden;
  display:grid;
  grid-template-columns:.9fr 1.1fr;
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 32px 80px rgba(0,0,0,.30);
}

.login-brand-area{
  min-height:500px;
  padding:48px 28px;
  color:#fff;
  background:
    radial-gradient(circle at 50% 82%,rgba(26,123,188,.28),transparent 34%),
    linear-gradient(155deg,#071d30,#0b3558);
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
  position:relative;
  overflow:hidden;
}

.login-brand-area:after{
  content:"";
  position:absolute;
  width:320px;
  height:130px;
  border-radius:50%;
  bottom:-80px;
  left:-70px;
  background:rgba(45,143,209,.13);
  transform:rotate(-12deg);
}

.login-brand-mark{
  width:104px;
  height:104px;
  border-radius:30px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.15);
  margin-bottom:20px;
  color:#fff;
}

.login-brand-mark svg{
  width:65px;
  height:65px;
}

.login-brand-name{
  font-size:32px;
  font-weight:900;
}

.login-brand-sub{
  font-size:14px;
  opacity:.78;
  margin-top:8px;
}

.login-form-area{
  background:#fff;
  padding:48px 42px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.login-welcome{
  margin-bottom:24px;
}

.login-welcome h1{
  text-align:right;
  font-size:24px;
  margin:0 0 8px;
}

.login-welcome p{
  text-align:right;
  margin:0;
  font-size:13px;
}

.login-form-v18{
  gap:15px;
}

.login-input-wrap{
  display:flex;
  align-items:center;
  border:1px solid #cdd9e6;
  border-radius:14px;
  background:#fbfcfe;
  overflow:hidden;
  transition:.15s ease;
}

.login-input-wrap:focus-within{
  border-color:#4c98e8;
  box-shadow:0 0 0 3px rgba(20,117,227,.10);
  background:#fff;
}

.login-input-wrap span{
  width:46px;
  text-align:center;
  color:#73849a;
  font-size:19px;
}

.login-input-wrap input{
  border:0!important;
  box-shadow:none!important;
  background:transparent!important;
  border-radius:0!important;
}

.login-submit{
  min-height:52px;
  margin-top:5px;
  font-size:15px;
  background:linear-gradient(135deg,#1475e3,#075aa7)!important;
}

.login-install-note{
  margin-top:18px;
  padding:11px 12px;
  border-radius:12px;
  background:#f4f7fa;
  color:#738197;
  font-size:11px;
  line-height:1.8;
}

/* کارت‌ها کمی تمیزتر */
.shell-v18 .card{
  border-color:#e1e8ef;
}

.shell-v18 .section-title h2{
  color:#102c47;
}

/* موبایل */
@media(max-width:700px){
  .login-card-v18{
    width:min(430px,94%);
    grid-template-columns:1fr;
  }

  .login-brand-area{
    min-height:235px;
    padding:30px 20px;
  }

  .login-brand-mark{
    width:76px;
    height:76px;
    border-radius:23px;
    margin-bottom:12px;
  }

  .login-brand-mark svg{
    width:47px;
    height:47px;
  }

  .login-brand-name{
    font-size:26px;
  }

  .login-form-area{
    padding:28px 22px;
  }

  .login-welcome h1{
    font-size:21px;
  }

  .topbar-v18{
    min-height:66px;
    padding-inline:12px;
  }

  .topbar-logo{
    width:38px;
    height:38px;
  }
}


/* ===== DASHBOARD V18 ===== */

.dashboard-v18{
  display:block;
}

.dashboard-head-v18{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:2px 0 16px;
  padding:3px 2px;
}

.dashboard-head-v18 h2{
  margin:3px 0 5px;
  font-size:22px;
  color:#102c47;
}

.dashboard-eyebrow{
  font-size:10px;
  font-weight:900;
  color:#1475e3;
  letter-spacing:.1px;
}

.dashboard-refresh-v18{
  background:#fff;
  border:1px solid #dce6ef;
  color:#36536f;
  box-shadow:0 4px 12px rgba(20,52,78,.05);
  white-space:nowrap;
}

/* KPI اصلی */
.dashboard-kpis-v18{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
  margin-bottom:14px;
}

.dashboard-kpi-v18{
  position:relative;
  overflow:hidden;
  min-height:100px;
  background:#fff;
  border:1px solid #e1e8ef;
  border-radius:18px;
  padding:13px;
  display:flex;
  align-items:center;
  gap:11px;
  box-shadow:0 6px 18px rgba(20,52,78,.055);
}

.dashboard-kpi-v18:after{
  content:"";
  position:absolute;
  width:70px;
  height:70px;
  border-radius:50%;
  left:-33px;
  bottom:-35px;
  background:currentColor;
  opacity:.055;
}

.dashboard-kpi-icon{
  width:43px;
  height:43px;
  flex:0 0 43px;
  border-radius:14px;
  display:grid;
  place-items:center;
  font-size:20px;
  font-weight:900;
  background:#edf4fb;
}

.dashboard-kpi-label{
  color:#687a8e;
  font-size:11px;
  font-weight:800;
}

.dashboard-kpi-number{
  margin-top:5px;
  color:#172b4d;
  font-size:25px;
  line-height:1.15;
  font-weight:900;
}

.dk-blue{color:#1475e3;border-right:4px solid #1475e3}
.dk-blue .dashboard-kpi-icon{background:#e6f2ff}

.dk-green{color:#169b62;border-right:4px solid #169b62}
.dk-green .dashboard-kpi-icon{background:#e4f7ed}

.dk-indigo{color:#5268d7;border-right:4px solid #5268d7}
.dk-indigo .dashboard-kpi-icon{background:#ebedff}

.dk-teal{color:#168b91;border-right:4px solid #168b91}
.dk-teal .dashboard-kpi-icon{background:#e2f6f7}

.dk-orange{color:#e58d16;border-right:4px solid #e58d16}
.dk-orange .dashboard-kpi-icon{background:#fff1dc}

.dk-red{color:#d9485f;border-right:4px solid #d9485f}
.dk-red .dashboard-kpi-icon{background:#fde9ed}

.dk-amber{color:#c98612;border-right:4px solid #c98612}
.dk-amber .dashboard-kpi-icon{background:#fff2d6}

.dk-purple{color:#8d43c7;border-right:4px solid #8d43c7}
.dk-purple .dashboard-kpi-icon{background:#f1e7f8}

/* تیتر کارت‌ها */
.dashboard-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-bottom:11px;
  margin-bottom:13px;
  border-bottom:1px solid #edf1f5;
}

.dashboard-card-head h3{
  margin:0 0 4px;
}

/* دسترسی سریع */
.dashboard-shortcuts-v18{
  background:
    linear-gradient(135deg,rgba(20,117,227,.045),transparent 45%),
    #fff;
}

.dashboard-shortcut-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

.dashboard-shortcut{
  border:1px solid #e0e8f0;
  border-radius:15px;
  min-height:70px;
  padding:10px;
  background:#fafcff;
  color:#243b53;
  display:flex;
  align-items:center;
  gap:10px;
  text-align:right;
  cursor:pointer;
  transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease;
}

.dashboard-shortcut:active{
  transform:scale(.985);
}

.shortcut-icon{
  width:40px;
  height:40px;
  flex:0 0 40px;
  border-radius:12px;
  display:grid;
  place-items:center;
  font-size:20px;
  font-weight:900;
  background:#eaf3fc;
}

.dashboard-shortcut b{
  display:block;
  font-size:12px;
}

.dashboard-shortcut small{
  display:block;
  margin-top:4px;
  color:#7b8999;
  font-size:9px;
}

.sc-cut .shortcut-icon{background:#e4f1ff;color:#1475e3}
.sc-list .shortcut-icon{background:#eef2f7;color:#50647b}
.sc-wage .shortcut-icon{background:#e4f7ed;color:#169b62}
.sc-correction .shortcut-icon{background:#fff1dc;color:#d77d08}
.sc-settings .shortcut-icon{background:#f1e7f8;color:#8d43c7}

/* پنل‌های مدیریت داخل داشبورد */
.dashboard-v18 .admin-panel{
  margin-top:0;
}

.dashboard-v18 .admin-panel > .section-title{
  margin-top:0;
}

.dashboard-v18 .admin-attention{
  box-shadow:0 7px 22px rgba(176,93,24,.07);
}

.dashboard-v18 .admin-wages{
  box-shadow:0 7px 22px rgba(22,155,98,.07);
}

/* جدول کارگاه‌ها */
.dashboard-workshops-v18{
  overflow:hidden;
}

.dashboard-workshops-v18 .table th{
  padding-top:12px;
  padding-bottom:12px;
}

.dashboard-workshops-v18 .table td{
  padding-top:12px;
  padding-bottom:12px;
}

.dashboard-shortage-value{
  display:inline-block;
  min-width:36px;
}

/* دسکتاپ */
@media(min-width:900px){
  .dashboard-kpis-v18{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
  }

  .dashboard-kpi-v18{
    min-height:112px;
    padding:16px;
  }

  .dashboard-shortcut-grid{
    grid-template-columns:repeat(5,minmax(0,1fr));
  }

  .dashboard-shortcut{
    min-height:82px;
  }

  .dashboard-kpi-number{
    font-size:28px;
  }
}

/* موبایل */
@media(max-width:430px){
  .dashboard-head-v18{
    align-items:flex-start;
  }

  .dashboard-head-v18 h2{
    font-size:20px;
  }

  .dashboard-refresh-v18{
    padding:8px 10px;
    min-height:38px;
    font-size:11px;
  }

  .dashboard-kpis-v18{
    gap:7px;
  }

  .dashboard-kpi-v18{
    min-height:88px;
    padding:10px;
    gap:8px;
    border-radius:15px;
  }

  .dashboard-kpi-icon{
    width:37px;
    height:37px;
    flex-basis:37px;
    border-radius:11px;
    font-size:17px;
  }

  .dashboard-kpi-number{
    font-size:21px;
  }

  .dashboard-kpi-label{
    font-size:10px;
  }

  .dashboard-shortcut{
    padding:8px;
  }
}
